zigzag is a Rust-first TUI/CLI project manager for Zellij-based development. It coordinates project discovery, Zellij session lifecycle, git worktree management through wt, GitHub PR/CI/review signals through gh, notification delivery, and KDL-defined Autopilot workflows from one dashboard.
README.md: Human-facing overview, install instructions, usage, configuration, and architecture orientation.package.json: Repository utility manifest. Exposesnpm testascargo test --manifest-path zigzag/Cargo.toml --all,npm run typecheckas workspacecargo check, and a Sandcastle postinstall patch hook.Makefile: Developer command shortcuts for building/installing the Rust CLI.flake.nix: Nix development environment plus defaultzigzagpackage/app outputs fornix build,nix run, andnix profile install.package.nix: Reusable Nix package expression for the RustzigzagCLI, wrapping common runtime tools (zellij,wt,git,gh,ssh,mosh).install.sh: Release installer that places thezigzagbinary into the selected install directory.agents/opencode/plugins/zigzag-notify.js: OpenCode notification bridge that shells out tozigzag notifywhen an OpenCode session becomes idle, needs permission, or errors.zigzag/Cargo.toml: Rust workspace manifest for all runtime crates.
| Directory | Responsibility Summary | Detailed Map |
|---|---|---|
zigzag/ |
Rust workspace for the zigzag runtime: CLI binary, TUI, shared domain crate, Autopilot engine, and future extension crates. |
View Map |
zigzag/crates/ |
Collection of Rust crates with a layered dependency graph: zigzag-core at the center, concrete adapters in zigzag-cli, UI in zigzag-tui, workflow engine in zigzag-autopilot, and stubs for web/plugin phases. |
View Map |
zigzag/crates/zigzag-core/ |
I/O-agnostic domain and policy crate: config parsing, action resolution, layout generation, traits, themes, notification/activity helpers, Forge parsers, and session entry effects. | View Map |
zigzag/crates/zigzag-core/src/ |
Source modules for the pure domain layer and trait Interfaces consumed by CLI/TUI/Autopilot adapters. | View Map |
zigzag/crates/zigzag-cli/ |
Binary crate that owns command dispatch, concrete process/filesystem adapters, TUI wiring, OpenCode/notification hooks, worktree/session orchestration, and Autopilot CLI commands. | View Map |
zigzag/crates/zigzag-cli/src/ |
Source modules implementing CLI subcommands, process adapters for zellij, wt, git, gh, ssh, filesystem stores, Preview acquisition, repo config projection, and session/action orchestration. |
View Map |
zigzag/crates/zigzag-tui/ |
Ratatui frontend crate that renders projects/sessions/preview panes and emits side-effect-free TuiAction values through callback injection. |
View Map |
zigzag/crates/zigzag-tui/src/ |
TUI state machine, event loop, modal handling, async worker polling, preview transitions, refresh merge logic, and standalone pickers. | View Map |
zigzag/crates/zigzag-autopilot/ |
Workflow engine crate for KDL-defined Autopilot runs: DSL parsing, state transitions, execution lifecycle, persistence, notifications, triggers, and config resolution. | View Map |
zigzag/crates/zigzag-autopilot/src/ |
Autopilot source modules for workflow definitions, run lifecycle, StepExecutor/RunStore seams, retry semantics, persistence layout, and notification mapping. | View Map |
zigzag/crates/zigzag-web/ |
Phase-gated web crate reserved for an HTTP/WebSocket bridge over zigzag-core capabilities. Currently a stub. |
View Map |
zigzag/crates/zigzag-web/src/ |
Stub source module documenting the intended axum/ratatui-WASM web surface. | View Map |
zigzag/crates/zigzag-plugin/ |
Phase-gated plugin crate reserved for future WASM plugin runtime integration. Currently a stub. | View Map |
zigzag/crates/zigzag-plugin/src/ |
Empty plugin source namespace used to reserve the crate and dependency position. | View Map |
scripts/ |
Repository automation scripts for Sandcastle patching and Docker-authenticated Sandcastle runs. | View Map |
- CLI entry starts in
zigzag-cli/src/main.rs, loads global/per-repo config, checks dependencies, and dispatches subcommands or the TUI. Pure local commands such aszigzag skillbypass external tool dependency checks. - TUI data starts as
ProjectEntryvalues fromzigzag-cli::workspace, thenzigzag-tuirenders state and returnsTuiActionvalues to CLI callbacks. - Session entry flows through
zigzag-core::session_entryfor activity/notification effects, thenzigzag-cliadapters call Zellij,wt, git, SSH/Mosh, or filesystem stores. - Preview data flows through
zigzag_tui::PreviewDataSource;zigzag-cli::previewsupplies concrete git/worktree/Zellij/GitHub acquisition whilezigzag-tui::preview_stateowns pure state transitions. - Autopilot flows through
zigzag-autopilotDSL/config parsing, run persistence,run_loop, andlifecycle;zigzag-cli::autopilot_runnerprovides process-backed step execution and notifications.
- External commands:
zellij,wt,git,gh,ssh,mosh,claude, configured review tools. - Filesystem contracts:
~/.config/zigzag/projects.kdl, per-repo.config/zigzag.kdl,~/.local/state/zigzag/zigzag.log,~/.local/share/zigzag/autopilot, session notification/activity stores, generated Zellij layout files. - Config format: KDL parsed by
zigzag-core::config,zigzag-cli::repo_config, andzigzag-autopilot::dsl. - Notification channels:
zigzag notify, macOS notification adapter, Telegram hook support, and OpenCode plugin bridge. - Agent navigation: start here, then follow the
Repository Directory Mapto the relevant crate or source-folder codemap before editing.