Skip to content

Commit 4f90fae

Browse files
authored
Better CLI Page (#1249)
# Motivation <!-- Why is this change necessary? --> # Content <!-- Please include a summary of the change --> # Testing <!-- How was the change tested? --> # Please check the following before marking your PR as ready for review - [ ] I have added tests for my changes - [ ] I have updated the documentation or added new documentation as needed
1 parent 27cd628 commit 4f90fae

File tree

2 files changed

+24
-102
lines changed

2 files changed

+24
-102
lines changed

docs/api-reference/overview.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ curl -X POST "https://api.codegen.com/v1/organizations/{org_id}/agent/run/resume
107107

108108
<Card
109109
title="Programmatically Retrieve Agent Traces"
110-
icon="scroll-text"
110+
icon="list"
111111
href="/api-reference/agent-run-logs"
112112
>
113113
Learn how to retrieve and analyze detailed agent execution logs.

docs/introduction/cli.mdx

Lines changed: 23 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ icon: "terminal"
55
iconType: "solid"
66
---
77

8-
The `codegen` CLI allows users to run and interact with agents from the terminal.
8+
The `codegen` CLI is your terminal interface to Codegen agents. Use it to view agents, pull their work, create new agents, and run Claude Code with full telemetry and monitoring.
99

1010
<iframe
1111
className="w-full aspect-video rounded-xl"
@@ -16,126 +16,48 @@ The `codegen` CLI allows users to run and interact with agents from the terminal
1616
allowFullScreen
1717
></iframe>
1818

19-
## Installation
19+
## Installation & Setup
2020

2121
```bash
2222
uv tool install codegen
2323
```
2424

25-
## Initialization
25+
The CLI uses your API token for authentication. Get your token and organization ID from the **[authentication guide](/api-reference/authentication)**.
2626

2727
```bash
2828
codegen login
2929
```
3030

31-
## CLI Reference
31+
## Key Commands
3232

33-
### `codegen` (root)
33+
### `codegen`
3434

35-
**Description:** Launches the interactive TUI if no subcommand is provided.
36-
37-
---
38-
39-
### `codegen agent`
40-
41-
**Description:** Create a new agent run with a prompt, fetch an existing agent run by ID, or pull PR branch.
42-
43-
**Usage Patterns:**
44-
45-
- **Create run:** `codegen agent --prompt "Your prompt"`
46-
- **Get run JSON:** `codegen agent --id 123 --json`
47-
- **Pull PR branch:** `codegen agent --id 123 pull`
48-
49-
**Options:**
50-
51-
- `--prompt, -p TEXT` The prompt to send to the agent (mutually exclusive with --id unless using create)
52-
- `--id INT` Agent run ID to fetch or pull
53-
- `--json` Output raw JSON response when fetching (flag)
54-
- `--org-id INT` Organization ID (defaults to CODEGEN_API_TOKEN/REPOSITORY_ORG_ID or auto-detect)
55-
- `--model TEXT` Model to use for this agent run (optional)
56-
- `--repo-id INT` Repository ID to use for this agent run (optional)
57-
58-
**Positional Actions:**
59-
60-
- `pull` Pull the PR branch associated with an agent run (requires --id)
61-
62-
---
63-
64-
### `codegen agents`
65-
66-
**Description:** List and manage agent runs.
67-
68-
**Usage Patterns:**
69-
70-
- **List runs:** `codegen agents list`
71-
- **Get run details:** `codegen agents get 123`
72-
73-
**Options:**
74-
75-
- `--org-id INT` Organization ID (defaults to CODEGEN_ORG_ID/REPOSITORY_ORG_ID or auto-detect)
76-
- `--limit INT` Maximum number of runs to return (default: 10)
77-
- `--json` Output raw JSON response (flag)
78-
79-
---
35+
Launches the interactive terminal UI (TUI) for browsing agents, viewing runs, and managing your Codegen workflow from the terminal.
8036

8137
### `codegen login`
8238

83-
**Description:** Store authentication token.
84-
85-
**Usage Patterns:**
86-
87-
- **Interactive login:** `codegen login`
88-
- **Token login:** `codegen login --token YOUR_API_TOKEN`
89-
90-
**Options:**
39+
Store your API token for authentication. Supports both interactive login and direct token input.
9140

92-
- `--token TEXT` API token to store
93-
- `--no-verify` Skip token verification (flag)
94-
95-
---
96-
97-
### `codegen logout`
98-
99-
**Description:** Clear stored authentication token.
100-
101-
**Usage Pattern:**
102-
103-
- `codegen logout`
104-
105-
---
106-
107-
### `codegen org`
108-
109-
**Description:** Manage and switch between organizations.
110-
111-
**Usage Patterns:**
112-
113-
- **List organizations:** `codegen org list`
114-
- **Switch organization:** `codegen org switch ORG_ID`
115-
- **Get current organization:** `codegen org current`
116-
117-
**Options:**
118-
119-
- `--json` Output raw JSON response (flag)
120-
121-
---
122-
123-
### `codegen repo`
124-
125-
**Description:** Manage repository configuration and environment variables.
126-
127-
**Usage Patterns:**
41+
```bash
42+
# Interactive login
43+
codegen login
12844

129-
- **List repositories:** `codegen repo list`
130-
- **Configure repository:** `codegen repo config REPO_NAME`
131-
- **Get repository details:** `codegen repo get REPO_ID`
45+
# Direct token login
46+
codegen login --token YOUR_API_TOKEN
47+
```
13248

133-
**Options:**
49+
## What You Can Do
13450

135-
- `--org-id INT` Organization ID (defaults to CODEGEN_ORG_ID or auto-detect)
136-
- `--json` Output raw JSON response (flag)
51+
- **View and manage agents** - List agent runs, check status, and see detailed execution logs
52+
- **Pull agent work** - Download branches and code changes created by agents directly to your local environment
53+
- **Create new agents** - Trigger agent runs from the command line with custom prompts
54+
- **Run Claude Code** - Execute Claude Code with OpenTelemetry monitoring and comprehensive logging
55+
- **Manage organizations** - Switch between organizations and configure repositories
13756

138-
---
57+
<Note>
58+
The CLI provides the same capabilities as the web UI and API, optimized for
59+
terminal-based workflows and automation.
60+
</Note>
13961

14062
## Get Started
14163

0 commit comments

Comments
 (0)