CLI tool to fetch and install Cursor dev rules into your project
Project description
Cursor Dev Rules
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.
Features
- ๐ 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
Installation
Using pip
pip install cursor-dev-rules
Using uv
uv pip install cursor-dev-rules
Development Installation
git clone https://github.com/yourusername/cursor-dev-rules.git
cd cursor-dev-rules
pip install -e ".[dev]"
Quick Start
-
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:
Usage
Basic Usage
cursor-dev-rules fetch <category>/<framework>
Examples
Backend Frameworks:
# Django
cursor-dev-rules fetch backend/django
# FastAPI
cursor-dev-rules fetch backend/fastapi
Frontend Frameworks:
# Next.js
cursor-dev-rules fetch frontend/nextjs
Command Options
--version: Show the version number--help: Show help message
Available Rules
Backend Rules
- 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 Rules
- frontend/nextjs - Next.js development standards and best practices
- frontend/general - General frontend development rules (automatically included)
Project Structure
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
โโโ ...
How It Works
- 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
Development
Running Tests
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Run tests with coverage
pytest --cov=cursor_dev_rules --cov-report=html
Repository Structure
cursor-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
Contributing
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
Adding New Rules
- 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
Requirements
- Python >= 3.11
- Click >= 8.1.0
- Rich >= 13.0.0
Support
If you encounter any issues or have questions, please open an issue on the GitHub repository.
Changelog
See CHANGELOG.md for a detailed list of changes.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file cursor_dev_rules-0.1.1.tar.gz.
File metadata
- Download URL: cursor_dev_rules-0.1.1.tar.gz
- Upload date:
- Size: 26.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a483b1caa559e8730287d669ce4e89c3bdbc058a48193ed9aae849f6fa8c7310
|
|
| MD5 |
8656a72c7e34699f171fb1a827a09115
|
|
| BLAKE2b-256 |
2151ac31d4b6f76a087c6836834283e68912961087e9a548633951e1db2d17d6
|
File details
Details for the file cursor_dev_rules-0.1.1-py3-none-any.whl.
File metadata
- Download URL: cursor_dev_rules-0.1.1-py3-none-any.whl
- Upload date:
- Size: 24.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
49393fe3ac67c74d41aceb3a524b2b8c4045642e6b55b21cfe1bef9306cc9bd2
|
|
| MD5 |
9c4864d5e8f992372ca31c722db43b79
|
|
| BLAKE2b-256 |
a83f7a8076828b19c183fefc0bd36a73e851a13798b2b9e29bca44b9eb4e9541
|