feat: interactive installer with profile and theme selection#24
Open
xinnaider wants to merge 3 commits into
Open
feat: interactive installer with profile and theme selection#24xinnaider wants to merge 3 commits into
xinnaider wants to merge 3 commits into
Conversation
added 3 commits
June 29, 2026 12:32
Abstract date/stat over GNU vs BSD by probing behavior once (epoch_from_iso, file_mtime), so macOS works without coreutils. Pin LC_ALL=C so comma-decimal locales (e.g. pt_BR) render identically to the C-locale CI. install.sh accepts BSD date/stat; the npm CLI accepts darwin as a supported platform. Closes inbrace-tech#2
…atch) Rework install.sh from a print-only dependency checker into an installer that copies tokenline.sh into the chosen Claude profile(s) and patches each settings.json with the npm CLI's safety contract: backup, merge-only statusLine, idempotent, and never clobbering invalid JSON. - Discovers ~/.claude, ~/.claude-*, and ./.claude. Arrow-key multi-select menu (up/down move, space toggle, digits 1-9 quick-toggle, Enter confirm, q/Esc cancel), with a typed-number fallback for TERM=dumb. Also --dir for a specific directory, --yes for non-interactive ~/.claude. - Adds --dry-run, --print, --force; minimal stepped UI with a TTY-only braille spinner; piped/non-interactive runs stay plain and default to ~/.claude. - Pure bash + ANSI (no stty), so the menu behaves the same on macOS bash 3.2 and Linux. Checks the PATH bash (not the interpreter) for the 4+ requirement, locale-independently via BASH_VERSINFO.
tokenline.sh gains --theme <name> (or TOKENLINE_THEME): full (default, the original three-line render), minimal (model · ctx% · cache), compact (one dense line with tokens + saving%), economics (model/ctx/cache + per-turn breakdown), and limits (model/ctx/cache + 5h/7d bars). Unknown names fall back to full so a typo never blanks the statusline; full emits no flag, keeping the command byte-identical to before. install.sh asks for a theme before the profile: a single-select arrow menu whose preview renders each theme in full, with the live statusline's colors and layout, so you see exactly what gets installed. The chosen --theme is baked into the statusLine command; --theme <name> skips the prompt.
Contributor
Author
|
Suggested labels (can't self-apply from a fork): |
Collaborator
|
@xinnaider Thanks for the contribution! This PR was based on the previous PR branch, which was squash merged into main, so GitHub is showing the previous changes again. Could you please rebase this branch on the latest main and push the update to your fork? After that, the PR diff should only show the changes from this branch. Thanks! |
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.
What
Reworks
install.shfrom a print-only dependency checker into an interactiveinstaller, and adds selectable themes to the statusline.
Installer
install.shnow copiestokenline.shinto the Claude profile(s) you choose andpatches each
settings.jsonwith the same safety contract as the npm CLI:backup, merge-only
statusLine, idempotent, and never clobbering invalid JSON.~/.claude, any~/.claude-*, and./.claude. An arrow-keymulti-select menu (↑/↓ move, space toggle, digits 1-9 quick-toggle, Enter
confirm, q/Esc cancel) installs into one or several profiles at once; a typed
fallback covers
TERM=dumb.--theme,--dir,--yes,--dry-run,--print,--force.stay plain and default to
~/.claude.stty), so it behaves the same on stock macOS bash 3.2and Linux. The 4+ check probes the PATH
bash(what runs the statusline), notthe interpreter, locale-independently via
BASH_VERSINFO.Themes
tokenline.shgains--theme <name>(orTOKENLINE_THEME):fullminimalcompacteconomicslimitsfullemits no flag, keeping the command byte-identical to before. An unknownname falls back to
full, so a typo never blanks the statusline. The installerasks for a theme before the profile, previewing each one in full with the live
statusline's colors and layout.
Testing
-s bashclean oninstall.shandtokenline.sh(verified underboth
CandC.UTF-8).pnpm lint,pnpm typecheck,pnpm buildpass.keys + backup, conflict refusal without
--force, replace with--force,invalid-JSON refusal, and
--dry-runno-op — all verified.single-select, and the full theme→profile flow writing the right
--theme.