Go application bridging AI agents (Claude Code ACP) with communication platforms. Implements ACP protocol for agent execution with HTTP API and Discord integration.
ACP (Agent Client Protocol) is defined at https://agentclientprotocol.com/
The project uses golang language.
IMPORTANT: always use gopls / LSP / MCP server calls when possible to understand the codebase better, before work.
CLI (kong) → Commands → Session Management → ACP Client → Agent Subprocess
↓
HTTP Server (chi) ←→ SSE Streaming
↓
Discord Bot (discordgo) ←→ Message Relay
internal/cli/- Command handlers (run, serve, session)internal/acp/- ACP protocol client implementationsinternal/session/- Session state and thread-safe storeinternal/server/- HTTP API with SSE streaminginternal/discord/- Bot, commands, message relay
- Subscriber pattern for multi-client event delivery
- Channel-based streaming with buffered events
- Context propagation with graceful shutdown
- sync.Map for thread-safe session storage
go build -o acpp .
./acpp run "prompt" # One-shot execution
./acpp serve # Web UI + scheduler (localhost:8080); Discord bot too if a token is configuredgo test ./...internal/session/session.go- Core session lifecycleinternal/acp/client.go- Two client types: StreamingClient (one-shot), SessionClient (persistent)internal/discord/relay.go- Message buffering and Discord delivery
- New CLI commands: Add to
internal/cli/, register inmain.go - New API endpoints: Add handler in
internal/server/handlers.go, route inserver.go - New Discord commands: Add in
internal/discord/commands.go
- Sessions use channels for event streaming - don't block receivers
- Store uses sync.Map - safe for concurrent access
- Relay has mutex for buffer access - always lock before modifying
Each commit message must have an emoji at the beginning.
IMPORTANT: Doesn't use commit skill for this repository.
DISCORD_TOKEN- Required for Discord bot mode
--host/--port- Server bind address (default: localhost:8080)--agent- Agent command to run (default: claude-code-acp)--verbose- Discord output verbosity level
Agent executes in current working directory. Session inherits the directory from where acpp serve was started.