flatbread-cli 0.1.0 → 0.3.0

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.
package/README.md CHANGED
@@ -10,8 +10,7 @@ npm install -g flatbread-cli # installs the `flatbread` command (Node 2
10
10
  npx -y flatbread-cli --help # or run it without installing
11
11
  ```
12
12
 
13
- **Not on npm until the owner runs the first `npm publish`** - until then, `npm pack` (below) and
14
- `npm install -g ./flatbread-cli-<version>.tgz`. **The npm package is `flatbread-cli`, not `flatbread`.** `flatbread` on npm is an unrelated
13
+ On npm since 2026-10-18 (0.1.0). **The npm package is `flatbread-cli`, not `flatbread`.** `flatbread` on npm is an unrelated
15
14
  project, so `npx flatbread` runs somebody else's code. The command it installs is `flatbread`.
16
15
 
17
16
  ## Commands
@@ -123,8 +122,12 @@ Visibility is `private` unless a human raises it - in the review UI, or from the
123
122
  panel on the site while signed in as the run's owner. There is no `--visibility` flag
124
123
  and no API field for it: `--no-review` is non-interactive and must never publish.
125
124
 
126
- `parse` writes `packages/cli/.tmp/last-parse.json`.
127
- `share` writes `packages/cli/.tmp/last-share.json` and refreshes `last-parse.json`.
125
+ `parse` writes nothing: it prints the run's summary and brief. `parse --save` writes the raw
126
+ (unredacted) trace to `packages/cli/.tmp/last-parse.json`, and `parse --out <file>` writes it there instead.
127
+ `share` writes `packages/cli/.tmp/last-share.json`. `--title <text>` sets the run's title (the review
128
+ page opens with it and can still change it; every secret in a typed title is redacted), and
129
+ `--commit [sha]` binds the run to a commit (bare = HEAD) and records whether the working tree was
130
+ clean against it.
128
131
  `view` reads the newest artifact (share draft preferred over raw parse), builds the
129
132
  deterministic Execution Brief with `buildExecutionBrief`, writes `last-brief.json` and
130
133
  `CAPSULE.md`, and prints `open http://127.0.0.1:3000/r/local`. It does **not**
@@ -136,9 +139,49 @@ capsule quotes trace text verbatim and inherits whatever the source still contai
136
139
  session's working directory is a git repository. Nothing else is read from git, the index is
137
140
  never written, and a log that names a different branch than the checkout gets no commit.
138
141
 
142
+ ### Auto-capture: `flatbread setup`
143
+
144
+ `flatbread setup` turns on capture for this machine. It installs the Claude Code hook (as `hook
145
+ install` does) with one difference - the SessionEnd handler also starts `flatbread capture` for the
146
+ session that just ended - and, inside a git repository, a chained `post-commit` that records each
147
+ commit against the newest session of that repository (if that session moved in the last two hours).
148
+
149
+ Every capture goes to `~/.flatbread/bucket` (`FLATBREAD_HOME/bucket`): one record per session, with
150
+ EVERY redaction match redacted, visibility `private`, never uploaded. A capture is not a share; to
151
+ publish one, run `share --file` on its session, which opens the review. `capture.log` in the bucket
152
+ has one line per capture, including the ones that skipped or were refused.
153
+
154
+ The post-commit hook never replaces yours: an existing `post-commit` is kept as
155
+ `post-commit.pre-flatbread`, runs first with git's arguments, and its exit status is the hook's.
156
+ It runs after the commit exists, so no SHA changes. When the repository sets `core.hooksPath`
157
+ (husky, lefthook) nothing is written and the line to add is printed. When `core.hooksPath` is
158
+ set machine-wide (system or global config), the hook goes in the repository's own hooks
159
+ directory and setup says it fires only if that machine-wide hook runs it.
160
+
161
+ Setup also registers the MCP server at Claude Code's user scope (`mcpServers.flatbread` in
162
+ `~/.claude.json`, or `$CLAUDE_CONFIG_DIR/.claude.json`), so every project has it and none asks you
163
+ to approve a `.mcp.json`. Only that one entry is touched: a file that is not JSON is refused, a
164
+ server named `flatbread` that runs something else is left alone, the file's BOM, line endings and
165
+ mode are kept, and the first write leaves `~/.claude.json.flatbread.bak`. Restart Claude Code (or
166
+ reload the VS Code window) afterwards. `--no-mcp` skips it.
167
+
168
+ `setup --dry-run` writes nothing. `setup --uninstall` removes the handlers, the MCP entry and the
169
+ hook, and puts a chained hook back byte for byte. `FLATBREAD_HOOK_DISABLED=1` stops every capture.
170
+
171
+ `flatbread search <words>` answers from this machine's shared runs, its captured runs, then the
172
+ site - the same text the MCP tool returns. Words are matched as typed, and by stem ("retry" finds
173
+ "retries" and "retrying"). `--local` leaves the site out; a site that did not answer is said, and
174
+ exits 1.
175
+
139
176
  `pull` and `mcp` only read. A token from `flatbread login` goes only to the site that issued it;
140
- a private run's share link (`?t=`) is sent as a header, never in a URL. Add the MCP server to
141
- Claude Code with `claude mcp add flatbread -- flatbread mcp`.
177
+ a private run's share link (`?t=`) is sent as a header, never in a URL. `pull <id>` reads a run
178
+ this machine shared or captured from disk, so it works offline; anything else comes from the site.
179
+ Without `setup`, add the MCP server by hand: `claude mcp add --scope user flatbread -- flatbread mcp`.
180
+
181
+ `share` writes the reviewed draft to `last-share.json`, which the next share replaces. The run is
182
+ not lost with it: every share is also kept under its own ID, which `search --local` lists and
183
+ `pull <id>` prints. The review page listens on 127.0.0.1, on 4321-4325, or a port the OS picks
184
+ when all five are busy.
142
185
 
143
186
  ### Building the package
144
187
 
@@ -0,0 +1,31 @@
1
+ # Third-party notices
2
+
3
+ ## deja-vu
4
+
5
+ `src/adapters/antigravity.ts` reads conversations the way deja-vu reads Windsurf trajectories
6
+ (`internal/sources/windsurf.go`), and `test/fixtures/antigravity/*.pb` are its fixtures
7
+ (`fixtures/registry/windsurf/cascade/`).
8
+
9
+ ```
10
+ MIT License
11
+
12
+ Copyright (c) 2026 Vladislav Shulcz
13
+
14
+ Permission is hereby granted, free of charge, to any person obtaining a copy
15
+ of this software and associated documentation files (the "Software"), to deal
16
+ in the Software without restriction, including without limitation the rights
17
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
18
+ copies of the Software, and to permit persons to whom the Software is
19
+ furnished to do so, subject to the following conditions:
20
+
21
+ The above copyright notice and this permission notice shall be included in all
22
+ copies or substantial portions of the Software.
23
+
24
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
25
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
26
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
27
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
28
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
29
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
30
+ SOFTWARE.
31
+ ```