bc

module
v0.2.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 17, 2026 License: MIT

README

bc

CI Release Go License

AI agents are powerful alone — chaotic when they work together. bc fixes that.

Coordinate teams of Claude, Gemini, Cursor, and other AI agents with isolated worktrees, shared channels, and cost controls. One binary. No login. MIT licensed.

Install

# macOS / Linux
curl -fsSL https://raw.githubusercontent.com/rpuneet/bc/main/scripts/install.sh | bash

# Homebrew
brew install rpuneet/bc/bc

# Go
go install github.com/rpuneet/bc/cmd/bc@latest

# From source
git clone https://github.com/rpuneet/bc && cd bc && make install-local-bc

Prerequisites: Go 1.25+, tmux, git. For TUI: Bun.

Quick Start

bc init                    # Initialize workspace
bc up                      # Start server + web UI on localhost:9374
bc agent create eng-01 \
  --role engineer \
  --tool claude            # Spawn an agent
bc status                  # See what's running
bc agent peek eng-01       # Watch agent output
bc cost show               # Check spending

Open http://localhost:9374 for the web dashboard.

What bc Does

Without bc: One agent at a time. Context lost between sessions. Merge conflicts from parallel edits. No visibility. Surprise bills.

With bc: Multiple agents in parallel. Each gets its own git worktree — zero conflicts. Persistent channels for structured communication. Per-agent budgets with hard stops. Everything observable in real time.

How It Works
  1. Isolated by design — Each agent runs in its own tmux session (or Docker container) with a dedicated git worktree. They can't step on each other's work.

  2. Structured communication — Agents talk through persistent channels with mentions, reviews, and handoffs. Not through you.

  3. Full visibility — Costs, activity, resource usage — all in real time through CLI, TUI, or web dashboard.

Supported Agents

Agent Status
Claude Code Fully supported
Gemini CLI Fully supported
Cursor Supported
Codex Supported
Custom Any CLI tool via provider config

Commands

Core
Command Description
bc Open TUI dashboard
bc init Initialize workspace
bc up Start server (foreground)
bc up -d Start server (daemon)
bc down Stop server
bc status Show agent status
bc doctor Diagnose workspace issues
Agents
Command Description
bc agent create [name] Create agent with role and tool
bc agent list List all agents
bc agent attach <agent> Attach to agent's tmux session
bc agent peek <agent> Watch agent output
bc agent send <agent> <msg> Send message to agent
bc agent stop <agent> Stop agent
bc agent delete <agent> Delete agent
Channels
Command Description
bc channel list List channels
bc channel create <name> Create channel
bc channel send <ch> <msg> Send message
bc channel history <ch> View history
Cost & Scheduling
Command Description
bc cost show Show cost records
bc cost budget show Budget status
bc cron add <name> Schedule recurring task
bc cron list List scheduled tasks
Configuration
Command Description
bc config show Show configuration
bc config set <key> <val> Set config value
bc secret set <name> Store encrypted secret
bc tool list List available tools
bc mcp list List MCP servers
bc role list List agent roles

Full reference: bc --help or bc <command> --help

Architecture

┌─────────────────────────────────────────────────┐
│                    bc binary                     │
│                                                  │
│  ┌──────────┐  ┌──────────┐  ┌───────────────┐  │
│  │   CLI    │  │   TUI    │  │  HTTP Server  │  │
│  │ (Cobra)  │  │ (Ink/    │  │  + Web UI     │  │
│  │          │  │  React)  │  │  + MCP + SSE  │  │
│  └────┬─────┘  └────┬─────┘  └───────┬───────┘  │
│       │              │                │          │
│  ┌────┴──────────────┴────────────────┴───────┐  │
│  │              pkg/ (Go packages)            │  │
│  │  agent · channel · cost · cron · mcp       │  │
│  │  provider · runtime · secret · workspace   │  │
│  └────────────────────┬───────────────────────┘  │
│                       │                          │
│  ┌────────────────────┴───────────────────────┐  │
│  │           Agent Runtimes                   │  │
│  │     tmux sessions │ Docker containers      │  │
│  │     git worktrees │ isolated .bc/ state    │  │
│  └────────────────────────────────────────────┘  │
└─────────────────────────────────────────────────┘
                        │
            ┌───────────┼───────────┐
            │           │           │
         Claude      Gemini     Cursor ...
  • Single binary — CLI, server, web UI, MCP all in one
  • SQLite storage — zero external dependencies
  • Agent isolation — each agent gets its own git worktree and tmux/Docker session
  • Gateway integrations — Slack, Telegram, Discord for notifications

Configuration

Workspace config lives in .bc/settings.json:

{
  "version": "2",
  "server": {
    "host": "127.0.0.1",
    "port": 9374
  },
  "providers": {
    "default": "claude"
  },
  "runtime": {
    "default": "tmux"
  },
  "storage": {
    "default": "sqlite"
  }
}

Development

make build            # Build everything
make test             # Run all tests
make lint             # Run linters
make check            # Full quality gate
make run-bc           # Run from source
make run-web          # Web UI dev server (hot reload)

See make help for all targets.

Contributing

Contributions welcome. Please run make check before submitting PRs.

License

MIT

Directories

Path Synopsis
cmd
bc command
Package main is the entry point for the bc CLI.
Package main is the entry point for the bc CLI.
gendocs command
Package main generates CLI reference documentation from Cobra commands.
Package main generates CLI reference documentation from Cobra commands.
examples
demo-project command
internal
cmd
Package cmd implements the bc CLI commands.
Package cmd implements the bc CLI commands.
pkg
agent
Package agent provides agent lifecycle management for bc.
Package agent provides agent lifecycle management for bc.
attachment
Package attachment provides file storage for channel attachments.
Package attachment provides file storage for channel attachments.
client
Package client provides an HTTP client for the bcd daemon.
Package client provides an HTTP client for the bcd daemon.
container
Package container implements a Docker-based runtime backend for agent sessions.
Package container implements a Docker-based runtime backend for agent sessions.
cost
Package cost provides cost tracking and reporting for bc agents.
Package cost provides cost tracking and reporting for bc agents.
cron
Package cron provides SQLite-backed scheduled task management for bc.
Package cron provides SQLite-backed scheduled task management for bc.
db
Package db provides unified SQLite database management for bc CLI.
Package db provides unified SQLite database management for bc CLI.
deps
Package deps implements the optional dependencies manager described in docs/proposals/multi-workspace-and-code-tab.md §7.
Package deps implements the optional dependencies manager described in docs/proposals/multi-workspace-and-code-tab.md §7.
doctor
Package doctor provides workspace health checks and diagnostics for bc.
Package doctor provides workspace health checks and diagnostics for bc.
events
Package events provides an append-only event log for bc.
Package events provides an append-only event log for bc.
files
Package files exposes shared filesystem helpers.
Package files exposes shared filesystem helpers.
gateway
Package gateway provides external messaging platform integrations.
Package gateway provides external messaging platform integrations.
gateway/discord
Package discord implements the gateway.Adapter for Discord.
Package discord implements the gateway.Adapter for Discord.
gateway/slack
Package slackgw implements the gateway.Adapter for Slack.
Package slackgw implements the gateway.Adapter for Slack.
gateway/telegram
Package telegram implements the gateway.Adapter for Telegram Bot API.
Package telegram implements the gateway.Adapter for Telegram Bot API.
log
Package log provides structured logging for bc using log/slog.
Package log provides structured logging for bc using log/slog.
mcp
Package mcp provides SQLite-backed storage for MCP server configurations.
Package mcp provides SQLite-backed storage for MCP server configurations.
names
Package names provides random name generation for agents.
Package names provides random name generation for agents.
notify
Package notify implements the notification gateway for delivering external platform events (Slack, Telegram, Discord, etc.) to subscribed bc agents via tmux send-keys.
Package notify implements the notification gateway for delivering external platform events (Slack, Telegram, Discord, etc.) to subscribed bc agents via tmux send-keys.
provider
Package provider — ConfigAdapter extends Provider with config file setup.
Package provider — ConfigAdapter extends Provider with config file setup.
runtime
Package runtime provides a backend-agnostic interface for agent session management.
Package runtime provides a backend-agnostic interface for agent session management.
secret
Package secret provides encrypted secrets management for bc workspaces.
Package secret provides encrypted secrets management for bc workspaces.
stats
Package stats provides workspace metrics and statistics tracking.
Package stats provides workspace metrics and statistics tracking.
template
Package template provides agent template definitions and file-based storage.
Package template provides agent template definitions and file-based storage.
tmux
Package tmux provides tmux session management for agent orchestration.
Package tmux provides tmux session management for agent orchestration.
token
Package token reads Claude Code session JSONL files from agent volume mounts and aggregates token usage per agent.
Package token reads Claude Code session JSONL files from agent volume mounts and aggregates token usage per agent.
tool
Package tool provides persistent storage and management for AI tool providers.
Package tool provides persistent storage and management for AI tool providers.
ui
Package ui provides consistent CLI output formatting utilities.
Package ui provides consistent CLI output formatting utilities.
workspace
Package workspace provides workspace/project management.
Package workspace provides workspace/project management.
worktree
Package worktree manages git worktree lifecycle for agent isolation.
Package worktree manages git worktree lifecycle for agent isolation.
build_services.go — factory for per-workspace WorkspaceServices.
build_services.go — factory for per-workspace WorkspaceServices.
handlers
code.go implements the read-only Code tab backend:
code.go implements the read-only Code tab backend:
mcp
Package mcp implements the Model Context Protocol server for bc workspaces.
Package mcp implements the Model Context Protocol server for bc workspaces.
ws
Package ws implements a Server-Sent Events (SSE) hub for real-time event broadcasting to connected web clients.
Package ws implements a Server-Sent Events (SSE) hub for real-time event broadcasting to connected web clients.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL