Introducing Unofficial Cursor Rules CLI: Find the Perfect Rules for Your Project

Disclaimer: This project is not officially associated with or endorsed by Cursor. It is a community-driven initiative to enhance the Cursor experience.

Hey Cursor community! :waving_hand:

I’m excited to share a new tool that will make your Cursor experience even better: Cursor Rules CLI!

asciicast

What is Cursor Rules CLI?

Cursor Rules CLI is a simple yet powerful tool that helps you find and install the right Cursor rules for your project. It automatically scans your codebase to identify the libraries and frameworks you’re using, then suggests and installs matching MDC (Markdown Cursor) rules to enhance your coding experience.

Why You’ll Love It

  • :magnifying_glass_tilted_left: Auto-detection: Automatically identifies libraries in your project
  • :memo: Direct specification: Specify libraries manually if you prefer
  • :inbox_tray: One-click installation: Downloads and installs rules directly into Cursor
  • :artist_palette: User-friendly interface: Colorful, intuitive CLI experience
  • :shuffle_tracks_button: Custom repositories: Works with your own rule repositories
  • :locked: Privacy-focused: All scanning happens locally on your machine

Getting Started in Seconds

# Install with uv (recommended)
uv add cursor-rules

# Or use pip if you prefer
pip install cursor-rules

# Scan your project and install matching rules
cursor-rules

That’s it! The tool will scan your project, find the best rules, and install them automatically.

Power User Options

Want more control? We’ve got you covered:

# Preview without installing
cursor-rules --dry-run

# Specify libraries directly (skips scanning)
cursor-rules --libraries "react,tailwind,typescript"

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

# Replace existing rules
cursor-rules --force

How the Rules Were Created

The MDC rules powering this tool were created using a sophisticated two-step process:

  1. Semantic Search with Exa: We used Exa to perform semantic web searches for each library, gathering the most relevant best practices, common patterns, and expert recommendations.

  2. LLM Enhancement: The search results were then processed by an LLM (primarily Gemini) to create detailed, structured content optimized for Cursor’s MDC format.

This approach ensures that each rule contains high-quality, up-to-date information that will genuinely improve your coding experience.

Behind the Scenes

The entire project is built with efficiency in mind:

  • Parallel processing for generating rules
  • Smart retry system that focuses on failed libraries
  • Progress tracking to allow resuming interrupted runs
  • Configurable API rate limits and processing parameters

Contributing

This is just the beginning! We’d love your help to make Cursor Rules CLI even better:

  1. Try it out and share your feedback
  2. Suggest new libraries to add
  3. Create and share your own custom rules
  4. Help us test the custom repository feature

What’s Next?

We can work on:

  • Libraries with version rules (next14, next15, etc)
  • Extension?
  • Support for more frameworks and libraries

Get Involved

Try it today and let us know what you think! We’re excited to see how Cursor Rules CLI enhances your development workflow.

Happy coding! :laptop::sparkles:

3 Likes

not sure from where you would get the precise rules because often libraries have their own requirements etc. specially on non python projects.

what you made reads like documentation files which are better handled by @docs

while its cool, there is so much stuff inside thats so irrelevant for actual rules.

  1. you did not mention which version of each library you ‘documented’. referencing the wrong info is bad.
  2. i read a few of the files you created in the repo. Almost 90% is bland library docu repetitions that no LLM needs. If they were trained on that docu or even projects created with those libraries you do not need any docu at all and much less rules.
  3. the files are cross referencing other libraries and setting wrong rules since you dont check the actual libraries needed.
  4. lots of the referenced details in the files i found would actually confuse LLMs because they are contradicting each other in specific cases (depending what other libraries you use with the one that you generated rules for.
  • configurabe api rate limits? what is that about. so much confusion.
1 Like

Hey @T1000 thanks for the feedback.

All the points you said make sense, my bad, I’ve updated the Title to make it clear that it’s unofficial.

And other points also make sense.

Would using a better model generate better rules? Or do you think AI compiled rules are not very helpful?

hmm i would like framework/library relevant rules.

If the frameworks or libraries werent so broad. :slight_smile: not your fault of course, but like said they sometimes contradict

e.g. references testing details where the testing library would be one that actually makes tests differently than the ‘generic’ tests showcased in the main library.

Lets see how they fit for others. I use very specific rules for testing, development etc and they are a mix of libraries that are used there were appropriate.

For example in many cases the globs should be empty unless they really will never apply to any other files… e.g. i saw a case where only one file type was used but the library uses several of them.

the trick would be in knowing which globs and rules apply for which part.

note that some of the library/framework rules would be needed in ‘planning’ (feature analysis) and if the rules are wrong it will generate non compliant files.

Also from my experience too many rules expecially if some may be conflicting causes LLms to use wrong ones, hehe

im not completely rejecting the possibility to use standardized rules. thats actually badly needed :slight_smile:

1 Like

@T1000 this is awesome, appreciate you taking the time out to respond!

This project has a long way to go!

1 Like

In my opinion, .cursorrules didn’t help much—maybe only 20-25%. It was useful at the start of the conversation but later seemed to forget and completely ignore them. It’s not working like system rules, though it should. I’m not sure why.