Skip to main content

A CLI tool to scan projects and install relevant Cursor rules

Project description

Cursor Rules CLI

A command-line tool to scan your projects and suggest relevant Cursor rules (.mdc files) based on the libraries and frameworks you're using.

Features

  • 🔍 Automatically scans your project to detect libraries and frameworks
  • 🔄 Matches detected libraries with available Cursor rules
  • 📥 Downloads and installs relevant rules to your .cursor/rules directory
  • 🎨 Interactive and colorful CLI interface
  • 🔀 Supports custom repositories for advanced users

Installation

From PyPI (Recommended)

# Install from PyPI
pip install cursor-rules

From Source

# Clone the repository
git clone https://github.com/sanjeed5/awesome-cursor-rules-mdc
cd awesome-cursor-rules-mdc/cursor-rules-cli

# Install using pip
pip install -e .

Usage

# Scan the current directory and install relevant rules
cursor-rules

# Scan a specific directory
cursor-rules -d /path/to/project

# Show what would be done without making changes
cursor-rules --dry-run

# Force overwrite existing rules
cursor-rules --force

# Enable verbose output
cursor-rules -v

Advanced Usage

Using a Custom Repository (untested)

You can use your own forked repository of Cursor rules. This is a CLI-wide setting that applies to all projects:

# Use a custom repository for the current scan
cursor-rules --custom-repo username/repo

# Set custom repository globally without running scan
cursor-rules --custom-repo username/repo --set-repo

# Save this setting as your default configuration
cursor-rules --custom-repo username/repo --save-config

Note: Custom repository settings are always global and not project-specific. The repository must contain a valid rules.json file at the root level.

Configuration Management

# Show current configuration
cursor-rules --show-config

# Save current settings as global configuration
cursor-rules --save-config

# Save current settings as project-specific configuration (except repository settings)
cursor-rules --save-project-config

Configuration Files

The CLI uses the following configuration files:

  • Global configuration: ~/.cursor/rules-cli-config.json (includes custom repository settings)
  • Project-specific configuration: .cursor-rules-cli.json in the project directory (excludes repository settings)

Project-specific configuration takes precedence over global configuration for project-specific settings.

Available Options

  -h, --help            Show this help message and exit
  -d DIRECTORY, --directory DIRECTORY
                        Project directory to scan (default: current directory)
  --dry-run             Show what would be done without making changes
  --force               Force overwrite existing rules
  --source SOURCE       Base URL for downloading rules
  --custom-repo CUSTOM_REPO
                        GitHub username/repo for a forked repository (e.g., 'username/repo')
  --set-repo            Set custom repository without running scan
  --rules-json RULES_JSON
                        Path to custom rules.json file
  --save-config         Save current settings as default configuration
  --save-project-config
                        Save current settings as project-specific configuration (except repository settings)
  --show-config         Show current configuration
  -v, --verbose         Enable verbose output

License

MIT

Todo:

  • Test the custom repo

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_rules-0.4.0.tar.gz (32.5 kB view details)

Uploaded Source

Built Distribution

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

cursor_rules-0.4.0-py3-none-any.whl (31.7 kB view details)

Uploaded Python 3

File details

Details for the file cursor_rules-0.4.0.tar.gz.

File metadata

  • Download URL: cursor_rules-0.4.0.tar.gz
  • Upload date:
  • Size: 32.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for cursor_rules-0.4.0.tar.gz
Algorithm Hash digest
SHA256 ab7de7da2ba35e1d9ba2d9e70f1e82ff5e59b3e4270b1504e5a549c0b96d9488
MD5 6482b5a775587097ef9b6b132b3e6e9f
BLAKE2b-256 fc047b6622612117c3fb8f33df14aade5e4884ddfc15da835cd0fbc6195d3462

See more details on using hashes here.

File details

Details for the file cursor_rules-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: cursor_rules-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 31.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.3

File hashes

Hashes for cursor_rules-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d70b5de8899a1f1639ff8dca2af44432be3b4137ac714073e03778fbb991e984
MD5 b2dbcb6549e6446714eff83e0de4a929
BLAKE2b-256 9d80cfd6298297d7485536783f9a3bd64b8df2a758da23d8d4d42ea91f39941f

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