CLI tool to fetch and save Cursor rules from cursor.directory
npm install cursor-directoryA 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:
``bash`
npx cursor-directory rules add
`bash`
npm install -g cursor-directory
Then run with:
`bash`
cursor-directory rules add
`bashUsing npx (without installation)
npx cursor-directory rules add
$3
`bash
Using npx with a slug
npx cursor-directory rules add al-buisnesscentral-development-cursor-rulesUsing npx with a URL
npx cursor-directory rules add https://cursor.directory/front-end-cursor-rulesOr if installed globally
cursor-directory rules add al-buisnesscentral-development-cursor-rules
`How It Works
This CLI tool:
1. Fetches the rule directly from
cursor.directory/api/[slug]
2. If a URL is provided, extracts the slug from it
3. Saves the rule to .cursor/rules/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