A modern, modular terminal shell built with the complete Bubble Tea ecosystem. Features rich TUI components, animations, syntax highlighting, AI integration, visual effects, and more.
- π Multi-shell support: Execute bash and zsh commands
- π Multiple panes: Split terminal with different layouts (single, horizontal, vertical, grid)
- π Plugin system: Extensible architecture with command, UI, hook, and formatter plugins
- β¨οΈ Autocompletion: Smart command, file, environment variable, and history completion
- π Secrets manager: Encrypted storage using AES-256-GCM with Argon2id key derivation
- π Multi-backend encryption: Support for AES, age, and GPG encryption
- π Git integration: Sync secrets with git or yadm (Yet Another Dotfiles Manager)
- π API key management: Specialized management for API keys
- π€ AI agents: Integrated AI agents for command suggestions, explanations, and error fixes
- π Multiple providers: Support for OpenAI, Anthropic, Gemini, and local LLMs
- π£οΈ A2A Protocol: Agent-to-agent communication for building complex AI workflows
- π¬ AI Chat Pane: Resizable, configurable chat interface for AI conversations
- π Markdown rendering: AI responses rendered with full markdown support
- π‘ SSH manager: Manage and connect to SSH hosts with key/password authentication
- π Port forwarding: Local port forwarding support
- π Host management: Save and recall SSH host configurations
- π Progress bars: Beautiful progress indicators using Bubble Tea
- π Markdown editor: Edit markdown files with live preview
- β¨ Visual effects: Water waves, fluid dynamics, and particle systems using harmonica
- π¨ Syntax highlighting: Shell command highlighting with chroma
- π Themes: Multiple color themes (default, dracula, nord)
- π Menu bar: Standard File, Edit, View, Help menus with keyboard shortcuts
- π Command history: Persistent history with search
- βοΈ Job control: Background job management (start, stop, resume, kill)
- π Logging: Structured logging with multiple levels and formats
- π Privilege management: Sudo/su integration and privilege elevation
- π₯οΈ POSIX signals: Signal handling and process management
The project follows a modular architecture with complete abstraction:
cbwsh/
βββ cmd/cbwsh/ # Main entry point
βββ internal/app/ # Main application logic
βββ pkg/
βββ core/ # Core types, interfaces, and enums
βββ config/ # Configuration management
βββ shell/ # Shell executor (bash/zsh)
βββ panes/ # Pane/layout management
βββ plugins/ # Plugin system
βββ secrets/ # Encrypted secrets storage (AES, age, GPG)
βββ ssh/ # SSH connection management
βββ ai/ # AI agents, A2A protocol, and tools
βββ logging/ # Structured logging infrastructure
βββ process/ # Job control and process management
βββ privileges/ # Privilege checking and elevation
βββ posix/ # POSIX signals and system calls
βββ ui/
βββ menu/ # Menu bar component
βββ progress/ # Progress bar component
βββ markdown/ # Markdown renderer
βββ animation/ # Harmonica animations
βββ autocomplete/ # Autocompletion
βββ highlight/ # Syntax highlighting
βββ styles/ # UI styles and themes
βββ effects/ # Visual effects (water, fluid, particles)
βββ aichat/ # AI chat pane component
βββ editor/ # Markdown editor component
Built with the complete Charm ecosystem:
- Bubble Tea - TUI framework
- Bubbles - TUI components
- Lip Gloss - Style definitions
- Glamour - Markdown rendering
- Harmonica - Smooth animations
- Huh - Form components
- Log - Logging
- Wish - SSH server
- Chroma - Syntax highlighting
| Key | Action |
|---|---|
| Ctrl+Q | Quit |
| Ctrl+C | Cancel current command |
| Enter | Execute command |
| Tab | Autocomplete |
| β/β | Navigate history |
| Ctrl+L | Clear screen |
| Ctrl+N | New pane |
| Ctrl+W | Close pane |
| Ctrl+] | Next pane |
| Ctrl+[ | Previous pane |
| Ctrl+\ | Split vertical |
| Ctrl+- | Split horizontal |
| Ctrl+B | Toggle sidebar |
| Ctrl+A | AI assist mode |
| Ctrl+? | Help |
| Key | Action |
|---|---|
| Alt+M / F10 | Toggle menu bar |
| Alt+F | File menu |
| Alt+E | Edit menu |
| Alt+V | View menu |
| Alt+H | Help menu |
| β/β | Navigate menus |
| β/β | Navigate items |
| Enter | Select item |
| Escape | Close menu |
| Key | Action |
|---|---|
| Ctrl+Enter | Send message |
| Ctrl+L | Clear chat |
| Escape | Unfocus pane |
| PageUp/PageDown | Scroll chat |
| Key | Action |
|---|---|
| Ctrl+S | Save |
| Ctrl+P | Toggle mode (edit/preview/split) |
| Ctrl+B | Insert bold |
| Ctrl+I | Insert italic |
| Ctrl+K | Insert link |
| Ctrl+H | Insert heading |
curl -fsSL https://raw.githubusercontent.com/cbwinslow/cbwsh/main/install.sh | bashOr with wget:
wget -qO- https://raw.githubusercontent.com/cbwinslow/cbwsh/main/install.sh | bashiwr https://raw.githubusercontent.com/cbwinslow/cbwsh/main/install.ps1 | iexOr download and run manually:
.\install.ps1 -AddToPathgo install github.com/cbwinslow/cbwsh@latestgit clone https://github.com/cbwinslow/cbwsh.git
cd cbwsh
make installOr without make:
git clone https://github.com/cbwinslow/cbwsh.git
cd cbwsh
go build -o cbwsh .
./cbwsh# Install specific version
curl -fsSL https://raw.githubusercontent.com/cbwinslow/cbwsh/main/install.sh | bash -s -- --version v1.0.0
# Install to custom location
curl -fsSL https://raw.githubusercontent.com/cbwinslow/cbwsh/main/install.sh | bash -s -- --prefix ~/.local/bin
# Install without sudo
curl -fsSL https://raw.githubusercontent.com/cbwinslow/cbwsh/main/install.sh | bash -s -- --no-sudo --prefix ~/.local/bin# Install specific version
.\install.ps1 -Version v1.0.0
# Install to custom location
.\install.ps1 -Prefix "C:\Tools\cbwsh"
# Install and add to PATH
.\install.ps1 -AddToPathmake # Build the binary
make install # Install to /usr/local/bin
make install PREFIX=~/.local # Install to custom prefix
make uninstall # Remove installed binary
make test # Run tests
make lint # Run linter
make clean # Clean build artifacts
make cross-compile # Build for all platforms
make help # Show all available targetsConfiguration is stored in ~/.cbwsh/config.yaml. Example:
shell:
default_shell: bash
history_size: 10000
ui:
theme: default
layout: single
show_status_bar: true
enable_animations: true
syntax_highlighting: true
ai:
provider: gemini # Options: none, openai, anthropic, gemini, local
api_key: "" # Store in secrets manager for security
model: "gemini-pro"
enable_suggestions: true
secrets:
store_path: ~/.cbwsh/secrets.enc
encryption_algorithm: AES-256-GCM # Options: AES-256-GCM, age, gpg
key_derivation: argon2id
keybindings:
quit: ctrl+q
help: ctrl+?
ai_assist: ctrl+acbwsh includes several visual effects powered by harmonica physics:
water := effects.NewWaterEffect(width, height)
water.SetColors(effects.DefaultWaterColors)
water.Update()
output := water.RenderColored()fluid := effects.NewFluidSimulation(width, height, viscosity, diffusion)
fluid.AddDensity(x, y, amount)
fluid.AddVelocity(x, y, vx, vy)
fluid.Step()
output := fluid.RenderColored()particles := effects.NewParticleSystem(width, height, maxParticles)
particles.SetColors(effects.DefaultFireColors)
particles.Emit(x, y, count, spread, speed)
particles.Update()
output := particles.RenderColored()import "github.com/cbwinslow/cbwsh/pkg/logging"
// Create a logger
logger := logging.New(
logging.WithLevel(logging.LevelDebug),
logging.WithOutput(os.Stderr),
)
// Log messages
logger.Info("Application started")
logger.Debug("Debug message")
logger.Error("Something went wrong")
// With fields
logger.WithField("user", "john").Info("User logged in")
logger.WithFields(map[string]any{
"action": "execute",
"command": "ls -la",
}).Debug("Command executed")import "github.com/cbwinslow/cbwsh/pkg/process"
// Create job manager
manager := process.NewJobManager(100)
// Start a background job
job, err := manager.StartJob(ctx, "sleep 10", "/bin/bash")
// List jobs
for _, job := range manager.ListJobs() {
fmt.Printf("%s\n", job.String())
}
// Stop a job
manager.StopJob(job.ID)
// Continue a stopped job
manager.ContinueJob(job.ID)
// Kill a job
manager.KillJob(job.ID)import "github.com/cbwinslow/cbwsh/pkg/privileges"
// Create privilege manager
manager := privileges.NewManager()
// Check current privileges
if manager.IsRoot() {
fmt.Println("Running as root")
}
// Check if command requires elevation
if privileges.RequiresElevation("apt update") {
fmt.Println("Needs sudo")
}
// Execute elevated command
output, err := manager.ExecuteElevated(ctx, "apt update")import "github.com/cbwinslow/cbwsh/pkg/posix"
// Create signal manager
manager := posix.NewSignalManager()
// Register signal handler
manager.RegisterHandler(posix.SIGINT, func(sig posix.Signal) {
fmt.Printf("Received %s\n", sig)
})
// Start handling signals
manager.Start(posix.SIGINT, posix.SIGTERM)
// Send signal to process
posix.Send(pid, posix.SIGTERM)// Create an AI agent
agent := ai.NewAgent("assistant", core.AIProviderGemini, apiKey, "gemini-pro")
// Query the agent
response, err := agent.Query(ctx, "How do I list files?")
// Get command suggestions
cmd, err := agent.SuggestCommand(ctx, "find large files")
// Explain a command
explanation, err := agent.ExplainCommand(ctx, "find . -size +100M")// Create A2A router
router := ai.NewA2ARouter()
// Register agents
router.RegisterHandler("shell-assistant", ai.NewShellAssistant(agent))
// Send messages between agents
msg := &ai.A2AMessage{
Type: ai.A2AMessageTypeQuery,
From: "user",
To: "shell-assistant",
Payload: "Suggest a command to compress files",
}
response, err := router.Send(ctx, msg)# Run tests
go test -v ./...
# Run linter
golangci-lint run ./...
# Build
go build -o cbwsh .
# Or use make
make test # Run tests
make lint # Run linter
make build # Build binary
make dev # Development mode with file watchingSee TODO.md for a comprehensive list of planned features, including:
- π€ AI Features: Natural language commands, error fixes, code generation
- π₯οΈ Terminal UI: Floating panes, tabs, themes, visual effects
- π Shell Features: Block-based input, structured output, job progress
- π Security: Password manager integrations, 2FA, hardware keys
- π‘ SSH & Remote: Multi-hop connections, SFTP, Mosh support
- π¨ Customization: Starship-like prompts, custom themes, key bindings
- π§ Integration: Git, Docker, Kubernetes, cloud providers
We welcome contributions! Check the TODO.md for areas where you can help.
MIT
Built with Bubble Tea and the Charm ecosystem