Skip to content

Latest commit

 

History

71 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

tmux-opencode

A Tmux Plugin Manager (TPM) plugin that adds an OpenCode status bar to tmux. Displays model, git branch, context window usage, session cost, and active session name.

Fully standalone — no theme plugin dependency required. Ships with 15 built-in themes selected with a single option.

Requirements

  • OpenCode ≥ 1.18
  • tmux ≥ 3.0
  • bash ≥ 4.2
  • jq ≥ 1.6
  • Nerd Fonts (recommended for default icons; the neon-punk theme uses emoji and works without Nerd Fonts)

Install

Add to ~/.tmux.conf before the run line that loads TPM:

set -g @plugin 'LeGambiArt/tmux-opencode'

Press prefix + I inside a tmux session to install.

Manual uninstall

~/.tmux/plugins/tmux-opencode/opencode-statusline.tmux uninstall

Then remove or comment out the @plugin line and run tmux source-file ~/.tmux.conf.

Themes

Select a theme with one line:

set -g @opencode-tmux-theme "matrix"

Available themes:

Theme Look
default Plain tmux colours, blue bar, all text inherits terminal fg
classic Dark grey bg, white text, green→yellow→red gradient bar
forest Dark green bg, bright green text, session-aware
neon-punk Black bg, hot-pink text, emoji icons — no Nerd Font needed
darkblue Dark navy bg, neon-yellow text, diamond ◆◇ bar
cyberpunk Black bg, magenta+yellow+cyan neon — heavy-circle ▰▱ bar
retrowave Deep purple bg, pink text, cyan rectangular ▮▯ bar
steel Dark bg, steel-blue text, block bar
orange Grey bg, orange text, dot ●○ bar
minimal Dark bg, cyan text — no progress bar
redalert White bg, red text, heavy-circle ▰▱ bar
matrix True-black bg, bright-green text, heavy-circle ▰▱ bar
diamond Deep-purple bg, cyan text, diamond ◆◇ bar
purple Dark bg, light-purple text, rectangular ▮▯ bar
circle Deep ocean bg, per-plugin neon colours, dot ●○ bar, 💵 cost
dracula Dark bg, Dracula purple text, green branch, orange cost, ▮▯ bar, pill edges (Nerd Font)

See the examples gallery for screenshots of every theme.

Configuration

All options go in ~/.tmux.conf. Theme settings take effect on the next tmux source-file ~/.tmux.conf (or prefix + I reinstall).

Placement within status-right

By default the plugin appends to status-right — opencode lands at the rightmost position. Use @opencode-statusline-order "prepend" to move it to the leftmost position within the right bar instead:

set -g @opencode-statusline-order "prepend"   # opencode first, then other segments

Example — tmux-dracula with its time segment at the far-right edge:

# In ~/.tmux.conf, load dracula BEFORE opencode:
set -g @dracula-plugins "cpu-usage battery time"
run "~/.tmux/plugins/tmux-dracula/dracula.tmux"
# Now load opencode with prepend — it inserts before dracula's segments:
set -g @opencode-statusline-order "prepend"
run "~/.tmux/plugins/tmux-opencode/opencode-statusline.tmux"
# Result: [opencode][cpu-usage][battery][time]  ← time stays at far right

Load order matters. Plugins that rebuild status-right from scratch (tmux-dracula does this) will erase an earlier prepend. List tmux-opencode after such plugins in your ~/.tmux.conf so it sees the final status-right value before injecting.

Battery, cpu, date/time, and other append-only plugins cooperate automatically regardless of order — tmux-opencode never replaces status-right, only adds to it.

Override individual colours

User options (@opencode-statusline-*) always win over theme defaults:

# Global fg for all plugins
set -g @opencode-statusline-fg "colour82"

# Per-plugin fg (overrides global)
set -g @opencode-statusline-model-fg "colour200"
set -g @opencode-statusline-cost-fg  "colour220"

# Per-plugin bg
set -g @opencode-statusline-model-bg "colour235"

Available plugin names: model, branch, pct, cost, session, separator

Plugin list

# Choose what to display and in what order
set -g @opencode-statusline-plugins "session model branch progressbar percentage cost"
Name Shows Default
model Current AI model name
branch Git branch + dirty/staged marks
progressbar Context window fill bar
percentage Context window percentage
cost Cumulative session cost in USD
session OpenCode session title

branch is silently skipped outside git repositories. session is skipped until OpenCode generates a title.

Bar appearance

set -g @opencode-statusline-bar-filled-char  "▰"
set -g @opencode-statusline-bar-empty-char   "▱"
set -g @opencode-statusline-bar-filled-color "colour46"
set -g @opencode-statusline-bar-empty-color  "colour22"
set -g @opencode-statusline-bar-width        "12"

Each named theme sets its own bar characters and colours. To use the built-in green→yellow→red gradient, unset bar-filled-color:

set -gu @opencode-statusline-bar-filled-color

Icons

Default icons require a Nerd Font installed and configured in your terminal emulator. If a glyph renders as a box, use the emoji fallback shown below.

# Switch to emoji fallbacks (works without Nerd Fonts)
set -g @opencode-statusline-icon-model   "🔮"
set -g @opencode-statusline-icon-branch  "🌿"
set -g @opencode-statusline-icon-bar     "🧠"
set -g @opencode-statusline-icon-cost    "💰"
set -g @opencode-statusline-icon-session "💻"

# Hide an icon
set -g @opencode-statusline-icon-cost ""
Option Default glyph Codepoint Emoji fallback
@opencode-statusline-icon-model nf-md-crystal_ball U+F1102 🔮
@opencode-statusline-icon-branch nf-md-source_branch U+F062C 🌿
@opencode-statusline-icon-bar nf-fae-brain U+E28C 🧠
@opencode-statusline-icon-cost nf-md-coin U+F0DEA 💰 or 💵
@opencode-statusline-icon-session nf-md-monitor U+F0379 💻

Other options

set -g @opencode-statusline-refresh         "2"   # refresh every 2s (default: 5)
set -g @opencode-statusline-session-max-len "15"  # truncate session title at 15 chars
set -g @opencode-statusline-separator       "·"   # custom separator between segments

Colour reference

tmux accepts colours in three formats:

  • colourN — 256-colour palette 0–255 (most portable). 256 Colors Cheat Sheet
  • Namedblack, red, green, yellow, blue, magenta, cyan, white, default, and bright variants (brightred, etc.)
  • Hex #rrggbb — requires tmux ≥ 3.2

Examples

See the theme gallery for screenshots and one-line config for every theme.

Contributing / Extending

See docs/dev-guide.md for how to create new themes and plugins.

License

GPL-3.0-only

About

Tmux plugins for AI things

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages