CLI Reference
A complete reference for the ai command.
Usage
ai # start an interactive session in the current repo
ai "<request>" # start a session with <request> as the first message
ai [options]
Coding sessions require an interactive terminal on both stdin and stdout. Piped
prompts and redirected coding output are rejected; commands such as --help,
--version, whoami, --usage, and --list-sessions remain redirectable.
Auth
| Command | Description |
|---|---|
ai login | Sign in to TheGitAI — opens your browser to the website. |
ai login --no-browser | Sign in on a headless/remote machine by pasting a one-time code. |
ai whoami | Show the signed-in account. |
ai --usage | Show account usage percentage and reset times. |
ai logout | Sign out. |
Sessions
| Command | Description |
|---|---|
ai --list-sessions | List saved sessions for this repo. |
ai --session <id|name> | Resume a saved session by id or name. |
Sessions are stored locally and scoped to the current repo. Local history can be listed and resumed from that computer. Continuing a session through the service requires the TheGitAI account used for that session. The five most recent sessions per repo are kept.
Options
| Option | Description |
|---|---|
-y, --yes | Start in Auto-Accept mode. |
-h, --help | Show help. |
Chat commands
Used inside an interactive session:
| Command | Description |
|---|---|
/help | Show help. |
/about | Show the installed version and platform information. |
/usage | Show account usage percentage and reset times. |
/model | List supported models and pick one. |
/model <id> | Switch the active model without clearing history. |
/resume | Resume a saved session for this repo. |
/jobs | Open the background jobs picker (browse, expand output, stop). |
/jobs output <id> | Print a background job's full captured output. |
/jobs kill <id> | Stop a background job by id. |
/new | start a new conversation; this session remains saved |
/exit | Quit the session. |
Environment
| Variable | Description |
|---|---|
THEGITAI_SESSION_DIR | Override the default local directory for saved sessions. |
Run
ai --help at any time to print this reference in your terminal.