Skip to content

Feature: Custom statusLine via shell script (like Claude Code) #30295

Closed

Description

@lightdissiple

Description

Claude Code supports a customizable statusLine that pipes session state as JSON to a shell script after each assistant message. The script's stdout becomes the status bar. OpenCode currently renders the status bar in SolidJS with no user-facing customization.

Proposal

Add a statusLine config option to opencode.json (or tui.json) that accepts a shell command. After each assistant message, OpenCode pipes session state as JSON to stdin. Whatever the script prints to stdout replaces or extends the current status bar.

Example config

{
  "statusLine": {
    "type": "command",
    "command": "~/.config/opencode/statusline.sh"
  }
}

Example JSON payload (piped to stdin)

{
  "model": { "display_name": "Claude Sonnet 4.5" },
  "session": { "id": "...", "cost_usd": 1.58 },
  "context_window": { "used_percentage": 10, "context_window_size": 200000 },
  "tokens": { "input": 50000, "output": 47100 },
  "workspace": { "current_dir": "/path/to/project", "branch": "feature/auth" }
}

Example output

feature/auth │ ██████░░░░ 10% │ $1.58

Why

  • Users want to display git branch, token usage, cost, and custom indicators
  • A shell script is the simplest possible extension point — no plugin SDK needed
  • Claude Code already has this working; the JSON schema could be similar
  • This would be a high-impact, low-complexity feature

Alternatives considered

  • TUI plugin with SolidJS slots: too complex for most users
  • Config-only approach: not flexible enough for git branch, colors, etc.

References

Activity

  1. github-actions commented on Jun 1, 2026

    @github-actions
    Contributor

    This issue doesn't fully meet our contributing guidelines.

    What needs to be fixed:

    • Feature requests must include the verification checkbox (confirming the feature hasn't been suggested before)
    • The title should start with [FEATURE]: (currently starts with Feature:)

    Please edit this issue to address the above within 2 hours, or it will be automatically closed.


    This issue might be a duplicate of existing issues. Please check:

    If you believe this was flagged incorrectly, please let a maintainer know.

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

Metadata

Metadata

Assignees

Labels

needs:complianceThis means the issue will auto-close after 2 hours.

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions