CLI tool to fetch and save Trae rules from traerules.io
npm install trae-rule-cliA command-line tool to download and install Trae Rules directly to your local Trae IDE.
There are two ways to use this tool:
Run directly without installing using npx:
``bash`
npx trae-rule rules add
`bash`
npm install -g trae-rule-cli
Then run with:
`bash`
trae-rule rules add
`bashUsing npx (without installation)
npx trae-rule rules add
$3
`bash
Using npx with a slug
npx trae-rule rules add tailwind-css-best-practicesUsing npx with a URL
npx trae-rule rules add https://traerules.io/rules/tailwind-css-best-practicesOr if installed globally
trae-rule rules add tailwind-css-best-practices
`How It Works
This CLI tool:
1. Fetches the rule directly from
traerules.io/[slug]/api
2. If a URL is provided, extracts the slug from it
3. Saves the rule to .trae/rules/Visit traerules.io to browse all available rules.
- Fetches trae rules directly from the specific API endpoint
- Supports both direct slugs and full URLs
- Saves rules in the proper Markdown format
- Creates the necessary directory structure if it doesn't exist
- Validates the existence of rules before attempting to save
Feel free to submit a Pull Request!
MIT
This project was inspired by cursor-directory-cli created by Eric Zakariasson.