$ show supabitapp/supacode
Supacode is a macOS desktop application that serves as a command center for managing git worktrees, integrating with AI coding agents (Claude, Copilot, Grok, Kimi, Kiro, etc.), and providing a terminal emulator (Ghostty). It allows developers to create, manage, and switch between multiple git worktrees, each with its own terminal session, and integrates with GitHub/GitLab for pull request tracking. The application is built using SwiftUI and AppKit, with a Composable Architecture pattern (reducers, stores, actions) for state management. It includes a bundled CLI tool (`supacode-cli`) that communicates via Unix domain socket, and supports deeplink URLs (`supacode://`). The terminal runtime is based on Ghostty (embedded via submodule) and zmx for session persistence. Settings are stored in JSON files with a layered override system (global, per-repo, local). Key entry points include `AppFeature` (main reducer), `RepositoriesFeature` (sidebar/worktree lifecycle), `TerminalsFeature` (terminal session management), `AgentPresenceFeature` (AI agent tracking), and `SupacodeCLI` (CLI entry point). External dependencies include Ghostty, zmx, git, GitHub CLI (`gh`), GitLab CLI (`glab`), PostHog (analytics), Sentry (crash reporting), Sparkle (auto-updates), and a license server. Data flows: User actions (UI or CLI) are dispatched as actions to reducers, which update observable state and trigger effects (I/O operations via injected clients). Git operations are performed via `GitClient` (local or SSH). Agent hooks are installed by writing configuration files for each AI agent. Terminal layouts are persisted to disk and restored on restart. The codebase demonstrates strong engineering practices with extensive unit testing, dependency injection, and a clean separation of concerns. It features reusable components such as a generic split tree data structure, a symlink-preserving file writer, a composable agent installer framework, and a unified shell client abstraction. The project is actively maintained with a mature CI/CD pipeline and commercial licensing.
The LLM identified 5 files worth highlighting for reuse:
Provides a composable install/uninstall/state pattern with rollback on failure. Used by all AI agent integrations (Claude, Codex, Kimi, etc.) to manage hook files and configuration. Reusable for any system that needs to install/uninstall multiple components with atomicity and ownership tracking.
Writes file content through symlinks while preserving the link structure. Handles cycles, dangling links, and atomic replacement via staged temp sibling. Reusable in any application that needs to safely update configuration files that may be symlinked.
Implements a generic binary tree of panes (leaf/split) with spatial navigation, resizing, zoom, and JSON serialization. Core data structure for terminal split management. Reusable for any split-pane UI (editor, terminal multiplexer, file manager).
Unified abstraction for local and remote (SSH) shell execution with streaming output, login shell wrapping, and error classification. Supports multiple shells (zsh, bash, fish) with proper quoting. Reusable in any application that needs to run shell commands with consistent error handling.
Centralizes generation of OSC 3008 escape sequence commands for AI agent presence signaling. Handles surface guard, TTY resolution, PID liveness, and composite command construction. Reusable for any application that needs to emit terminal escape sequences for agent integration.