Skip to content

Commit 46f742d

Browse files
committed
Update README.md
1 parent cbc3a03 commit 46f742d

File tree

1 file changed

+82
-82
lines changed

1 file changed

+82
-82
lines changed

README.md

+82-82
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,88 @@ const content = await aiDigest.generateDigest({
6060
});
6161
```
6262

63+
## Options
64+
65+
### CLI Options
66+
67+
- `-i, --input <directory>`: Specify input directory (default: current directory)
68+
- `-o, --output <file>`: Specify output file (default: codebase.md)
69+
- `--no-default-ignores`: Disable default ignore patterns
70+
- `--whitespace-removal`: Enable whitespace removal
71+
- `--show-output-files`: Display a list of files included in the output
72+
- `--ignore-file <file>`: Specify a custom ignore file (default: .aidigestignore)
73+
- `--help`: Show help
74+
75+
## Examples
76+
77+
### CLI Examples
78+
79+
1. Basic usage:
80+
81+
```bash
82+
npx ai-digest
83+
```
84+
85+
2. Specify input and output:
86+
87+
```bash
88+
npx ai-digest -i /path/to/your/project -o project_summary.md
89+
```
90+
91+
3. Enable whitespace removal:
92+
93+
```bash
94+
npx ai-digest --whitespace-removal
95+
```
96+
97+
4. Show list of included files:
98+
99+
```bash
100+
npx ai-digest --show-output-files
101+
```
102+
103+
5. Combine multiple options:
104+
105+
```bash
106+
npx ai-digest -i /path/to/your/project -o project_summary.md --whitespace-removal --show-output-files
107+
```
108+
109+
## Custom Ignore Patterns
110+
111+
ai-digest supports custom ignore patterns using a `.aidigestignore` file in the root directory of your project. This file works similarly to `.gitignore`, allowing you to specify files and directories that should be excluded from the aggregation.
112+
113+
Use the `--show-output-files` flag to see which files are being included, making it easier to identify candidates for exclusion.
114+
115+
## Whitespace Removal
116+
117+
When using the `--whitespace-removal` flag, ai-digest removes excess whitespace from files to reduce the token count when used with AI models. This feature is disabled for whitespace-dependent languages like Python and YAML.
118+
119+
## Binary and SVG File Handling
120+
121+
Binary files and SVGs are included in the output with a note about their file type. This allows AI models to be aware of these files without including their full content.
122+
123+
## Local Development
124+
125+
Run `npm run start` to run the CLI tool on the local project. (Very meta!)
126+
127+
Run `npm test` to run the tests.
128+
129+
To pass flags to the CLI, use the `--` flag, like this: `npm run start -- --whitespace-removal`.
130+
131+
## Deploy New Version
132+
133+
```
134+
npm publish
135+
```
136+
137+
## Contributing
138+
139+
Contributions are welcome! Please feel free to submit a Pull Request.
140+
141+
## License
142+
143+
This project is licensed under the MIT License.
144+
63145
## API Reference
64146

65147
### Main Functions
@@ -175,85 +257,3 @@ await aiDigest.writeDigestToFile(
175257
true
176258
);
177259
```
178-
179-
## Options
180-
181-
### CLI Options
182-
183-
- `-i, --input <directory>`: Specify input directory (default: current directory)
184-
- `-o, --output <file>`: Specify output file (default: codebase.md)
185-
- `--no-default-ignores`: Disable default ignore patterns
186-
- `--whitespace-removal`: Enable whitespace removal
187-
- `--show-output-files`: Display a list of files included in the output
188-
- `--ignore-file <file>`: Specify a custom ignore file (default: .aidigestignore)
189-
- `--help`: Show help
190-
191-
## Examples
192-
193-
### CLI Examples
194-
195-
1. Basic usage:
196-
197-
```bash
198-
npx ai-digest
199-
```
200-
201-
2. Specify input and output:
202-
203-
```bash
204-
npx ai-digest -i /path/to/your/project -o project_summary.md
205-
```
206-
207-
3. Enable whitespace removal:
208-
209-
```bash
210-
npx ai-digest --whitespace-removal
211-
```
212-
213-
4. Show list of included files:
214-
215-
```bash
216-
npx ai-digest --show-output-files
217-
```
218-
219-
5. Combine multiple options:
220-
221-
```bash
222-
npx ai-digest -i /path/to/your/project -o project_summary.md --whitespace-removal --show-output-files
223-
```
224-
225-
## Custom Ignore Patterns
226-
227-
ai-digest supports custom ignore patterns using a `.aidigestignore` file in the root directory of your project. This file works similarly to `.gitignore`, allowing you to specify files and directories that should be excluded from the aggregation.
228-
229-
Use the `--show-output-files` flag to see which files are being included, making it easier to identify candidates for exclusion.
230-
231-
## Whitespace Removal
232-
233-
When using the `--whitespace-removal` flag, ai-digest removes excess whitespace from files to reduce the token count when used with AI models. This feature is disabled for whitespace-dependent languages like Python and YAML.
234-
235-
## Binary and SVG File Handling
236-
237-
Binary files and SVGs are included in the output with a note about their file type. This allows AI models to be aware of these files without including their full content.
238-
239-
## Local Development
240-
241-
Run `npm run start` to run the CLI tool on the local project. (Very meta!)
242-
243-
Run `npm test` to run the tests.
244-
245-
To pass flags to the CLI, use the `--` flag, like this: `npm run start -- --whitespace-removal`.
246-
247-
## Deploy New Version
248-
249-
```
250-
npm publish
251-
```
252-
253-
## Contributing
254-
255-
Contributions are welcome! Please feel free to submit a Pull Request.
256-
257-
## License
258-
259-
This project is licensed under the MIT License.

0 commit comments

Comments
 (0)