You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 🔍 **Fuzzy Search**: Quickly find files across your project
26
26
- ✅ **File Selection**: Toggle files or entire directories (with child items) for inclusion or exclusion
27
27
- 📄 **Multiple Output Formats**: Generate Markdown, Plain Text, or XML output
@@ -59,7 +59,7 @@ cd codegrab
59
59
go build ./cmd/grab
60
60
```
61
61
62
-
Then move the binary to your `PATH`
62
+
Then move the binary to your `PATH`.
63
63
64
64
## 🚀 Quick Start
65
65
@@ -69,9 +69,9 @@ Then move the binary to your `PATH`
69
69
grab
70
70
```
71
71
72
-
2. Navigate with <kbd>h</kbd>/<kbd>j</kbd>/<kbd>k</kbd>/<kbd>l</kbd>
73
-
3. Select files using the <kbd>Space</kbd> or <kbd>Tab</kbd> key
74
-
4. Press <kbd>g</kbd> to generate output file or <kbd>y</kbd> to copy contents to clipboard
72
+
2. Navigate with arrow keys or <kbd>h</kbd>/<kbd>j</kbd>/<kbd>k</kbd>/<kbd>l</kbd>.
73
+
3. Select files using the <kbd>Space</kbd> or <kbd>Tab</kbd> key.
74
+
4. Press <kbd>g</kbd> to generate output file or <kbd>y</kbd> to copy contents to clipboard.
75
75
76
76
CodeGrab will generate `codegrab-output.md` in your current working directory (on macOS this file is automatically copied to your clipboard), which you can immediately send to an AI assistant for better context-aware coding assistance.
|`-t, --temp`| Use system temporary directory for output file. |
101
+
|`-g, --glob <pattern>`| Include/exclude files and directories using glob patterns. Can be used multiple times. Prefix with '!' to exclude (e.g., `--glob="*.{ts,tsx}" --glob="\!*.spec.ts"`). |
|`-S, --skip-redaction`| Skip automatic secret redaction via gitleaks (Default: false). WARNING: Disabling this may expose sensitive information! |
104
+
|`--deps`| Automatically include direct dependencies for selected files (Go, JS/TS). |
105
+
|`--max-depth <depth>`| Maximum depth for dependency resolution (`-1` for unlimited, default: `1`). Only effective with `--deps`. |
106
+
|`--max-file-size <size>`| Maximum file size to include (e.g., `"100kb"`, `"2MB"`). No limit by default. Files exceeding the specified size will be skipped. |
107
+
|`--theme <name>`| Set the UI theme. Available: catppuccin-latte, catppuccin-frappe, catppuccin-macchiato, catppuccin-mocha, dracula, nord. (default: `"catppuccin-mocha"`). |
107
108
108
109
### 📖 Examples
109
110
@@ -113,22 +114,22 @@ grab [options] [directory]
113
114
grab
114
115
```
115
116
116
-
2. Grab all files in current directory (non-interactive):
117
+
2. Grab all files in current directory (non-interactive), skipping files > 50kb:
117
118
118
119
```bash
119
-
grab -n
120
+
grab -n --max-file-size 50kb
120
121
```
121
122
122
-
3. Grab a specific directory interactively:
123
+
3. Grab a specific directory interactively including dependencies:
123
124
124
125
```bash
125
-
grab /path/to/project
126
+
grab --deps /path/to/project
126
127
```
127
128
128
129
4. Grab a specific directory non-interactively including all dependencies (unlimited depth):
CodeGrab can automatically include dependencies for selected files, making it easier to share complete code snippets with LLMs.
206
207
207
-
-**How it works**: When enabled, CodeGrab utilizes [tree-sitter](https://tree-sitter.github.io/tree-sitter/) to parse selected source files, identifying language-specific dependency declarations (like `import` or `require`). It then attempts to resolve these dependencies within your project and automatically includes the necessary files.
208
+
-**How it works**: When enabled, CodeGrab utilizes [tree-sitter](https://tree-sitter.github.io/tree-sitter/) to parse selected source files, identifying language-specific dependency declarations (like `import` or `require`). It then attempts to resolve these dependencies within your project and automatically includes the necessary files (respecting `.gitignore`, hidden, size, and glob filters).
208
209
-**Supported Languages**:
209
210
-**Go**: Resolves relative imports and project-local module imports (if `go.mod` is present).
210
211
-**JavaScript/TypeScript**: Resolves relative imports/requires for `.js`, `.jsx`, `.ts`, and `.tsx` files, including directory `index` files.
0 commit comments