Overview
Thelatitude CLI is a single, self-contained binary that exposes your Latitude organization on the command line. Like the MCP server, its commands are generated directly from the Latitude API, so the command surface automatically stays in sync with the platform. For the live list of commands and their input/output schemas, check the API reference.
It’s built for two audiences:
- Humans, a fast, scriptable way to inspect and manage projects, traces, datasets, members, keys, and more without leaving the terminal.
- Agents, a zero-dependency way for an agent (Claude Code, Cursor, Codex, …) to act on Latitude without wiring up an MCP connection, using
--format jsonfor machine-readable output and--schemafor machine-readable help.
Prefer a network connection? The MCP server exposes the same capabilities over OAuth.
Installation
The CLI ships as a pre-built binary on our GitHub Releases — grab the latestcli-vX.Y.Z release. Download the archive for your platform, extract it, and put the latitude binary somewhere on your PATH.
- MacOS / Linux
- Windows
On MacOS the first run may be blocked by Gatekeeper. Allow it with
xattr -d com.apple.quarantine /usr/local/bin/latitude, or via System Settings → Privacy & Security.Authentication
The CLI authenticates with an organization-scoped API key. Create one in the Latitude UI under Settings → Keys → API Keys. There are two ways to give the key to the CLI:- Keyring (recommended)
- Environment variable
Store the key once in your operating system’s secret store (Keychain on MacOS, Secret Service on Linux, Credential Manager on Windows):Paste your API key when prompted and press Enter. It’s saved to the keyring under Need more than one key, like one for production and one for your sandbox? Use profiles.
latitude:ApiKeyAuth and reused on every subsequent command. Manage it with:.env file from the current directory, or from the nearest parent directory that has one. The LATITUDE_API_KEY you keep there for tracing authenticates the CLI too. Variables exported in your shell win over .env. Settings that change where requests go or how TLS is checked (LATITUDE_BASE_URL, the proxy and CA bundle variables, LATITUDE_INSECURE) are ignored when they come from .env, so export those from your shell instead.
Profiles
A profile is a named setup for the CLI with its own API key, stored in the keyring. With profiles you can keep several keys side by side and choose one per command, per shell, or as your default, instead of re-exportingLATITUDE_API_KEY every time you switch.
Production and sandbox
The most common use is switching between your project’s live data and its sandbox. Both use the same project slugs. The API key alone decides which one a command reads: a live key from Settings → Keys → API Keys, or alat_sandbox_ key from Sandbox configuration inside the sandbox. Give each key its own profile:
-p sandbox (or --profile sandbox) to run one against the sandbox. The project slug is the same in both, so set it once:
-p each time:
Managing profiles
profiles.toml file in the CLI’s config directory: ~/Library/Application Support/latitude/ on MacOS, ~/.config/latitude/ on Linux, and %APPDATA%\latitude\ on Windows. The file never holds a key. Each key stays in the keyring under latitude:ApiKeyAuth#<profile>.
A profile can also carry a default project, which helps when your profiles point at different projects:
LATITUDE_PROJECT_SLUG and --global-project-slug. Passing --project-slug on a command still overrides it.
Which key a command uses
The CLI uses the first of these that’s set:- The profile passed with
-p/--profile. LATITUDE_API_KEY, from your shell or a.envfile.- The profile named by
LATITUDE_PROFILE, or else the default set withlatitude profiles use. - The key stored by
latitude auth loginwith no profile selected.
Usage
The general shape islatitude <resource> <command> [flags], where each resource mirrors an area of the Latitude API:
projects, traces, datasets, and more — run latitude --help for the full list. Common examples:
--project-slug. Set the project once for a session with LATITUDE_PROJECT_SLUG (or the global --global-project-slug flag) and you can drop it from individual commands — --project-slug still wins wherever you pass it:
latitude --help for the full list):
--profile <name>/-p— run the command under a named profile.--query <JMESPath>— project/filter the response before it’s formatted, e.g.--query "items[].slug". When an API operation has its ownqueryparameter (like the free-text search ontraces list), that parameter is exposed as--query-paraminstead.--dry-run— validate the request locally without sending it to the API.--quiet/-q— suppress success output (errors still print to stderr).--human— force table output even when stdout is piped.--schema— print a machine-readable JSON description of a command’s inputs and outputs, the agent-facing counterpart to--help.--debug— dump the raw HTTP request and response to stderr.
--params <JSON>— pass parameters as a JSON object. These override the individual flags.--json <JSON|->— on commands that send a request body, pass the whole body as JSON. Use-to read it from stdin.--retries <N>/--no-retry— change how many times a failed request is retried, or turn retries off.
Output formats
Every command accepts--format to control how results are rendered. This makes the CLI equally good for humans reading a terminal and for scripts or agents parsing output.
LATITUDE_OUTPUT environment variable (e.g. export LATITUDE_OUTPUT=json); the --format flag always overrides it. --human is shorthand for --format table, for when you pipe output but still want the table.
Environment variables
The standard
HTTPS_PROXY / HTTP_PROXY / NO_PROXY / SSL_CERT_FILE variables are honored as well. Any of these can also go in a .env file, except LATITUDE_BASE_URL and the proxy, CA bundle, and TLS variables, which the CLI only reads from your shell (see Authentication).
Shell completion
Generate a completion script for your shell —bash, zsh, fish, powershell, or elvish — and load it to get tab-completion for every resource, command, and flag:
- zsh
- bash
- fish
Man page
The CLI can emit its own manual page in roff format, soman latitude works like any native tool:
For Agents
The CLI pairs naturally with agents:--format json/jsonl for structured output, --schema for machine-readable help, and latitude generate-skills to teach an agent the command surface — everything it needs to drive Latitude locally with no MCP connection. Have agents pass -p on every command when you use profiles, so each call names its environment and can’t be redirected by a LATITUDE_API_KEY in the environment. Prefer the MCP server when you’d rather connect the agent over the network with OAuth.