A command-line tool to download and install Cursor Directory rules directly to your local Cursor editor.
There are two ways to use this tool:
Run directly without installing using npx:
npx cursor-directory rules add <slug|url>
npm install -g cursor-directory
Then run with:
cursor-directory rules add <slug|url>
# Using npx (without installation)
npx cursor-directory rules add <slug|url>
# Or if globally installed
cursor-directory rules add <slug|url>
# Using npx with a slug
npx cursor-directory rules add al-buisnesscentral-development-cursor-rules
# Using npx with a URL
npx cursor-directory rules add https://cursor.directory/front-end-cursor-rules
# Or if installed globally
cursor-directory rules add al-buisnesscentral-development-cursor-rules
This CLI tool:
- Fetches the rule directly from
cursor.directory/api/[slug]
- If a URL is provided, extracts the slug from it
- Saves the rule to
.cursor/rules/<slug>.mdc
with the proper frontmatter format - Sets up the proper metadata including title, empty globs, and alwaysApply: false
Visit cursor.directory to browse all available rules.
- Fetches cursor rules directly from the specific API endpoint
- Supports both direct slugs and full URLs
- Saves rules in the proper MDC format
- Creates the necessary directory structure if it doesn't exist
- Validates the existence of rules before attempting to save
Contributions are welcome! Please feel free to submit a Pull Request.
MIT