Skip to content

kinncj/statusline

kinncj statusline

CI License: GPL v3 Made with Bash PRs Welcome Contributor Covenant

A portable, two-line statusline for AI CLIs. Shows model, context usage with tokens remaining, API-estimated costs, and Claude.ai rate-limit quotas with reset times.

Live statusline screenshot showing dir, branch, thinking effort, context %, model, API-est costs, burn rate, and Claude.ai 5h/7d quotas

Plain-text version of the same output (handy for copy/paste, terminal previews):

dir: statusline | branch: main | think:medium
context: 20% (205K/1.0M, 794K left) | πŸ€– Opus 4.7 | πŸ’° API-est: $14.13 session / $0.00 today / $25.52 block (2h 34m left) | πŸ”₯ $15.96/hr | 5h quota: 25% | 7d quota: 14%

Install

Quick β€” curl | bash

curl -fsSL https://raw.githubusercontent.com/kinncj/statusline/main/bootstrap.sh | bash

The bootstrap clones the repo into ~/.local/share/kinncj-statusline and runs the installer for every supported CLI it finds on $PATH. To pass flags through to the installer:

curl -fsSL https://raw.githubusercontent.com/kinncj/statusline/main/bootstrap.sh | bash -s -- --dry-run
curl -fsSL https://raw.githubusercontent.com/kinncj/statusline/main/bootstrap.sh | bash -s -- --target claude-code
curl -fsSL https://raw.githubusercontent.com/kinncj/statusline/main/bootstrap.sh | bash -s -- --uninstall

Override defaults via env: STATUSLINE_REPO=owner/fork STATUSLINE_REF=v1.2.3 STATUSLINE_DIR=~/elsewhere curl … | bash.

Manual β€” clone + run

git clone https://github.com/kinncj/statusline ~/Development/kinncj/statusline
cd ~/Development/kinncj/statusline
./install.sh                     # auto-detect all supported CLIs on $PATH
./install.sh --target opencode   # one specific tool, repeatable
./install.sh --dry-run           # preview without changing anything
./install.sh --uninstall         # remove statusline wiring
./install.sh --no-animation      # skip the animated intro (also: NO_COLOR=1, TUI_NO_ANIM=1)
./install.sh --quiet             # suppress the logo entirely

The installer renders a boxed, animated TUI by default. Animations auto-disable when stdout isn't a TTY (CI, pipes), and color follows NO_COLOR.

Supported targets

Tool Statusline AGENTS.md Config path
Claude Code βœ“ βœ“ ~/.claude/settings.json
GitHub Copilot CLI βœ“ βœ“ ~/.copilot/config.json (requires experimental: true, which the installer sets)
OpenCode βœ— upstream βœ“ ~/.config/opencode/opencode.json β€” feature not yet shipped by opencode; tracked at anomalyco/opencode#8619. Installer writes the proposed schema speculatively so a future ship auto-activates; today, opencode's built-in footer is what renders.
Pi (pi.dev) βœ“ βœ“ ~/.pi/agent/extensions/kinncj-statusline/ (native Pi extension; auto-discovered, no settings to edit)
Hermes (nousresearch) β€” βœ“ + skill ~/.hermes/ (full TUI, no script hook)
  • Pi is wired via a native extension (extensions/pi/statusline.mjs) that Pi auto-discovers from ~/.pi/agent/extensions/. The extension bridges Pi's session context (ctx.cwd, ctx.model, ctx.getContextUsage()) into the same statusline.sh we use everywhere else and renders the output as a widget below the editor. Pi's own native footer stays as-is, so you get both lines.
  • Hermes ships a fixed built-in TUI with skin-level theming only and no extension point. We install AGENTS.md + the statusline-edit skill so the repo's instructions travel with you.

OpenCode has no statusline hook in 1.14.48 β€” verified against the binary's full plugin event list (chat.*, tool.execute.*, permission.ask, etc., all behavioral, none render). The feature is tracked upstream at anomalyco/opencode#8619 β€” still open. The installer prints a clear "pending upstream" warning, drops our statusline.sh into the config dir, and writes both proposed key shapes (statusline.command and experimental.statusline.command) into opencode.json so whichever the upstream merge picks will auto-activate without a re-install. Until then, opencode's built-in footer is what you see and our script sits idle. Building a plugin against today's API doesn't help β€” the only display surface is chat.message, which costs context tokens (the exact problem #8619 was filed to fix).

What's in line 2

The full set of segments, in order; what actually renders depends on what the host pipes in (missing fields just silently drop):

  • context: N% of the context window, with (used/total, remaining) in human units. On Copilot CLI's auto-routed free models the primary fields go null β€” the statusline falls back to current_context_used_percentage / displayed_context_limit so the block keeps rendering.
  • Cost cluster (Claude path, via ccusage):
    • πŸ€– model name
    • πŸ’° API-est: session / today / billing-block costs β€” API list-price estimates, not what Claude.ai Pro/Max subscribers actually pay
    • πŸ”₯ $X/hr burn rate
  • Cost cluster (Copilot path, native fields): πŸ’° N.N reqs Β· +A/-R Β· api N.Ns from cost.total_premium_requests (fractional units, not an integer count), total_lines_added/removed, and total_api_duration_ms. Activates only when ccusage didn't (Claude payloads never trigger it).
  • 5h quota / 7d quota percentage and reset countdown (Claude.ai subscriber data only β€” Copilot's "Remaining reqs." native footer isn't exposed to the statusLine hook).
  • session: Nm wall time. Copilot supplies authoritative cost.total_duration_ms; Claude falls back to transcript_path mtime.

The host-specific field map and the exact fallback chain live in AGENTS.md.

Dependencies

  • bash, jq, awk, sed, date, stat, git
  • npx (for ccusage β€” optional; the cost block is skipped if unavailable)

Hacking on it

Read AGENTS.md β€” it has the conventions, the bash gotchas, the host JSON schemas, and the test recipe. Mock fixtures live in tests/.

If you're an AI agent working in this repo (Claude Code, OpenCode, etc.), AGENTS.md is loaded automatically. The .claude/ and .opencode/ directories also contain in-repo agent definitions for testing and safe-edit workflows.

Tests

tests/run.sh                  # full bats suite (install bats first)
tests/run.sh claude-code      # filter by name

See AGENTS.md for the full recipe (mock fixtures, ccusage stub, etc.).

Project docs

  • Changelog β€” release notes per version.
  • Contributing β€” how to send a patch and the bar it has to clear.
  • Code of Conduct β€” Contributor Covenant 2.1.
  • Security β€” how to report a vulnerability (don't open a public issue).
  • Authors β€” maintainer + contributor credits.

License

Copyright Β© 2026 Kinn Coelho Juliao <kinncj@protonmail.com>

Released under the GNU General Public License v3.0 or later (SPDX-License-Identifier: GPL-3.0-or-later). You may use, modify, and redistribute this code β€” provided any derivative works stay under a GPL-compatible license. The full license text lives in LICENSE; each source file carries an SPDX header for unambiguous attribution.

About

A portable, two-line statusline for AI CLIs. Shows model, context usage with tokens remaining, API-estimated costs, and Claude.ai rate-limit quotas with reset times.

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors