A CLI tool to fetch and install Cursor dev rules into your project. This tool helps you quickly set up standardized development rules for various frameworks and technologies in your Cursor IDE workspace.
- 🚀 Quick installation of pre-configured Cursor dev rules
- 📦 Support for multiple frameworks (Django, FastAPI, Next.js, and more)
- 🎯 Category-based organization (backend/frontend)
- ✨ Automatic directory structure creation
- 🔄 Overwrites existing rules to keep them up-to-date
pip install cursor-dev-rulesuv pip install cursor-dev-rulesgit clone https://github.com/yourusername/cursor-dev-rules.git
cd cursor-dev-rules
pip install -e ".[dev]"-
Navigate to your project directory:
cd /path/to/your/project -
Fetch rules for your framework:
cursor-dev-rules fetch backend/django
-
The rules will be installed in
.cursor/rules/directory:- General rules:
.cursor/rules/general/RULE.md - Framework-specific rules:
.cursor/rules/code-patterns/RULE.md
- General rules:
cursor-dev-rules fetch <category>/<framework>Backend Frameworks:
# Django
cursor-dev-rules fetch backend/django
# FastAPI
cursor-dev-rules fetch backend/fastapiFrontend Frameworks:
# Next.js
cursor-dev-rules fetch frontend/nextjs--version: Show the version number--help: Show help message
- backend/django - Django REST Framework development standards and best practices
- backend/fastapi - FastAPI development standards and best practices
- backend/general - General backend development rules (automatically included)
- frontend/nextjs - Next.js development standards and best practices
- frontend/general - General frontend development rules (automatically included)
After running fetch, your project will have the following structure:
your-project/
├── .cursor/
│ └── rules/
│ ├── general/
│ │ └── RULE.md # General category rules
│ └── code-patterns/
│ └── RULE.md # Framework-specific rules
└── ...
- The tool locates the bundled rules from the installed package
- It validates that both general and framework-specific rules exist
- It creates the
.cursor/rulesdirectory structure if it doesn't exist - It copies the general rule to
.cursor/rules/general/RULE.md - It copies the framework-specific rule to
.cursor/rules/code-patterns/RULE.md
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=cursor_dev_rules --cov-report=htmlcursor-dev-rules/
├── cursor_dev_rules/
│ ├── __init__.py
│ ├── cli.py # Main CLI implementation
│ └── rules/ # Bundled rules
│ ├── backend/
│ │ ├── django/
│ │ ├── fastapi/
│ │ └── general/
│ └── frontend/
│ ├── nextjs/
│ └── general/
├── tests/ # Test suite
│ ├── test_cli.py
│ ├── test_utils.py
│ └── conftest.py
├── pyproject.toml
└── README.md
Contributions are welcome! Please feel free to submit a Pull Request. Here are some ways you can contribute:
- Add new framework rules - Create new rule files in the
cursor_dev_rules/rules/directory - Improve existing rules - Update and enhance current rule files
- Bug fixes - Report and fix bugs
- Documentation - Improve documentation and examples
- Tests - Add more test coverage
- Create a new directory under
cursor_dev_rules/rules/<category>/<framework>/ - Add a
RULE.mdfile with your rules - Update this README to include the new framework
- Add tests for the new rule path
- Submit a Pull Request
- Python >= 3.11
- Click >= 8.1.0
- Rich >= 13.0.0
If you encounter any issues or have questions, please open an issue on the GitHub repository.
See CHANGELOG.md for a detailed list of changes.