LatentCodeGet started

Quickstart

Install LatentCode, connect it to your gateway, and have it make and verify a change in your project.

Before you begin

  • A LatentStack account and an API key. Your key starts with ls-; copy it, or generate one, under API Key on your Account page.
  • macOS, Linux or Windows, and a terminal.
  • A project to work on. A git repository is best: undo and diffs use git.

1. Install

$curl -fsSL https://latentstack.dev/install.sh | bash

The installer puts latentcode in ~/.latentcode/bin, adds it to your PATH, and points it at this gateway. Open a new terminal and check it:

$latentcode --version

See Install for other options.

2. Connect

Save your API key. LatentCode checks it against the gateway and imports the models your tier allows:

$latentcode config set api-key ls-your-key
✓ API key saved → ~/.config/latentcode/latentcode.jsonc
✓ Imported 24 model(s) (tier: standard)

If you skip this, the TUI asks for the gateway URL and key the first time you start it, in a Connect LatentRouter dialog. Check the connection at any time:

$latentcode config
Installed some other way?
Point LatentCode at this gateway first. The URL ends in /v1:
$latentcode config set base-url https://latentstack.dev/v1

3. Start a session

$cd ~/src/my-project && latentcode

The TUI opens with a prompt at the bottom. The line under it shows the agent (Build), the model, and how much context is left. Press ctrl+x m to pick a different model.

Start by asking about the code. Nothing is changed while it answers questions:

> Give me an overview of this project: what it does, how it's laid out, and how to run the tests.

4. Make a change

  1. 1
    Plan it

    Press tab to switch to the Plan agent, which can read but not edit. Describe the change:

    > Add input validation to the signup handler: reject empty emails and passwords under 8 characters, with a clear error message.

    It investigates and replies with a plan. Ask follow-up questions until you're happy with it.

  2. 2
    Build it

    Press tab to go back to Build and say go ahead. The agent edits the files and runs your tests. Each edit appears in the conversation as a diff, and the sidebar (ctrl+x b) lists every modified file.

  3. 3
    Answer any approval requests

    If it needs to do something outside the defaults, such as install a package or touch a .env file, it stops and asks. Choose Yes, allow once, allow it for the rest of the session, or No and tell it what to do instead. See Permissions.

  4. 4
    Review the result

    Type /diff to open the diff viewer on your working tree: n/p move between files, ]/[ between changes, q closes it. For a second opinion, run /review: reviewers check your uncommitted changes and report problems.

  5. 5
    Keep it, or undo it

    Commit as usual, or ask the agent to. If you don't like the change, /undo (ctrl+x u) removes your last message and restores the files it changed. /redo brings it back.

5. Teach it your project

Run /init. LatentCode studies the repository and writes an AGENTS.md at its root with your build commands, conventions and structure. Every session reads it, so commit it for your team. See Rules.

Next steps