Skip to content

[FEATURE]: Custom statusLine via shell command (like Claude Code) #37464

Open

Description

@phalla-doll

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)

Relationship to existing issues

References

Activity

  1. hawkxdev commented on Sep 10, 2026

    @hawkxdev

    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 sends remaining_fraction as 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.

  2. Codestz commented on Sep 25, 2026

    @Codestz

    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.

  3. silva96 commented on Oct 7, 2026

    @silva96

    I created this plugin for opencode v2: https://www.npmjs.com/package/opencode-footer

    demo.video.mp4
  4. opencodejr commented on Oct 28, 2026

    @opencodejr

    Thanks for re-filing this with the full proposal, @phalla-doll!

    To sum up the request: a statusLine setting 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:

    If you'd rather not wait, the current TUI plugin API already lets a plugin add content to the footer through the prompt.footer.status slot, and PR #52764 uses that same slot.

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

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions