Skip to content

[Feature Request] Non-interactive CLI commands so coding agents (Claude Code) can self-configure the status line #602

Description

@axisrow

Problem

ccstatusline is configured exclusively through the interactive TUI. That is great for humans, but it leaves one big workflow unserved:

  1. Coding agents cannot configure their own status line. The natural workflow — ask Claude Code to add, remove, or rearrange a widget — dead-ends, because the only configuration interface is an interactive React/Ink app that an agent cannot drive. Hand-writing ~/.config/ccstatusline/settings.json instead is risky: the schema is not documented as a stable contract, and there is no CLI validation before an agent saves a possibly-broken config.
  2. No scriptability. Dotfiles-style setup, scripted fleet installs, and config-as-code all currently require a human in the TUI.
  3. TUI startup cost. For a single tweak, launching the whole React/Ink app is heavy.

Proposal

Non-interactive CLI subcommands that operate on the same settings file the TUI uses:

ccstatusline get [--json]                     # print current (post-migration) config
ccstatusline widget add <line> <widget> [--index N] [--option value ...]
ccstatusline widget remove <line> <index-or-type>
ccstatusline widget move <line> <index> --to <index>
ccstatusline set <option-path> <value>        # global options: padding, separators, etc.
ccstatusline validate [--file <path>]         # exit code 0/1 + machine-readable report
ccstatusline install / uninstall              # existing TUI actions, exposed non-interactively

Design notes / constraints:

  • Reuse applyImport() and the v2.2.27 import/export logic where possible — validate + merge semantics largely already exist there.
  • Preserve the current guarantees: atomic saves, symlinked settings.json written through the resolved target, invalid configs never silently overwritten. A validate-before-write step fits this naturally.
  • get --json + validate + set/widget ... gives an agent a safe read-modify-write loop without ever opening the TUI.
  • Error output should be single-line and machine-parseable (ideally --json) so agents can self-correct without guessing.
  • The TUI stays the primary human interface; this is purely additive.

Related

Happy to follow up with a PR if the proposed shape sounds acceptable.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions