Skip to content

v0.42.0: token-pilot install-statusline (one-command badge setup)#41

Merged
Shahinyanm merged 1 commit into
masterfrom
v0.42.0-install-statusline
Jun 5, 2026
Merged

v0.42.0: token-pilot install-statusline (one-command badge setup)#41
Shahinyanm merged 1 commit into
masterfrom
v0.42.0-install-statusline

Conversation

@Shahinyanm
Copy link
Copy Markdown
Member

After v0.41.1 removed the intrusive sessionTitle overwrite, the savings badge lives in the additive statusline — but wiring it meant hand-editing settings.json. User asked to auto-enable.

We can — but NOT by silently writing the config (that's the sessionTitle mistake again: clobbering a statusLine the user set for caveman/custom). So this is an explicit, non-destructive opt-in command.

token-pilot install-statusline:

state action
not-configured write chain cmd (merges, preserves other keys)
caveman-only / tp-only upgrade to chain (both badges)
chain no-op
custom (other) left untouched; prints how, or --force
bad JSON not modified

Version-agnostic command (globs newest plugin dir). doctor nudge now points at this instead of a JSON recipe.

Verified e2e: fresh write preserves keys; re-run no-ops; custom statusLine never clobbered. 1349/1349 tests.

After v0.41.1 removed the intrusive sessionTitle overwrite, the
cumulative-savings badge lives in the additive statusline (the
caveman-style channel that sits alongside the session name and
live-updates every render). But wiring it meant hand-editing
~/.claude/settings.json. The user asked: can't we auto-enable it?

We can — but NOT by silently writing the user's config (that's the
sessionTitle mistake again: clobbering a statusLine the user may have
set for caveman or a custom badge). So this is an explicit,
non-destructive opt-in command.

`token-pilot install-statusline` decides by current state
(reusing ecosystem-check's classifier):
  - not-configured        → write the chain command (merges into
                            existing settings, preserving every other key)
  - configured-caveman-only / tp-only → upgrade to the chain wrapper
                            so BOTH badges render side by side
  - configured-chain      → no-op
  - configured-other      → LEFT UNTOUCHED; prints how to switch, or
                            --force to replace a custom statusLine
  - unknown (bad JSON)    → not modified; prints manual guidance

The chain command is version-agnostic (globs the newest plugin dir),
so it survives plugin upgrades.

Wiring: src/cli/install-statusline.ts (decideStatuslineAction pure +
classifyStatuslineAt path-injectable, both fully tested) · index.js
case install-statusline · typo-guard. The `doctor` not-configured
nudge now points at this one command instead of a JSON recipe.

Verified e2e against the dist: fresh write preserves other settings
keys; re-run is a no-op; a custom statusLine is never clobbered.

Tests: 1349/1349 pass (+16).
Build: clean (25 agents under 0.42.0).
@Shahinyanm Shahinyanm merged commit aea1c2e into master Jun 5, 2026
@Shahinyanm Shahinyanm deleted the v0.42.0-install-statusline branch June 5, 2026 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant