mirror of
https://github.com/sanjeed5/awesome-cursor-rules-mdc.git
synced 2026-11-27 13:12:55 +08:00
3.2 KiB
3.2 KiB
Cursor Rules CLI Tool Plan
Overview
A command-line tool that scans a user's project directory to identify libraries and frameworks in use, then suggests relevant Cursor rules (.mdc files) for download from the awesome-cursor-rules-mdc repository.
Core Features
- Project Scanning: Detect libraries/frameworks used in the project
- Rule Matching: Match detected libraries with available MDC rules
- Interactive Selection: Allow users to select which rules to download
- Installation: Download and install selected rules to
.cursor/rulesdirectory - Security & Trust: Implement measures to ensure user safety and build trust
Technical Implementation
Project Structure
cursor-rules-cli/
├── src/
│ ├── __init__.py
│ ├── main.py # Entry point
│ ├── scanner.py # Project scanning logic
│ ├── matcher.py # Library matching logic
│ ├── downloader.py # Rule downloading functionality
│ ├── installer.py # Rule installation to .cursor/rules
│ └── utils.py # Utility functions
├── data/
│ └── libraries.json # Local copy of libraries mapping
├── tests/ # Unit tests
├── setup.py # Package configuration
├── README.md # Documentation
└── LICENSE # License file
Workflow
-
Scanning Phase:
- Scan project for package manager files (package.json, requirements.txt, etc.)
- Check import statements in source files
- Identify key framework-specific files/patterns
- Create a list of detected libraries
-
Matching Phase:
- Fetch latest rules.json from GitHub or use local copy if unavailable
- Cross-reference detected libraries with available MDC rules
- Generate a list of relevant rules
-
Selection Phase:
- Present an interactive CLI interface showing available rules
- Allow users to select all, none, or specific rules
- Provide brief descriptions of what each rule does
-
Installation Phase:
- Create
.cursor/rulesdirectory if it doesn't exist - Download selected rule files from the repository
- Display summary of downloaded rules
- Create
Security Considerations
-
Transparency:
- Show preview of rule content before installation
- Clearly indicate source URLs for downloads
- Open source the tool itself for inspection
-
Verification:
- Verify file integrity with checksums
- Only download from trusted sources
- Implement rate limiting to avoid API abuse
-
User Control:
- Always require explicit confirmation before downloading/installing
- Provide dry-run option to see what would happen without making changes
- Allow users to specify custom rule sources
Distribution
- Package as a Python package installable via pip/uv
- Publish to PyPI
- Provide standalone executables for major platforms
Next Steps
- Develop core scanning functionality
- Implement library matching logic
- Create interactive CLI interface
- Build downloading and installation components
- Add security features
- Write tests and documentation
- Package and publish