> ## Documentation Index
> Fetch the complete documentation index at: https://docs-v1.latitude.so/llms.txt
> Use this file to discover all available pages before exploring further.

# Command Reference

> Full reference for the Latitude CLI commands.

All commands support `-p, --path <path>` to run against a specific directory (default `.`), and `--dev` to use a local Gateway.

## init

Initialize a Latitude project in the current directory.

```bash theme={null}
latitude init [-p <path>] [--dev]
```

* Prompts for your API key (or uses `latitude login`/`LATITUDE_API_KEY`)
* Lets you choose:
  * Create a new project (provide a name)
  * Use an existing project (enter `projectId`)
* Creates the prompts directory (asks before clearing a non-empty folder)
* Writes `latitude-lock.json`

`latitude-lock.json` example:

```json theme={null}
{
  "projectId": 123,
  "rootFolder": "prompts",
  "version": "live"
}
```

## status

Show project and version info plus a local vs remote diff summary.

```bash theme={null}
latitude status [-p <path>] [--dev]
```

* Prints project link, version title/description
* Summarizes Added/Modified/Deleted prompts

## pull

Pull remote prompts to your local filesystem with a diff preview.

```bash theme={null}
latitude pull [-p <path>] [-y] [--dev]
```

* Computes local vs remote changes
* Choose: Accept / Cancel / View details (opens pager for full diffs)
* `-y` skips confirmation and applies changes
* Saves prompts as `.promptl` text files
* Removes local files that no longer exist remotely

## push

Push local prompt changes to the current version.

```bash theme={null}
latitude push [-p <path>] [-y] [--dev]
```

* Reads `.promptl` files under `rootFolder`
* Shows a diff and asks for confirmation; `-y` skips confirmation
* Sends only changed files to the server

## checkout

Checkout a specific version or create a new version and switch to it.

```bash theme={null}
latitude checkout [versionUuid] [-b <name>] [-p <path>] [--dev]
```

* `latitude checkout <versionUuid>`: updates `latitude-lock.json` and pulls that version
* `latitude checkout -b <name>`: creates a new version and switches to it
* Validates the target version before updating the lock file

## login

Store or override your API key in the system keychain.

```bash theme={null}
latitude login [--api-key <key>] [-f]
```

* Warns if `LATITUDE_API_KEY` is set (that variable takes precedence)
* `-f/--force` to override without confirmation

## help

Show CLI help.

```bash theme={null}
latitude help
```

## Prompt file format

Prompts are stored as plain `.promptl` text files:

```text theme={null}
# prompts/welcome.promptl
Welcome to Latitude!
```

Each file contains the raw prompt content using PromptL syntax.
