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 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 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.0.tar.gz (26.3 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.0-py3-none-any.whl (6.6 kB view details)

Uploaded Python 3

File details

Details for the file cursor_dev_rules-0.1.0.tar.gz.

File metadata

  • Download URL: cursor_dev_rules-0.1.0.tar.gz
  • Upload date:
  • Size: 26.3 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.0.tar.gz
Algorithm Hash digest
SHA256 1b23840da8cd4cb6f883511b3e3ebc68eb54d097dc5af66c7e7df8764763aefb
MD5 500684eaaea0331f4641af890ee7a51b
BLAKE2b-256 0da5a76eb92bf0c3be4b1984377ea2a019def4a35d95730b47855430783711d3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for cursor_dev_rules-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 14a74eb42c43335316b6b55be153a8fd666ac725285cee6f297d83a84742bddc
MD5 02e939f54a855717233ee9760f4f634f
BLAKE2b-256 27f987862b55c0ccad42a15fa9859b470cba29ec82f376617498282c320ca92f

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