This directory is a working map for engineers changing the CLI. It is organized by the question you are trying to answer, not by package names.
If you are new to the repository, start here and then follow one of the reading paths below.
The CLI is a presentation runtime for the Tero control plane. It renders the
interactive TUI (internal/app), exposes direct command surfaces
(internal/cmd), and keeps terminal interactions responsive through a local
SQLite projection backed by PowerSync.
Business truth still lives in the control plane. The CLI should present and orchestrate that truth, not redefine it.
architecture/: system shape, boundaries, and non-negotiable flow rules.domains/: ownership and invariants for concrete product flows (for example onboarding).interfaces/: contracts by user surface (tui,cli,mcp).operations/: practical debugging, logging, observability, and testing workflows.reference/: stable conventions referenced from multiple docs.specs/: focused audits and temporary design/test artifacts.meta/: standards for writing/maintaining documentation in this repo.
- architecture/README.md
- architecture/system-overview.md
- architecture/data-flow.md
- architecture/ui-architecture.md
- architecture/message-contracts.md
Use these paths when docs and code should be read together:
cmd/tero/main.go: executable entrypoint.internal/cmd/root.go: dependency composition and app bootstrap wiring.internal/app/app.go: root Bubble Tea model and high-level state orchestration.internal/app/onboarding/: onboarding orchestrator and gate steps.internal/core/bootstrap/: deterministic onboarding transition engine.internal/core/chat/: pure chat lifecycle/session policy.internal/boundary/chat/: chat streaming client/protocol adapters.internal/powersync/: sync lifecycle and projection pipeline.
A doc in this repo is good if it helps an engineer build the right mental model, predict non-happy-path behavior, understand what must not be broken, and find the right code entrypoints quickly.
If a page is only a checklist of files/commands, it is incomplete.