Getting Started

Terminal & CLI

Get started

Open a terminal in your project and run:

latch

The terminal interface uses a padded layout, a rounded multiline input box, and a responsive session sidebar (Ctrl+B to toggle).

On first launch, use /setup to choose a provider, enter or reference its API key, choose a model, and save. Have a ChatGPT subscription? Use /login (or latch login) to connect through OpenAI Codex device authorization—no API key needed. Subscription eligibility and usage limits apply; API billing is separate. See ChatGPT sign-in.

Setup adds providers without removing existing ones: OpenCode Go, DeepSeek, and ChatGPT subscription can coexist in /model. One credential covers all supported models on that service; new setup enables the full catalog. /model refresh updates service catalogs (including automatic stable-version tracking for ChatGPT), and /model all clears older local model filters. Account permissions and quotas still apply. Use /setup to edit or remove an existing provider explicitly.

Model requests have configurable connection/TLS, header, stream-idle and total deadlines. Automatic retries are limited to recognized temporary failures before a response starts; see request timeouts and retries.

Run latch doctor to check local prerequisites and configuration without contacting a model provider. /model changes the model for the current session. You can also run one prompt without the TUI:

latch -p "Explain this repository"

Resume or manage saved sessions with latch --resume or /resume in the TUI. Use Ctrl+Space to mark sessions, Delete to remove the selected row or marked sessions, and confirm with y. For scripts, use latch run --workspace ./project --prompt "Fix the failing test" --output json; latch sessions list shows saved sessions. Run latch --help for all options. Latch asks the model to include its final summary when it marks a task complete; the recorded validation determines whether that task is verified. After recorded edits, a missing implementation claim also receives one bounded correction opportunity; a normal CLI exit alone is not verified completion. An empty final completion summary receives a kernel report of recorded changes and current validation status without an extra model request; it stays visible on resume. Managed processes record natural exits automatically. If saving their output fails, polling reports lost output and labels any partial log as incomplete. When validation cannot certify the workspace, it names the blocker. Once the retry budget is exhausted, validation commands blocked by the same active processes are not rerun. When several requirements need fresh evidence, one validation command can prove them together; older passes remain historical after later writes. Linux validation preserves failures through output-filtering pipelines. On Windows, run validation checks separately or redirect output instead of piping it.

Type to search. Results stay in your browser.