v0.42.0: token-pilot install-statusline (one-command badge setup)#41
Merged
Conversation
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).
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.
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:--forceVersion-agnostic command (globs newest plugin dir).
doctornudge 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.