Codegen CLI Manual
Welcome to the Codegen CLI documentation. This guide covers all available commands and their usage patterns.Installation
Initialization
CLI Reference
codegen (root)
Description: Launches the interactive TUI if no subcommand is provided.
codegen agent
Description: Create a new agent run with a prompt, fetch an existing agent run by ID, or pull PR branch.
Usage Patterns:
- Create run:
codegen agent --prompt "Your prompt" - Get run JSON:
codegen agent --id 123 --json - Pull PR branch:
codegen agent --id 123 pull
--prompt, -p TEXTThe prompt to send to the agent (mutually exclusive with —id unless using create)--id INTAgent run ID to fetch or pull--jsonOutput raw JSON response when fetching (flag)--org-id INTOrganization ID (defaults to CODEGEN_API_TOKEN/REPOSITORY_ORG_ID or auto-detect)--model TEXTModel to use for this agent run (optional, see Available Models below)--repo-id INTRepository ID to use for this agent run (optional)
pullPull the PR branch associated with an agent run (requires —id)
codegen agents
Description: List and manage agent runs.
Usage Patterns:
- List runs:
codegen agents list - Get run details:
codegen agents get 123
--org-id INTOrganization ID (defaults to CODEGEN_ORG_ID/REPOSITORY_ORG_ID or auto-detect)--limit INTMaximum number of runs to return (default: 10)--jsonOutput raw JSON response (flag)
codegen login
Description: Store authentication token.
Usage Patterns:
- Interactive login:
codegen login - Token login:
codegen login --token YOUR_API_TOKEN
--token TEXTAPI token to store--no-verifySkip token verification (flag)
codegen logout
Description: Clear stored authentication token.
Usage Pattern:
codegen logout
codegen org
Description: Manage and switch between organizations.
Usage Patterns:
- List organizations:
codegen org list - Switch organization:
codegen org switch ORG_ID - Get current organization:
codegen org current
--jsonOutput raw JSON response (flag)
codegen repo
Description: Manage repository configuration and environment variables.
Usage Patterns:
- List repositories:
codegen repo list - Configure repository:
codegen repo config REPO_NAME - Get repository details:
codegen repo get REPO_ID
--org-id INTOrganization ID (defaults to CODEGEN_ORG_ID or auto-detect)--jsonOutput raw JSON response (flag)
Available Models
The--model parameter accepts the following model identifiers:
OpenAI Models
gpt-4o- GPT-4 Omni modelgpt-4.1- GPT-4.1 modelgpt-4.5- GPT-4.5 modelgpt-5- GPT-5 model with reasoning capabilitieso1- OpenAI O1 reasoning modelo3- OpenAI O3 reasoning modelo4- OpenAI O4 reasoning modeldeepseek-chat- DeepSeek Chat model
Anthropic Models
claude-3-7-sonnet- Claude 3.7 Sonnetclaude-3-5-sonnet- Claude 3.5 Sonnet
xAI Models
grok-2- Grok 2 modelgrok-3- Grok 3 modelgrok-3-fast- Grok 3 Fast variantgrok-3-mini- Grok 3 Mini variantgrok-3-mini-fast- Grok 3 Mini Fast variantgrok-4- Grok 4 modelgrok-code-fast- Grok Code Fast modelgrok-code-fast-1- Grok Code Fast 1 modelgrok-code-fast-1-0825- Grok Code Fast 1 (August 25 version)
Google Models
gemini-1.5-pro- Gemini 1.5 Progemini-2.5- Gemini 2.5