Update README with more user-friendly and comprehensive documentation

- Rewrite README to be more approachable and conversational
- Add more detailed usage examples and explanations
- Improve section structure for better readability
- Include more CLI options and use cases
- Enhance documentation for custom repository and configuration management
This commit is contained in:
sanjeed5
2025-03-03 23:10:19 +05:30
parent 2cdc5f61d4
commit f4e495b2e0
+91 -53
View File
@@ -1,98 +1,128 @@
# Cursor Rules CLI # 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. A simple tool that helps you find and install the right Cursor rules for your project. It looks at what libraries and frameworks you're using and suggests matching rules.
## Features ## What does it do?
- 🔍 Automatically scans your project to detect libraries and frameworks - 🔍 Looks at your project and figures out what libraries you're using
- 🔄 Matches detected libraries with available Cursor rules - 📝 Lets you directly specify libraries if you know what you want
- 📥 Downloads and installs relevant rules to your `.cursor/rules` directory - 📥 Downloads and installs the right rules into your Cursor
- 🎨 Interactive and colorful CLI interface - 🎨 Shows everything in a nice, colorful interface
- 🔀 Supports custom repositories for advanced users - 🔀 Works with custom rule repositories too
## Installation ## Getting Started
### From PyPI (Recommended) ### Quick Install
```bash ```bash
# Install from PyPI
pip install cursor-rules pip install cursor-rules
``` ```
### From Source ### Running it
The easiest way to use it:
```bash ```bash
# Clone the repository # Just run this in your project folder
git clone https://github.com/sanjeed5/awesome-cursor-rules-mdc cursor-rules
cd awesome-cursor-rules-mdc/cursor-rules-cli
# Install using pip
pip install -e .
``` ```
## Usage This will:
1. Look at your project
2. Show you what rules match your project
3. Let you choose which ones to install
4. Install them for you
### I know what rules I want
If you already know what libraries you want rules for:
```bash
# Just list them with commas
cursor-rules --libraries "react,tailwind,typescript"
```
This will:
1. Skip scanning your project directory
2. Only match rules for the libraries you specified
3. Let you choose which ones to install
4. Install them for you
### Common Use Cases
```bash ```bash
# Scan the current directory and install relevant rules # Looking at a specific project folder
cursor-rules cursor-rules -d /path/to/my/project
# Scan a specific directory # Just want to see what it would do (without installing anything)
cursor-rules -d /path/to/project
# Show what would be done without making changes
cursor-rules --dry-run cursor-rules --dry-run
# Force overwrite existing rules # Want to replace existing rules
cursor-rules --force cursor-rules --force
# Enable verbose output # Want to see more details about what's happening
cursor-rules -v cursor-rules -v
``` ```
## Advanced Usage ## Making it Work Your Way
### 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:
### Want to see fewer/more results?
```bash ```bash
# Use a custom repository for the current scan # Show only 5 results
cursor-rules --custom-repo username/repo cursor-rules --max-results 5
# Set custom repository globally without running scan # Only show really good matches
cursor-rules --custom-repo username/repo --set-repo cursor-rules --min-score 0.8
# 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. ### Skip Project Scanning
```bash
# Directly specify libraries (skips project scanning)
cursor-rules --libraries "react,vue,django"
### Configuration Management # Useful when you know exactly what you need
cursor-rules --libraries "pytorch,pandas,matplotlib" --force
```
### Quick Scan vs Deep Scan
```bash
# Do a quick scan (faster but might miss some things)
cursor-rules --quick-scan
```
### Using Your Own Rules Repository
Have your own collection of rules? You can use those instead:
```bash
# Use rules from your repository
cursor-rules --custom-repo your-username/your-repo
# Make it remember your repository for next time
cursor-rules --custom-repo your-username/your-repo --save-config
```
### Saving Your Preferences
```bash ```bash
# Show current configuration # See what settings you're using
cursor-rules --show-config cursor-rules --show-config
# Save current settings as global configuration # Save your current settings for all projects
cursor-rules --save-config cursor-rules --save-config
# Save current settings as project-specific configuration (except repository settings) # Save settings just for this project
cursor-rules --save-project-config cursor-rules --save-project-config
``` ```
## Configuration Files ## Need More Help?
The CLI uses the following configuration files: Run this to see all available options:
```bash
cursor-rules --help
```
- Global configuration: `~/.cursor/rules-cli-config.json` (includes custom repository settings) This will show you all the options:
- 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
``` ```
Options:
-h, --help Show this help message and exit -h, --help Show this help message and exit
-d DIRECTORY, --directory DIRECTORY -d DIRECTORY, --directory DIRECTORY
Project directory to scan (default: current directory) Project directory to scan (default: current directory)
@@ -106,8 +136,16 @@ Project-specific configuration takes precedence over global configuration for pr
Path to custom rules.json file Path to custom rules.json file
--save-config Save current settings as default configuration --save-config Save current settings as default configuration
--save-project-config --save-project-config
Save current settings as project-specific configuration (except repository settings) Save current settings as project-specific configuration
--show-config Show current configuration --show-config Show current configuration
--quick-scan Perform a quick scan (only check package files, not imports)
--max-results MAX_RESULTS
Maximum number of rules to display (default: 20)
--min-score MIN_SCORE
Minimum relevance score for rules (0-1, default: 0.5)
--libraries LIBRARIES
Comma-separated list of libraries to match directly (e.g., 'react,vue,django').
When specified, project scanning is skipped.
-v, --verbose Enable verbose output -v, --verbose Enable verbose output
``` ```
@@ -116,4 +154,4 @@ Project-specific configuration takes precedence over global configuration for pr
MIT MIT
## Todo: ## Todo:
- [ ] Test the custom repo - [ ] Test the custom repo feature