Commands
Reference for all Letta Code CLI commands and interactive commands
CLI flags
Section titled “CLI flags”Basic usage
Section titled “Basic usage”| Flag | Description |
|---|---|
letta | Start interactive session (auto-resumes last project agent) |
letta --new | Create new agent (reuses global persona/human blocks) |
letta --fresh-blocks | Create new agent with all fresh memory blocks |
letta --agent <id> | Use a specific agent by ID |
letta --help | Show help |
letta --version | Show version |
Model and configuration
Section titled “Model and configuration”| Flag | Description |
|---|---|
--model <model>, -m | Specify model (e.g., sonnet-4.5, gpt-5-codex) |
--system <id> | Switch system prompt preset |
--toolset <name> | Force toolset: default, codex, or gemini |
--skills <path> | Custom skills directory |
Headless mode
Section titled “Headless mode”| Flag | Description |
|---|---|
-p "prompt" | Run a one-off prompt (headless mode) |
--output-format <fmt> | Output format: text, json, or stream-json |
--yolo | Bypass all permission prompts |
--permission-mode <mode> | Set permission mode |
--tools "Tool1,Tool2" | Limit available tools |
--allowedTools "..." | Allow specific tool patterns |
--disallowedTools "..." | Block specific tool patterns |
Tool management
Section titled “Tool management”| Flag | Description |
|---|---|
--link | Attach Letta Code tools to agent (use with --agent) |
--unlink | Remove Letta Code tools from agent (use with --agent) |
Use with --agent to attach or remove Letta Code tools from an existing agent. See Permissions for approval settings.
Maintenance
Section titled “Maintenance”| Flag | Description |
|---|---|
letta update | Manually check and install updates |
DISABLE_AUTOUPDATER=1 letta | Disable auto-updates |
Interactive commands
Section titled “Interactive commands”All interactive commands start with / during a session.
Agent management
Section titled “Agent management”| Command | Description |
|---|---|
/agent | Show current agent info and link |
/swap | Switch to a different agent |
/rename | Rename the current agent |
/download | Export agent as JSON file |
Configuration
Section titled “Configuration”| Command | Description |
|---|---|
/model | Open model selector |
/toolset | Switch toolsets (default/codex/gemini) |
/system | Switch system prompt preset |
/stream | Toggle token streaming on/off |
Tools and permissions
Section titled “Tools and permissions”| Command | Description |
|---|---|
/link | Attach Letta Code tools to current agent |
/unlink | Remove Letta Code tools from current agent |
Memory and skills
Section titled “Memory and skills”| Command | Description |
|---|---|
/init | Initialize agent memory for current project |
/remember | Commit information to agent memory |
/remember <text> | Remember specific information |
/skill | Enter skill creation mode |
/skill "<desc>" | Start skill creation with description |
Background processes
Section titled “Background processes”| Command | Description |
|---|---|
/bashes | Show running background shell processes |
Session management
Section titled “Session management”| Command | Description |
|---|---|
/clear | Clear conversation history |
/exit | Exit and show session stats |
/logout | Clear credentials and exit |
Environment variables
Section titled “Environment variables”| Variable | Description |
|---|---|
LETTA_API_KEY | API key for authentication |
LETTA_BASE_URL | Base URL for self-hosted Letta server |
DISABLE_AUTOUPDATER | Set to 1 to disable auto-updates |