@cam5/baby-bird 0.1.0 → 0.1.1

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
@@ -60,6 +60,7 @@ bb --json | jq machine-readable tour
60
60
  bb --dump-prompt print the prompt instead of calling the model
61
61
  bb --refresh regenerate even if a cached tour exists
62
62
  bb --preset claude-sonnet
63
+ bb --no-progress no live status block
63
64
  ```
64
65
 
65
66
  ### What does bare `bb` tour?
@@ -93,6 +94,8 @@ All keys, with defaults:
93
94
  "args": [], // extra argv appended to the preset's command
94
95
  "command": null, // a whole custom invocation; when set, "preset" is ignored
95
96
  "promptVia": null, // "stdin" (default) or "arg" (replace {prompt} in argv)
97
+ "kind": null, // "claude" (streams progress from the Claude Code CLI) or "plain"; default from the preset
98
+ "jsonSchema": false, // Claude kind: also pass --json-schema so the CLI validates the answer (see below)
96
99
  "timeoutMs": 180000,
97
100
  "maxPromptBytes": 200000, // larger diffs are truncated, biggest files first
98
101
  "env": {} // extra environment for the command
@@ -103,11 +106,21 @@ All keys, with defaults:
103
106
  "exclude": ["**/pnpm-lock.yaml", "**/package-lock.json", "**/yarn.lock", "**/Cargo.lock",
104
107
  "**/*.min.*", "**/dist/**", "**/*.snap", "**/*.map"]
105
108
  },
106
- "render": { "color": "auto", "pager": "auto", "maxExcerptLines": 60, "width": null },
109
+ "render": {
110
+ "color": "auto", "pager": "auto", "maxExcerptLines": 60, "width": null,
111
+ "highlight": "auto", // syntax colors in excerpts on 256-color terminals; "always" | "never"
112
+ "theme": "dark" // background tint palette for added/removed lines; "light" for light terminals
113
+ },
107
114
  "cache": { "enabled": true, "dir": null } // default $XDG_CACHE_HOME/baby-bird
108
115
  }
109
116
  ```
110
117
 
118
+ ### While it generates
119
+
120
+ On a terminal, `bb` shows a small live status block on stderr (stdout stays clean for piping): a spinner with the current stage and elapsed time, then, for Claude presets, a reasoning indicator, and finally each section title as the answer takes shape. If the CLI rejects an answer against the schema you see that too, and the section list starts over when the model resubmits. When the tour lands the block is replaced by one dim summary line (time, tokens, model). Turn it off with `--no-progress`; it is also off when stderr is not a TTY or `--debug` is on.
121
+
122
+ About that reasoning indicator: Claude Code's print mode (2.1.x) streams thinking *heartbeats* roughly every second but with empty text, both in the deltas and in the final message, so `bb` shows a pulse trail that grows with each heartbeat rather than the words. The rolling text window is implemented and takes over automatically whenever a runner does include reasoning text.
123
+
111
124
  ### LLM presets
112
125
 
113
126
  The model is just a command: the prompt goes in on stdin, the answer comes out on stdout. Built-in presets:
@@ -141,8 +154,16 @@ bb --preset local
141
154
  BB_LLM_COMMAND='llm -m gpt-4.1' bb
142
155
  ```
143
156
 
157
+ Presets have a `kind`. The built-in Claude presets are `"claude"`: `bb` appends `--output-format stream-json --verbose --include-partial-messages` so the status block can show reasoning heartbeats and section titles as they stream; the answer text is then extracted like any other (fences, prose, and the odd unescaped quote are tolerated, with one repair round-trip if needed). Everything else is `"plain"`: stdout is the answer. Set `"kind": "claude"` on your own preset when it wraps the Claude Code CLI, or `llm.kind` to override for a run.
158
+
159
+ `llm.jsonSchema: true` additionally passes `--json-schema` so the CLI validates the answer itself. It is off by default: on Claude Code 2.1.270 the model's first structured call is rejected about five times in six (it emits tool-call placeholders such as `$PARAMETER_NAME` as top-level keys), and although the CLI makes it retry, every rejection costs a full extra answer. Worth re-checking on newer versions.
160
+
144
161
  The effective command is part of the cache key, so switching presets regenerates the tour instead of reusing another model's.
145
162
 
163
+ ### Excerpt highlighting
164
+
165
+ On a 256-color terminal, excerpts get language-aware token colors (keywords, strings, comments) chosen by file extension, and added/removed lines are marked by a bold `+`/`-` sign plus a subtle green/red row tint underneath, so both signals read at once. The token palette never uses green or red. Turn it off with `--no-highlight` or `render.highlight: "never"`, and pick `--theme light` (or `render.theme`) on a light terminal background. Files with no known language keep the plain green/red rendering.
166
+
146
167
  ### Code host
147
168
 
148
169
  With `codehost.provider` set to `gh` (the default), `bb` uses the `gh` CLI to find the current branch's pull request. Its base branch decides what to compare against and its title and body are included in the prompt. Nothing else is read, and no tokens are handled by `bb`. If `gh` is missing or not logged in, the lookup is silently skipped. Set the provider to `none` to turn it off.