Skip to content

gausszhou/bubblecode

Repository files navigation

bubblecode

A terminal user interface for interacting with AI agents via the ACP protocol.

Built with Bubble Tea v2 and Lip Gloss v2.

Go

Requirements

  • Go 1.25+
  • opencode CLI in PATH (provides the ACP agent subprocess)

Build

go build -o client.exe .              # app
go build -o agent.exe ./agent         # standalone example agent

Usage

go run .                              # requires `opencode` in PATH
go run . --debug                      # log to ./logger.log
go run ./agent                        # run the example agent (stdio)

Key Bindings

Key Action
Enter Send message
Shift+Enter Insert newline
Esc Esc Interrupt running prompt
Ctrl+P Open commands panel
Ctrl+N New session
Ctrl+S Open session switcher
/ / k/j Scroll chat viewport (when focused)
PgUp/PgDn Page scroll chat
Ctrl+C Quit

In overlays (Commands/Sessions):

Key Action
/ / k/j Navigate items
Enter Confirm selection
Esc Cancel / close overlay

Architecture

main.go → spawns opencode acp subprocess
          ↓ stdin/stdout pipes
    client/ → ACP client (sends/receives commands)
          ↓ channels
       tui/ → Bubble Tea TUI (chat + sidebar)
  • Left panel (68%): chat viewport + input area + status bar
  • Right panel (32%): todo/task list
  • Overlays: commands panel (Ctrl+P), session list (Ctrl+S), permission requests

Components

Package Description
tui/ Main TUI model, view, update, styles
client/ ACP protocol client, connection management
tui/component/ Reusable UI components (TodoList, StatusBar, SessionList, etc.)
agent/ Standalone example agent binary (separate package main)

Design

Warm dark palette inspired by OpenCode:

  • Background: #201d1d
  • Surface: #302c2c
  • Accent: #007aff (blue)
  • Text: #fdfcfc
  • Muted: #9a9898

Flat surfaces, 4px border radius, Berkeley Mono aesthetic.

About

Go AI Agent 和 TUI 技术调研

Resources

Stars

0 stars

Watchers

0 watching

Forks

Contributors