Skip to main content

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

  1. Navigate to your project directory:

    cd /path/to/your/project
    
  2. Fetch rules for your framework:

    cursor-dev-rules fetch backend/django
    
  3. 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

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

  1. The tool locates the bundled rules from the installed package
  2. It validates that both general and framework-specific rules exist
  3. It creates the .cursor/rules directory structure if it doesn't exist
  4. It copies the general rule to .cursor/rules/general/RULE.md
  5. 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:

  1. Add new framework rules - Create new rule files in the cursor_dev_rules/rules/ directory
  2. Improve existing rules - Update and enhance current rule files
  3. Bug fixes - Report and fix bugs
  4. Documentation - Improve documentation and examples
  5. Tests - Add more test coverage

Adding New Rules

  1. Create a new directory under cursor_dev_rules/rules/<category>/<framework>/
  2. Add a RULE.md file with your rules
  3. Update this README to include the new framework
  4. Add tests for the new rule path
  5. 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

cursor_dev_rules-0.1.1.tar.gz (26.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

cursor_dev_rules-0.1.1-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

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

Hashes for cursor_dev_rules-0.1.1.tar.gz
Algorithm Hash digest
SHA256 a483b1caa559e8730287d669ce4e89c3bdbc058a48193ed9aae849f6fa8c7310
MD5 8656a72c7e34699f171fb1a827a09115
BLAKE2b-256 2151ac31d4b6f76a087c6836834283e68912961087e9a548633951e1db2d17d6

See more details on using hashes here.

File details

Details for the file cursor_dev_rules-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for cursor_dev_rules-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 49393fe3ac67c74d41aceb3a524b2b8c4045642e6b55b21cfe1bef9306cc9bd2
MD5 9c4864d5e8f992372ca31c722db43b79
BLAKE2b-256 a83f7a8076828b19c183fefc0bd36a73e851a13798b2b9e29bca44b9eb4e9541

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page