Skip to content

Commit d0b824a

Browse files
author
nik
committed
Passthrough repomix options, fix provider issue
1 parent 0548479 commit d0b824a

File tree

6 files changed

+1474
-1167
lines changed

6 files changed

+1474
-1167
lines changed

README.md

Lines changed: 39 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -47,66 +47,61 @@ export ANTHROPIC_API_KEY='your-anthropic-api-key'
4747
The basic command structure is:
4848

4949
```bash
50-
rulefy <repo-url-or-path>
50+
rulefy <repo-path>
5151
```
5252

5353
Examples:
5454

5555
```bash
56-
# Using GitHub URL
57-
rulefy https://github.com/fastapi/fastapi
56+
# Inside a repository
57+
rulefy
5858

5959
# Using local repository path
60-
rulefy ./my-local-project
60+
rulefy ./my-local-project/subdir
6161

62-
# Rulefy with specific description as an option
63-
rulefy --description "guidelines for extending the component using the base interface"
62+
# Using GitHub URL
63+
rulefy --remote https://github.com/fastapi/fastapi
6464

65-
# Rulefy the current directory with a description
66-
cd some/package
65+
# Rulefy with specific description as an option
6766
rulefy --description "guidelines for extending the component using the base interface"
6867

69-
# Specify rule type
68+
# Specify Cursor AI rule type
7069
rulefy --rule-type "agent" --description "coding standards for React components"
7170
```
7271

7372
This will:
74-
1. Fetch the repository content using repomix
75-
2. Read the cursor rules guidelines
76-
3. Generate cursor rules using Claude Sonnet 3.5
77-
4. Save the output to a `<repo-name>.rules.mdc` file
78-
79-
80-
## Installing Rules in Cursor
81-
82-
After generating your rules file, you'll need to install it in Cursor:
83-
84-
1. Open Cursor editor
85-
2. Go to Settings > AI > Rules
86-
3. Click "Add Rules File" and select your generated `.rules.mdc` file
87-
4. Restart Cursor to apply the new rules
88-
89-
For more detailed instructions, see the [official Cursor documentation](https://docs.cursor.com/context/rules-for-ai).
73+
1. Fetch the repository content
74+
2. Based on the content, generate rules for Cursor AI
75+
3. Save the output to a `<repo-name>.rules.mdc` file
9076

9177
### Options
9278

9379
```
9480
Options:
95-
--provider <provider> LLM provider to use (default: "claude-sonnet-3.5-latest")
81+
--provider <provider> LLM model to use (default: "claude-sonnet-3.7-latest") (currently only claude models are supported)
9682
-o, --output <file> Output file name (defaults to <repo-name>.rules.mdc)
9783
--guidelines <file> Path to cursor rules guidelines file (default: "./cursorrules-guidelines.md")
98-
--include <patterns> Include patterns for files (glob pattern, e.g., "**/*.py")
9984
--description <text> Description of what should be rulefied
10085
--rule-type <type> Type of rule to generate (auto, manual, agent, always)
10186
-h, --help display help for command
10287
```
10388

104-
## How It Works
89+
`rulefy` supports [all options supported by `repomix`](https://github.com/yamadashy/repomix/tree/main?tab=readme-ov-file#-usage). For example, select specific files:
10590

106-
1. **Repository Conversion**: Uses repomix to convert GitHub repositories into a textual representation
107-
2. **Guidelines Integration**: Reads cursor rules guidelines from the specified file
108-
3. **LLM Generation**: Passes the repository content and guidelines to LLM with progressive summarization
109-
4. **Output**: Saves the generated cursor rules to a markdown file
91+
```bash
92+
rulefy --include "src/**/*.ts" --compress
93+
```
94+
95+
## Installing Rules in Cursor
96+
97+
After generating your rules file, you'll need to install it in Cursor:
98+
99+
1. Open Cursor editor
100+
2. Go to Settings > AI > Rules
101+
3. Click "Add Rules File" and select your generated `<filename>.rules.mdc` file
102+
4. Restart Cursor to apply the new rules
103+
104+
For more detailed instructions, see the [official Cursor documentation](https://docs.cursor.com/context/rules-for-ai).
110105

111106
## Example Output
112107

@@ -128,6 +123,18 @@ This project is a TypeScript application that...
128123
...
129124
```
130125

126+
## Best Practices
127+
128+
### Minimize context length, cost and rate limits
129+
130+
If you encounter rate limits or ihigh costs, try to minimize the context length using the following ways:
131+
132+
- Use `rulefy --compress` to compress the context length
133+
- Use `rulefy --include` to include only the files you need with globs
134+
- Use `rulefy --exclude` to exclude the files you don't need with globs
135+
- Specify the size of the chunks via `CHUNK_SIZE=1024` environment variable.
136+
137+
131138
## Contributing
132139

133140
Contributions are welcome! Please feel free to submit a Pull Request.

0 commit comments

Comments
 (0)