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]

Auth

CommandDescription
ai loginSign in to TheGitAI — opens your browser to the website.
ai login --no-browserSign in on a headless/remote machine by pasting a one-time code.
ai whoamiShow the signed-in account.
ai --usageShow account usage percentage and reset times.
ai logoutSign out.

Sessions

CommandDescription
ai --list-sessionsList 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. The five most recent sessions per repo are kept.

Options

OptionDescription
-y, --yesStart in Auto-Accept mode.
-h, --helpShow help.

Chat commands

Used inside an interactive session:

CommandDescription
/helpShow help.
/usageShow account usage percentage and reset times.
/modelList supported models and pick one.
/model <id>Switch the active model without clearing history.
/memoryShow the session summary and decision memory.
/resumeResume a saved session for this repo.
/clearClear the current conversation history.
/exitQuit the session.

Environment

VariableDescription
THEGITAI_SESSION_DIROverride the default local directory for saved sessions.
Run ai --help at any time to print this reference in your terminal.