Repository navigation
Description
Feature hasn't been suggested before.
- I have verified this feature I'm about to request hasn't been suggested before.
A prior request (#30295) was auto-closed by the compliance bot for a missing
[FEATURE]:title prefix — not on merits. This is a properly-formatted re-filing
of the shell-command approach, and is distinct from the plugin-hook approach in #18969.
Describe the enhancement
Claude Code supports a statusLine config that pipes session state as JSON to a
user-provided shell command after each assistant message; the command's stdout is
rendered as the status bar. OpenCode's TUI currently renders a fixed footer
(model + context) with no user-facing extension point for custom content.
Add a statusLine option that accepts a shell command. OpenCode pipes a JSON
session-state payload to stdin; the command's stdout replaces or extends the footer.
Proposed config
{
"statusLine": {
"type": "command",
"command": "~/.config/opencode/statusline.sh",
"refreshSeconds": 60
}
}command— shell command/script path invoked to render the statusline.refreshSeconds— idle re-invoke cadence (in addition to per-message). Default ~60.
JSON payload piped to stdin
{
"model": { "id": "zai-latest/glm-5.2", "display_name": "GLM 5.2" },
"session": { "id": "...", "cost_usd": 1.58 },
"context": { "used_percentage": 10, "window_size": 1000000 },
"tokens": { "input": 50000, "output": 47100 },
"workspace": { "current_dir": "/path", "branch": "feature/auth" }
}Concrete use case: third-party provider quota
Custom providers (e.g. Z.AI GLM coding plan) expose a usage/quota API that users
want to monitor live. Desired footer output:
feature/auth │ GLM 5.2 │ 5h: ███░░░░░ 34% (reset at 18:40) │ $1.58
This needs a shell command (not just static config) because it must poll the
provider's quota endpoint and render a progress bar + reset timestamp.
Why a shell command (not only a plugin)
- Zero plugin SDK / TypeScript knowledge — a 10-line bash script suffices.
- Matches Claude Code's familiar, battle-tested model.
- Complements [FEATURE]: add tui.footer.items plugin hook for persistent status display #18969's
tui.footer.itemsplugin hook (plugin route); this covers
the config-only route.
Relationship to existing issues
- [FEATURE]: add tui.footer.items plugin hook for persistent status display #18969 —
tui.footer.itemsplugin hook (complementary, plugin route) - [FEATURE]: Show the Opencode go plan usage stats in cli itself #27698 / [FEATURE]: Check OpenCode Go quota directly in the UI #25030 / [FEATURE]: Add Go plan usage/balance API endpoint (rolling/weekly/monthly windows) #16017 — opencode's own Go-plan usage (not arbitrary providers)
- Feature: Custom statusLine via shell script (like Claude Code) #30295 — prior auto-closed filing on format grounds
References
- Claude Code statusLine docs: https://code.claude.com/docs/en/statusline
Activity
hawkxdev commentedon Sep 10, 2026
Been running the same statusline script in Claude Code and Antigravity's CLI for a while (agy has its own statusLine block with a refreshInterval option). If this lands, OpenCode would be the third tool running it, so I care more about the stdin payload than about config key names.
One thing I learned maintaining that port: the two implementations drifted on small details. Claude Code sends
used_percentage, agy sendsremaining_fractionas a 0-1 float. Reset time is an absolute epoch in one and seconds-from-now in the other. Quota block names differ too. None of it is hard to fix, but my script is now full of per-tool jq shims, and that kind of cruft is exactly what stops people from porting a script over.So if there's any room for it, staying close to the Claude Code payload shape would help. Or publish a schema for whatever shape you pick, so the rest of us can code against something stable. Either would let one script serve all three tools.
Smaller thing: agy also passes
agent_state(working/idle) and an artifact count in its payload. Nice to have if this ever grows.Codestz commentedon Sep 25, 2026
For anyone who wants this today: opencode-cockpit's Status bay (https://github.com/Codestz/opencode-cockpit) does it as a plugin on OpenCode 1 and 2. It has command segments (any shell command, with its own refresh interval), next to built-in ones (context bar, tokens, cost, git, todos), and it can sit at the bottom or in the sidebar. It'd still be better built in; this can serve as a reference for the config shape.
silva96 commentedon Oct 7, 2026
I created this plugin for opencode v2: https://www.npmjs.com/package/opencode-footer
demo.video.mp4
opencodejr commentedon Oct 28, 2026
Thanks for re-filing this with the full proposal, @phalla-doll!
To sum up the request: a
statusLinesetting that runs a shell command, passes it the session state as JSON on stdin, and shows its output in the TUI footer. It would re-run after each message and on an idle interval, so things like provider quota bars can be shown without writing a plugin.The maintainers will consider it. Related issues and PRs:
statuslineTUI config option (command plus interval). It pipes session JSON to the command and shows the first line of its output in the prompt footer.If you'd rather not wait, the current TUI plugin API already lets a plugin add content to the footer through the
prompt.footer.statusslot, and PR #52764 uses that same slot.