feat: user settings at ~/.baton/settings.json - #3
Merged
Conversation
- src/cli/bin.ts: unified command entry — baton (TUI, default) / baton repl / baton sessions / baton help - package.json: bin field so bun link exposes a global baton command (runs TS source directly, no build step) - AGENTS.md: document local install via bun install && bun link, and why bun build --compile is avoided (opentui native FFI + Claude SDK dynamic loading) Verified: bun link → baton help / sessions / TUI render smoke in pty all pass; bun run check green (41 tests).
Rework the TUI per user feedback (opening screen was a confusing empty rail + modal with no obvious input): now baton opens straight into a chat, cursor in the composer, type and go — same feel as claude/codex CLI. - open baton → session auto-created, input focused immediately - '@codex …' / '@claude …' message prefix switches the target agent; both agents share one timeline (colored speaker labels) - switching agents auto-injects the other agent's latest turn summaries (buildCatchUpContext) so the newcomer needs no manual context handoff - @bs_xxx cross-session mentions still work; Esc interrupts a running turn - reduce: MessageState now records provider for speaker labeling - approval modal fixed (explicit flexDirection/height so options render) Verified: bun run check green (45 tests incl. 4 new catch-up tests); pty smoke shows chat layout with focused composer. Note: branch based on feat/cli-bin; PR shows its commit until #1 merges.
- src/config/settings.ts: load/merge/validate with precedence env > settings.json > defaults; auto-creates the file with defaults on first run; corrupt or invalid values fall back instead of crashing the entry point - settings: defaultAgent, claudeExecutable (persistent alternative to BATON_CLAUDE_BIN), codexCommand, mentionBudgetChars - wired into TUI, REPL and bin help; mention/catch-up budgets now configurable - docs: design.md data layout renamed config.json → settings.json Verified: bun run check green (51 tests, 6 new settings tests).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
settings.json > defaults; auto-creates the file with defaults on first run;
corrupt or invalid values fall back instead of crashing the entry point
BATON_CLAUDE_BIN), codexCommand, mentionBudgetChars
Verified: bun run check green (51 tests, 6 new settings tests).