codigest 0.7.0__tar.gz → 0.9.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {codigest-0.7.0 → codigest-0.9.0}/CITATION.cff +2 -2
- {codigest-0.7.0 → codigest-0.9.0}/PKG-INFO +182 -123
- codigest-0.9.0/README.ko.md +417 -0
- {codigest-0.7.0 → codigest-0.9.0}/README.md +181 -122
- codigest-0.9.0/docs/demo/demo.gif +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/pyproject.toml +1 -1
- {codigest-0.7.0 → codigest-0.9.0}/server.json +2 -2
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/cap.py +2 -2
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/clean.py +3 -3
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/diff.py +14 -29
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/digest.py +9 -24
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/init.py +9 -28
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/mark.py +2 -2
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/mcp.py +20 -3
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/pack.py +48 -46
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/scan.py +21 -58
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/semdiff.py +14 -30
- codigest-0.9.0/src/codigest/commands/status.py +57 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/term.py +11 -8
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/commands/tree.py +3 -3
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/cache.py +4 -1
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/common.py +5 -1
- codigest-0.9.0/src/codigest/core/output.py +76 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/prompts.py +29 -75
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/redact.py +49 -7
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/resolver.py +37 -4
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/semdiff.py +2 -8
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/tags.py +3 -2
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/main.py +19 -16
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/options.py +6 -0
- codigest-0.9.0/tests/test_output.py +23 -0
- {codigest-0.7.0 → codigest-0.9.0}/tests/test_pack.py +55 -1
- codigest-0.9.0/tests/test_secrets.py +72 -0
- {codigest-0.7.0 → codigest-0.9.0}/tests/test_termstore.py +18 -0
- {codigest-0.7.0 → codigest-0.9.0}/uv.lock +1 -1
- codigest-0.7.0/README.ko.md +0 -357
- codigest-0.7.0/docs/demo/demo.gif +0 -0
- codigest-0.7.0/src/codigest/commands/status.py +0 -149
- codigest-0.7.0/src/codigest/core/output.py +0 -50
- {codigest-0.7.0 → codigest-0.9.0}/.gitattributes +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/.github/workflows/publish.yml +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/.github/workflows/tests.yml +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/.gitignore +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/.python-version +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/LICENSE +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/docs/demo/make_gif.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/docs/dogfood.md +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/__init__.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/__main__.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/config.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/git_ops.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/processor.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/runner.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/scanner.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/shadow.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/shellhist.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/structure.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/termstore.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/core/tokenizer.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/shell/hook.ps1 +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/src/codigest/shell/hook.sh +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/tests/test_shadow.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/tests/test_structure.py +0 -0
- {codigest-0.7.0 → codigest-0.9.0}/tests/test_term_install.py +0 -0
|
@@ -14,8 +14,8 @@ authors:
|
|
|
14
14
|
repository-code: "https://github.com/NaNIsaac/codigest"
|
|
15
15
|
url: "https://pypi.org/project/codigest/"
|
|
16
16
|
license: MIT
|
|
17
|
-
version: 0.
|
|
18
|
-
date-released: "2026-10-
|
|
17
|
+
version: 0.9.0
|
|
18
|
+
date-released: "2026-10-18"
|
|
19
19
|
keywords:
|
|
20
20
|
- LLM
|
|
21
21
|
- developer tools
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: codigest
|
|
3
|
-
Version: 0.
|
|
3
|
+
Version: 0.9.0
|
|
4
4
|
Summary: Human-Centered Codebase Context Manager for LLMs
|
|
5
5
|
Project-URL: Homepage, https://github.com/NaNIsaac/codigest
|
|
6
6
|
Project-URL: Repository, https://github.com/NaNIsaac/codigest
|
|
@@ -30,34 +30,47 @@ Description-Content-Type: text/markdown
|
|
|
30
30
|
|
|
31
31
|
<!-- mcp-name: io.github.NaNIsaac/codigest -->
|
|
32
32
|
|
|
33
|
-
**
|
|
33
|
+
**Share the code context you choose with an AI: your project, a few files, what changed, or the command that failed.**
|
|
34
34
|
|
|
35
35
|
[한국어](README.ko.md)
|
|
36
36
|
|
|
37
|
+
Codigest is a command-line tool for the moment you ask ChatGPT, Claude or a coding agent about
|
|
38
|
+
your code. It turns the part of your project you pick into one block of text you can paste into
|
|
39
|
+
any chat.
|
|
40
|
+
|
|
41
|
+
A model only knows what you show it. Copying files by hand is slow, it is easy to miss the one
|
|
42
|
+
file that matters, and it is just as easy to paste far more than the question needs. Codigest
|
|
43
|
+
lets you decide what to share and then collects it for you: the whole project, a file and the
|
|
44
|
+
files it imports, what changed since a point you marked, or a failing test with the code it points
|
|
45
|
+
at.
|
|
46
|
+
|
|
47
|
+
## What it does
|
|
48
|
+
|
|
49
|
+
- **Bundles code you pick.** The whole project, chosen files and folders, or the local files they
|
|
50
|
+
import (Python, JS/TS), as one block with the file tree.
|
|
51
|
+
- **Shows what changed.** Text or function-level diffs since a baseline you set, without touching
|
|
52
|
+
your Git history.
|
|
53
|
+
- **Brings in terminal output.** It records commands you run and can hand over a failing one
|
|
54
|
+
together with the files its error points at.
|
|
55
|
+
- **Says what it included.** Every bundle reports its size, and `pack` gives the reason for each
|
|
56
|
+
file and names the ones it left out.
|
|
57
|
+
- **Keeps secrets out.** `.env` files and keys are never included, and tokens in code or output
|
|
58
|
+
are masked.
|
|
59
|
+
- **Works with agents.** Claude Code, Cursor and other MCP clients can request the same output.
|
|
60
|
+
|
|
61
|
+
Codigest does not call any AI model; it only prepares what you send to one. Everything runs on
|
|
62
|
+
your machine, and your source files and Git history are only read.
|
|
63
|
+
|
|
37
64
|
<p align="center">
|
|
38
65
|
<img src="docs/demo/demo.gif" alt="cdg cap runs a failing pytest, then cdg pack bundles the failure, the test file it names and the changed file" width="760">
|
|
66
|
+
<br>
|
|
67
|
+
<sub>One of the workflows below: a test fails, and one command collects what the model needs.</sub>
|
|
39
68
|
</p>
|
|
40
69
|
|
|
41
|
-
## The idea
|
|
42
|
-
|
|
43
|
-
A test fails and you ask an LLM for help. You copy the error, then the test, then the file you
|
|
44
|
-
changed, and the model still asks for one more file.
|
|
45
|
-
|
|
46
|
-
Codigest does the copying. You need two commands:
|
|
47
|
-
|
|
48
|
-
```text
|
|
49
|
-
cdg cap -- pytest runs your command and remembers its output
|
|
50
|
-
cdg pack finds the files that output mentions, adds what you changed,
|
|
51
|
-
and copies all of it to your clipboard
|
|
52
|
-
```
|
|
53
|
-
|
|
54
|
-
Then you paste. That is the whole tool for most days; everything below either sets it up,
|
|
55
|
-
explains it, or is optional.
|
|
56
|
-
|
|
57
70
|
## Install
|
|
58
71
|
|
|
59
|
-
|
|
60
|
-
|
|
72
|
+
Install it with [uv](https://docs.astral.sh/uv/), which also fetches the Python version Codigest
|
|
73
|
+
needs (3.15) and keeps it apart from your projects:
|
|
61
74
|
|
|
62
75
|
```bash
|
|
63
76
|
winget install --id astral-sh.uv # Windows (skip if you have uv)
|
|
@@ -67,21 +80,91 @@ uv tool install codigest
|
|
|
67
80
|
uv tool update-shell # then restart your terminal
|
|
68
81
|
```
|
|
69
82
|
|
|
70
|
-
The command is `codigest`, or `cdg` for short.
|
|
83
|
+
The command is `codigest`, or `cdg` for short. No setup is needed in your projects.
|
|
71
84
|
If the install fails with a syntax error on `lazy import`, run `uv self update` and try again.
|
|
72
85
|
|
|
73
|
-
|
|
86
|
+
Every command below copies its result to the clipboard. Add `-s` to also print it (for pipes and
|
|
87
|
+
redirects), `-o FILE` to also write it to a file, `--no-copy` to leave the clipboard alone, and
|
|
88
|
+
`-m "..."` to put your question or instruction in it.
|
|
74
89
|
|
|
75
|
-
|
|
90
|
+
## 1. Share your project with an AI chat
|
|
76
91
|
|
|
77
|
-
|
|
78
|
-
it would without `cdg cap`; Codigest just keeps a copy.
|
|
92
|
+
Run `scan` in your project and paste:
|
|
79
93
|
|
|
80
94
|
```bash
|
|
81
|
-
cdg
|
|
95
|
+
cdg scan
|
|
96
|
+
```
|
|
97
|
+
|
|
98
|
+
```console
|
|
99
|
+
$ cdg scan
|
|
100
|
+
Copied snapshot to clipboard
|
|
101
|
+
Snapshot 3 files, ~121 tokens
|
|
82
102
|
```
|
|
83
103
|
|
|
84
|
-
|
|
104
|
+
The clipboard now holds the file tree and every file, honoring `.gitignore`:
|
|
105
|
+
|
|
106
|
+
```xml
|
|
107
|
+
<project_snapshot project="project">
|
|
108
|
+
<project_structure>
|
|
109
|
+
├── .gitignore
|
|
110
|
+
├── prices.py
|
|
111
|
+
└── test_prices.py
|
|
112
|
+
</project_structure>
|
|
113
|
+
<source_code>
|
|
114
|
+
<file path=".gitignore">
|
|
115
|
+
.venv/
|
|
116
|
+
__pycache__/
|
|
117
|
+
.pytest_cache/
|
|
118
|
+
</file>
|
|
119
|
+
|
|
120
|
+
<file path="prices.py">
|
|
121
|
+
def apply_discount(price, percent):
|
|
122
|
+
return price * (1 - percent)
|
|
123
|
+
</file>
|
|
124
|
+
|
|
125
|
+
<file path="test_prices.py">
|
|
126
|
+
from prices import apply_discount
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
def test_ten_percent():
|
|
130
|
+
assert apply_discount(200, 10) == 180
|
|
131
|
+
</file>
|
|
132
|
+
</source_code>
|
|
133
|
+
</project_snapshot>
|
|
134
|
+
```
|
|
135
|
+
|
|
136
|
+
Large projects ask before copying (above 30k tokens or 100 files). For those, share less, as in
|
|
137
|
+
the next section.
|
|
138
|
+
|
|
139
|
+
## 2. Share only part of it, or what changed
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
cdg scan src/app.py -r # one file and the local files it imports, recursively
|
|
143
|
+
cdg scan src/billing/ # one folder
|
|
144
|
+
cdg digest # Python signatures and docstrings only, much smaller
|
|
145
|
+
cdg tree # just the file tree
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
To share what changed while you work, set a baseline first:
|
|
149
|
+
|
|
150
|
+
```bash
|
|
151
|
+
cdg mark # e.g. before a refactor
|
|
152
|
+
# ... work ...
|
|
153
|
+
cdg diff # text diff since the mark
|
|
154
|
+
cdg semdiff # Python: which functions and classes changed
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
A baseline is a private copy kept in `.codigest/`; your Git history is not touched.
|
|
158
|
+
|
|
159
|
+
## 3. Hand over a failing command
|
|
160
|
+
|
|
161
|
+
Run the command through `cdg cap`. The output looks exactly as it would without it; Codigest
|
|
162
|
+
keeps a copy. Then ask for a pack:
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
cdg cap -- pytest -q # or npm test, cargo test, go test ./..., make
|
|
166
|
+
cdg pack
|
|
167
|
+
```
|
|
85
168
|
|
|
86
169
|
```console
|
|
87
170
|
$ cdg pack
|
|
@@ -90,21 +173,15 @@ Packed ~370 / 30,000 tokens
|
|
|
90
173
|
changes uncommitted changes (git)
|
|
91
174
|
+ test_prices.py line 5 in failing output
|
|
92
175
|
+ prices.py changed
|
|
93
|
-
|
|
176
|
+
Copied pack to clipboard
|
|
94
177
|
```
|
|
95
178
|
|
|
96
179
|
Read it as: the failing command, your uncommitted Git changes, `test_prices.py` because the error
|
|
97
180
|
points at its line 5, and `prices.py` because you edited it.
|
|
98
181
|
|
|
99
|
-
**3. Paste into the chat** and say what you want. You can also put the request in the pack:
|
|
100
|
-
`cdg pack -m "fix the discount calculation"`.
|
|
101
|
-
|
|
102
182
|
<details>
|
|
103
183
|
<summary>What exactly was copied</summary>
|
|
104
184
|
|
|
105
|
-
One XML block: the command with its output, the diff, and each file with line numbers and the
|
|
106
|
-
reason it was included. This is the pack above, unedited apart from the working directory:
|
|
107
|
-
|
|
108
185
|
```xml
|
|
109
186
|
<context_pack project="project">
|
|
110
187
|
<terminal_history>
|
|
@@ -155,87 +232,48 @@ what it is not seeing.
|
|
|
155
232
|
|
|
156
233
|
</details>
|
|
157
234
|
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
Once the basic loop works, each of these removes one manual step.
|
|
235
|
+
### How `pack` decides
|
|
161
236
|
|
|
162
|
-
|
|
237
|
+
Plain `cdg pack` fills its token budget (default 30,000) in this order:
|
|
163
238
|
|
|
164
|
-
|
|
165
|
-
cdg term install # cdg term uninstall to undo
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
**Stop pasting.** Connect your coding agent over MCP and it fetches the pack itself:
|
|
169
|
-
|
|
170
|
-
```bash
|
|
171
|
-
claude mcp add --scope user codigest -- cdg mcp # Claude Code
|
|
172
|
-
```
|
|
173
|
-
|
|
174
|
-
Other clients (Cursor, VS Code, Claude Desktop): add a stdio server with command `cdg` and args
|
|
175
|
-
`["mcp"]`. Details for both are in the [reference](#automatic-capture).
|
|
176
|
-
|
|
177
|
-
## How `pack` decides
|
|
178
|
-
|
|
179
|
-
When a file you expected is missing, or one you didn't expect is there, this is the order `pack`
|
|
180
|
-
fills its token budget (default 30,000):
|
|
181
|
-
|
|
182
|
-
1. Files you name: `cdg pack src/prices.py`.
|
|
183
|
-
2. Files named in the output of the last failed command run in this project in the past hour:
|
|
239
|
+
1. Files named in the output of the last failed command run in this project in the past hour:
|
|
184
240
|
`File "x.py", line 7` (Python), `x.py:7` (pytest, ruff, gcc, rustc, eslint), `x.ts(7,3)` (tsc).
|
|
185
241
|
Once the same command passes again, that failure is no longer used. A file that is only named
|
|
186
242
|
in the output, not changed by you, comes as an excerpt: ten lines around each place the output
|
|
187
243
|
points at, marked with a `lines="40-60"` attribute. Short files come whole.
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
4.
|
|
191
|
-
|
|
192
|
-
JS/TS (`./x`, `./x.js` for `x.ts`, `./dir` for `dir/index.ts`).
|
|
244
|
+
2. Files you changed: uncommitted and untracked files in Git, or changes since `cdg mark`.
|
|
245
|
+
3. Tests that import those files (`test_*.py`, `*_test.py`, `*.test.ts`, `*.spec.js`, ...).
|
|
246
|
+
4. Project files they import: Python imports, and relative imports in JS/TS (`./x`, `./x.js` for
|
|
247
|
+
`x.ts`, `./dir` for `dir/index.ts`).
|
|
193
248
|
|
|
194
|
-
|
|
195
|
-
are. Tokens are estimated at four characters each, so the budget is approximate.
|
|
249
|
+
When you name files, you get only those files. `--with` adds automatic sources back:
|
|
196
250
|
|
|
197
251
|
```bash
|
|
198
|
-
cdg pack
|
|
199
|
-
cdg pack
|
|
252
|
+
cdg pack src/prices.py # just this file
|
|
253
|
+
cdg pack src/prices.py --with tests # this file and its tests
|
|
254
|
+
cdg pack --with changes # only your changes, no failure
|
|
255
|
+
cdg pack --with failure,changes,tests,imports # the same as plain `cdg pack`
|
|
200
256
|
```
|
|
201
257
|
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
`pack` covers the failing-test case. These cover the rest, grouped by what you want to do.
|
|
205
|
-
|
|
206
|
-
### Recall an earlier command
|
|
258
|
+
The failed command and the diff are always included when their source is on. Tokens are estimated
|
|
259
|
+
at four characters each, so the budget is approximate.
|
|
207
260
|
|
|
208
|
-
|
|
261
|
+
### Making it smoother
|
|
209
262
|
|
|
210
|
-
|
|
211
|
-
cdg term
|
|
212
|
-
|
|
213
|
-
cdg term -f # last failed one
|
|
214
|
-
cdg term --here -n 3 # last 3 run in this project
|
|
215
|
-
```
|
|
263
|
+
`cdg term install` hooks your shell so every command is captured without typing `cdg cap`
|
|
264
|
+
(`cdg term uninstall` removes it). `cdg term` shows what was captured; see
|
|
265
|
+
[Terminal capture](#terminal-capture).
|
|
216
266
|
|
|
217
|
-
|
|
267
|
+
## 4. Let an agent fetch it
|
|
218
268
|
|
|
219
|
-
|
|
269
|
+
Connect your coding agent over MCP and it requests context itself instead of asking you to paste:
|
|
220
270
|
|
|
221
271
|
```bash
|
|
222
|
-
cdg
|
|
223
|
-
# ... work ...
|
|
224
|
-
cdg diff # text diff since the mark
|
|
225
|
-
cdg semdiff # Python only: which functions and classes changed
|
|
272
|
+
claude mcp add --scope user codigest -- cdg mcp # Claude Code
|
|
226
273
|
```
|
|
227
274
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
### Give the whole project, or its shape
|
|
232
|
-
|
|
233
|
-
```bash
|
|
234
|
-
cdg scan # every file, as one block (asks first above 30k tokens)
|
|
235
|
-
cdg scan src/app.py -r # one file plus the local files it imports
|
|
236
|
-
cdg digest # Python signatures and docstrings only, much smaller
|
|
237
|
-
cdg tree # just the file tree
|
|
238
|
-
```
|
|
275
|
+
Other clients (Cursor, VS Code, Claude Desktop): add a stdio server with command `cdg` and args
|
|
276
|
+
`["mcp"]`. The tools are listed under [MCP tools](#mcp-tools).
|
|
239
277
|
|
|
240
278
|
## Reference
|
|
241
279
|
|
|
@@ -244,32 +282,35 @@ cdg tree # just the file tree
|
|
|
244
282
|
- [MCP tools](#mcp-tools)
|
|
245
283
|
- [Configuration](#configuration)
|
|
246
284
|
- [Privacy and safety](#privacy-and-safety)
|
|
285
|
+
- [Upgrading from 0.8](#upgrading-from-08)
|
|
247
286
|
- [How it works](#how-it-works)
|
|
248
287
|
- [Development](#development)
|
|
249
288
|
|
|
250
289
|
### All commands
|
|
251
290
|
|
|
252
|
-
|
|
253
|
-
instead, `--no-copy` skips the clipboard, and `-m` / `--message` adds an instruction.
|
|
291
|
+
`cdg --help` lists them in the same groups.
|
|
254
292
|
|
|
255
293
|
| Command | What it gives you | Writes to your project |
|
|
256
294
|
| --- | --- | --- |
|
|
257
|
-
| `
|
|
295
|
+
| `scan` | The whole project, or chosen paths, as one block | nothing |
|
|
296
|
+
| `digest` | Signatures and docstrings, no bodies (Python) | nothing |
|
|
297
|
+
| `tree` | Project tree | nothing |
|
|
298
|
+
| `mark` | Sets the baseline | `.codigest/` |
|
|
299
|
+
| `diff` | Text diff since the baseline | nothing |
|
|
300
|
+
| `semdiff` | Function and class level changes since the baseline (Python) | nothing |
|
|
258
301
|
| `cap` | Runs a command and keeps its output | nothing |
|
|
259
302
|
| `term` | Recent captured commands with output | nothing |
|
|
260
|
-
| `
|
|
261
|
-
| `diff` | Text diff since the baseline | `.codigest/changes.diff` |
|
|
262
|
-
| `semdiff` | Function and class level changes since the baseline (Python) | `.codigest/semdiff.txt` |
|
|
263
|
-
| `scan` | The whole project, or chosen paths, as one block | `.codigest/snapshot.txt` |
|
|
264
|
-
| `digest` | Signatures and docstrings, no bodies (Python) | `.codigest/digest.txt` |
|
|
265
|
-
| `tree` | Project tree | nothing |
|
|
266
|
-
| `status` | Baseline age, pending changes, generated files | nothing |
|
|
267
|
-
| `init` | Config file and baseline; only needed to change [file filters](#configuration) | `.codigest/`, `.gitignore` |
|
|
268
|
-
| `clean` | Deletes `.codigest/` (asks first, `-y` to skip) | removes `.codigest/` |
|
|
303
|
+
| `pack` | Last failure, the files it names, your changes | nothing |
|
|
269
304
|
| `mcp` | MCP server for agents | nothing |
|
|
305
|
+
| `status` | What `pack` would use here: last failure, changes, baseline | nothing |
|
|
306
|
+
| `init` | `.codigest/config.toml` for [file filters](#configuration) | `.codigest/`, `.gitignore` |
|
|
307
|
+
| `clean` | Deletes `.codigest/` (asks first, `-y` to skip) | removes `.codigest/` |
|
|
270
308
|
|
|
271
|
-
|
|
272
|
-
the
|
|
309
|
+
Shared options: `-s` / `--stdout` also prints the result (status messages go to stderr),
|
|
310
|
+
`--no-copy` skips the clipboard, `-o FILE` also writes it to a file, `-m` / `--message` adds an
|
|
311
|
+
instruction.
|
|
312
|
+
`scan -l` adds line numbers, `scan -a` ignores the config filters, `scan -y` skips the
|
|
313
|
+
confirmation (CI). `-r` / `--resolve` on `scan`, `diff`, `semdiff` and `digest` also pulls in
|
|
273
314
|
local files imported by the targets. `cdg <command> --help` lists everything.
|
|
274
315
|
|
|
275
316
|
### Terminal capture
|
|
@@ -280,6 +321,10 @@ your machine, so `cap` and `term` work in any directory.
|
|
|
280
321
|
|
|
281
322
|
```bash
|
|
282
323
|
cdg cap "npm run build | tail -20" # quote pipelines
|
|
324
|
+
cdg term # last command and its output
|
|
325
|
+
cdg term -n 3 # last 3
|
|
326
|
+
cdg term -f # last failed one
|
|
327
|
+
cdg term --here -n 3 # last 3 run in this project
|
|
283
328
|
cdg term -i 2 # only the command from 2 runs ago
|
|
284
329
|
cdg term path # where captures are stored (override with CODIGEST_HOME)
|
|
285
330
|
cdg term clear # delete all captures
|
|
@@ -314,7 +359,7 @@ Limitations:
|
|
|
314
359
|
|
|
315
360
|
| Tool | Returns |
|
|
316
361
|
| --- | --- |
|
|
317
|
-
| `pack` | Last failure, the files it names, changes and their imports, cut to a budget (`targets`, `budget`, `message`) |
|
|
362
|
+
| `pack` | Last failure, the files it names, changes and their imports, cut to a budget (`targets`, `with`, `budget`, `message`) |
|
|
318
363
|
| `terminal_history` | Recent commands with output and exit code (`count`, `failed`, `here`: only this project, default on) |
|
|
319
364
|
| `scan` | Project snapshot (`targets`, `resolve`, `message`) |
|
|
320
365
|
| `diff` / `semdiff` | Text / structural changes since the baseline |
|
|
@@ -347,26 +392,40 @@ skipped.
|
|
|
347
392
|
|
|
348
393
|
### Privacy and safety
|
|
349
394
|
|
|
350
|
-
- **
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
- **
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
395
|
+
- **Credential files.** `.env*` (except `.env.example` and similar templates), `*.pem`, `*.key`,
|
|
396
|
+
`*.p12`, `*.pfx`, keystores, `.netrc`, `.pgpass` and SSH private keys are never included by any
|
|
397
|
+
command. `scan` says which it withheld, `pack` lists them as omitted, and their hunks in a diff
|
|
398
|
+
are replaced with a notice.
|
|
399
|
+
- **Tokens in code and diffs.** Private keys, JWTs, vendor tokens (OpenAI, GitHub, AWS, Google,
|
|
400
|
+
Slack, GitLab, npm) and passwords in URLs are masked in everything Codigest outputs. Ordinary
|
|
401
|
+
code such as `token = get_token()` is left alone.
|
|
402
|
+
- **Secrets in captures.** On top of that, terminal output is checked for `password=...` style
|
|
403
|
+
values and `Authorization` headers before it is written to disk, and the output of credential
|
|
404
|
+
commands (`env`, `printenv`, `gh auth token`, `aws configure`, ...) is never stored.
|
|
405
|
+
- These rules catch common formats, not every possible secret.
|
|
406
|
+
- **Your project.** No command changes your source files. Only `mark` and `init` create
|
|
407
|
+
`.codigest/`, which `init` adds to `.gitignore`.
|
|
359
408
|
- **Where captures live.** `cdg term path` shows the file. On macOS and Linux it is readable only
|
|
360
409
|
by you. `cdg term clear` deletes it.
|
|
361
410
|
- **Nothing leaves your machine.** Codigest makes no network requests. Context goes where you
|
|
362
411
|
paste it, or to the MCP client you connected.
|
|
363
412
|
|
|
413
|
+
### Upgrading from 0.8
|
|
414
|
+
|
|
415
|
+
- `scan`, `diff`, `semdiff` and `digest` no longer save into `.codigest/*.txt`; use `-o FILE`.
|
|
416
|
+
`diff --no-save` and the like are gone.
|
|
417
|
+
- `cdg init` no longer sets a baseline; run `cdg mark`.
|
|
418
|
+
- `cdg pack FILES` packs only those files; add `--with failure,changes,tests,imports` for the
|
|
419
|
+
previous behavior.
|
|
420
|
+
- Outputs no longer start with built-in instructions to the model ("You are an expert..."). Put
|
|
421
|
+
your own with `-m`, or a template in `.codigest/prompts.toml`.
|
|
422
|
+
|
|
364
423
|
### How it works
|
|
365
424
|
|
|
366
425
|
- **Baseline.** A Git repository at `.codigest/anchor/.shadow_git`, separate from your project's
|
|
367
|
-
repository. The directory is not named `.git` so editors don't mistake it for yours. `mark`
|
|
368
|
-
|
|
369
|
-
|
|
426
|
+
repository. The directory is not named `.git` so editors don't mistake it for yours. `mark`
|
|
427
|
+
commits the current state to it; `diff`, `semdiff`, `status` and `pack` compare the working tree
|
|
428
|
+
against it.
|
|
370
429
|
- **Captures.** One newline-delimited JSON file holds the last 200 commands; each output is capped
|
|
371
430
|
at 64 KB, keeping the head and tail.
|
|
372
431
|
- **Output.** File contents are XML-escaped inside `<file>` blocks, written flush-left so no stray
|