Skip to content

Anxiety471/bocchi-deck

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Bocchi Deck 🎸

A Pi TUI extension that adds a retro rock / band-room terminal UI to your coding session. Originally built as "Pi Control Deck", now rebranded with music-themed labels, multiple visual themes, and full Pi TUI API compliance.

Theme: retro-rock Pi TUI TypeScript


Features

Widgets (above editor)

Widget Default Description
Active Session visible Model, provider, thinking level, mode, turn count
Setlist visible Tool execution progress, idle/active state

Commands

Command Description
/bocchi Open command palette (SelectList overlay)
/bocchi-settings Toggle widgets, compact mode, render cards, aliases
/bocchi-theme Switch visual theme
/bocchi-status Show full status summary
/bocchi-clear Remove all widgets and status labels
/confirm Confirmation dialog overlay
/danger Risk-themed confirmation
/fetch BorderedLoader spinner demo

Legacy aliases

The following old commands are preserved and toggleable via Settings: /control, /deck, /deck-settings, /deck-theme, /deck-status, /clear-ui

Render cards

Custom tool rendering for LLM-dispatched tools:

  • bocchi_status β€” Status info cards (β„Ή βœ“ ⚠ βœ—)
  • bocchi_error β€” Error cards with suggestions (βœ— BAD TAKE)
  • bocchi_work β€” Working progress cards
  • bocchi_confirm β€” Confirmation required cards

Overlays

  • Command palette β€” Searchable SelectList with arrow keys and Esc
  • Settings β€” SettingsList with keyboard toggle/save/cancel
  • Theme selector β€” SelectList for visual theme switching
  • Confirmation β€” Yes/No overlay for risky operations
  • BorderedLoader β€” Spinner overlay with Esc-to-cancel

Themes

Switch anytime with /bocchi-theme β€” no restart needed.

🎸 retro-rock (default)

Music/band terminology with rounded box cards:

  • 🎸 ACTIVE SESSION β€” context widget
  • β–£ SETLIST β€” workflow widget
  • ⚑ RIFF EXECUTION β€” tool call cards
  • βœ“ CLEAN TAKE β€” result cards
  • βœ— BAD TAKE β€” error cards
  • βš™ AMP SETTINGS β€” settings overlay
  • β–Ά START TAKE? β€” confirmation dialog
  • Working indicator: β™ͺ β™© β™« ♬
  • Idle: backstage | Running: live

🎭 mono-stage

Monochromatic rounded borders with stage terminology.

πŸŒƒ tokyo-night

Original vibrant dark theme with simple borders.

βšͺ minimal

Bare-bones mode β€” no extra labels, subtle separators only.

Width safety

All themes respect the 80-column minimum. Every rendered line is passed through truncateToWidth(), wrapTextWithAnsi(), or visibleWidth().


Layout

Bocchi Deck uses a vertical Pi-native layout (no sidebar, no dashboard):

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  normal assistant/tool output stream β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  🎸 ACTIVE SESSION                   β”‚  ← widget (1 line compact)
β”‚  β–£ SETLIST                           β”‚  ← widget (1 line compact)
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  default Pi editor                   β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚ mode:normal  tools:idle  bocchi:on   β”‚  ← status labels
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

Installation

Quick install (copy to Pi extensions)

cp bocchi-deck.ts ~/.pi/agent/extensions/

Then in Pi, run /reload.

From source

git clone https://github.com/Anxiety471/bocchi-deck.git
cp bocchi-deck/index.ts ~/.pi/agent/extensions/bocchi-deck.ts
# or use with pi -e
pi -e ./bocchi-deck/index.ts

Architecture

File structure

bocchi-deck/
β”œβ”€β”€ index.ts          # Main extension (single self-contained file)
β”œβ”€β”€ README.md         # This file
└── .gitignore

Core components

  • Theme config (BocchiThemeConfig) β€” Label maps, border styles, and color keys for each of the 4 themes
  • ActiveContextWidget β€” Renders model/session info in 1 line (compact) or multi-line
  • WorkflowProgressWidget β€” Renders tool execution state in 1 line
  • showCommandPalette() β€” SelectList overlay factory
  • showSettingsOverlay() β€” SettingsList overlay factory
  • showConfirmationOverlay() β€” Confirm dialog overlay factory
  • drawCard() β€” Renders rounded or simple bordered cards with title/content
  • ContainerFromLines β€” Helper to render pre-computed lines as a TUI component

Strict Pi TUI compliance

  • βœ… render(width), invalidate(), handleInput(data) on every interactive component
  • βœ… truncateToWidth() / wrapTextWithAnsi() / visibleWidth() on every line
  • βœ… Theme from callbacks (theme.fg() / theme.bg()) β€” no imports, no hardcoded colors
  • βœ… invalidate() rebuilds themed content on theme change
  • βœ… Built-in SelectList, SettingsList, BorderedLoader from @earendil-works/pi-tui
  • βœ… Default editor preserved β€” no sidebar, no dashboard, no custom editor
  • βœ… Works at 80-column terminal width

State management

State is kept in-memory via a BocchiState object. The extension reacts to Pi lifecycle events:

  • session_start β€” Reinitialize state
  • model_select / thinking_level_select β€” Update context info
  • turn_start / turn_end β€” Track turns
  • tool_execution_start / tool_execution_end β€” Track tool progress
  • tool_call β€” Update mode label
  • before_agent_start / agent_end β€” Working state

Settings (via /bocchi-settings)

Setting Options Default
Compact mode on / off on
Active Context widget visible / hidden visible
Workflow Progress widget visible / hidden visible
Footer status labels visible / hidden visible
Working indicator visible / hidden visible
Render cards enabled / disabled enabled
Alias commands yes / no yes

Tool reference

bocchi_status

Display status cards with icons. Parameters:

  • title (string) β€” Status title
  • message (string) β€” Status message
  • status (optional: info | success | warning | error)

bocchi_error

Display error cards. Parameters:

  • errorType (string) β€” Error category
  • errorMessage (string) β€” Error description
  • suggestion (optional string) β€” Fix suggestion

bocchi_work

Display working progress. Parameters:

  • task (string) β€” Task description
  • progress (optional string) β€” Progress info

bocchi_confirm

Request user confirmation. Parameters:

  • title (string) β€” Dialog title
  • description (string) β€” What's at stake
  • confirmLabel / cancelLabel (optional strings)

Development

Prerequisites

  • Pi v0.75.3+
  • Node.js 22+

Testing

# Lint
npx biome check index.ts

# Type-check (requires Pi's dependencies)
cp index.ts ~/.pi/agent/extensions/bocchi-deck.ts
pi -e ~/.pi/agent/extensions/bocchi-deck.ts

Changelog

Version Notes
2.0 Rebranded from Pi Control Deck to Bocchi Deck. Added retro-rock, mono-stage themes. Rounded card rendering. Music-note working indicator.
1.0 Original Pi Control Deck with tokyo-night and pantheon themes.

License

MIT β€” feel free to fork, modify, and share.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages