1.0.5 • Published 4 months ago
cursor-directory v1.0.5
Cursor Directory CLI
A command-line tool to download and install Cursor Directory rules directly to your local Cursor editor.
Installation
There are two ways to use this tool:
Option 1: Use with npx (recommended)
Run directly without installing using npx:
npx cursor-directory rules add <slug|url>
Option 2: Install globally
npm install -g cursor-directory
Then run with:
cursor-directory rules add <slug|url>
Usage
# Using npx (without installation)
npx cursor-directory rules add <slug|url>
# Or if globally installed
cursor-directory rules add <slug|url>
Examples
# 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
How It Works
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
Available Rules
Visit cursor.directory to browse all available rules.
Features
- 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
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT