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
docs: add --cat flag documentation to CLI reference
Documents the new --cat flag that emits full file content at SHA instead of diff.
Includes option table entry, progressive disclosure ladder placement, usage examples,
and detailed behavior description for text/JSON modes and --out behavior.
Copy file name to clipboardExpand all lines: docs/CLI.md
+16-7Lines changed: 16 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -39,6 +39,7 @@ cex [REPO] [OPTIONS]
39
39
|`--diff`| — | Include full diff; implies `--max-lines 500` unless set |
40
40
|`--no-diff`| — | Explicitly suppress the diff (wins over `--diff`) |
41
41
|`--file PATH`| — | On `--show`/`--compare`/`--pr`/`--range`: restrict diff to this file (implies `--diff`). On `--export`: filter commit list to commits that touched PATH (rename-aware). Repeatable. |
42
+
|`--cat`| — | Emit the **full file content** at SHA instead of a diff. Requires `--show` and `--file`. Repeatable `--file` supported. |
42
43
43
44
### Size caps
44
45
@@ -83,11 +84,14 @@ Headless commands climb from cheapest → fullest. Agents should start at the to
83
84
| 1 |`--summary`| Metadata + diff stat line (≤ 20 lines) |
84
85
| 2 |*(default)*| Metadata + file list (no diff body) |
85
86
| 3 |`--file PATH`| Diff restricted to one file |
87
+
| 3b |`--file PATH --cat`| Full file content at that commit (no diff) |
86
88
| 4 |`--diff`| Full diff, capped at 500 lines (truncation marker emitted) |
87
89
| 5 |`--diff --max-lines 0`| Uncapped full diff |
88
90
89
91
Priority when multiple flags are passed: `--summary` > `--no-diff` > `--diff` > `--file`.
90
92
93
+
`--cat` is orthogonal to the diff ladder — it bypasses the diff entirely and returns the raw file bytes at the given SHA. Only valid with `--show`.
94
+
91
95
---
92
96
93
97
## Modes
@@ -158,16 +162,20 @@ File-history mode (`--file PATH`) emits a flat one-line-per-commit listing of ev
158
162
### 4. Single commit (`--show SHA`)
159
163
160
164
```bash
161
-
cex owner/repo --show abc1234 # file list only (no diff)
162
-
cex owner/repo --show abc1234 --summary # metadata + stat line only
163
-
cex owner/repo --show abc1234 --diff # full diff (capped at 500 lines)
164
-
cex owner/repo --show abc1234 --file src/app.py # diff for that file only
`--cat` fetches the blob on demand from the partial clone (same lazy-fetch mechanism as `--diff`). In text mode with a single `--file`, raw content is emitted directly; with multiple `--file` flags each block is prefixed with `=== path ===`. In JSON mode the response has `"kind": "file_content"` with a `"files"` array of `{"path", "content"}` objects. With `--out`, each file is written as `<short-sha>_<basename>` and the path is printed.
0 commit comments