Skip to content

Commit 57aead6

Browse files
itomekclaude
andauthored
GAIA Code CLI update (#147)
## Summary This PR simplifies the `gaia-code` CLI by removing confusing subcommands and creating a flat, intuitive interface. ## Problem The current CLI has two subcommands (`run` and `init`) that don't make sense: - `run` is the only operation the CLI does - why require it? - `init` should happen automatically, not manually - Help was broken: `gaia-code --help` didn't show actual arguments (they were hidden on the `run` subparser) - Examples in help didn't work: showed `gaia-code "prompt"` but required `gaia-code run "prompt"` ## Changes ### Removed All Subcommands - ❌ Deleted `run` subcommand (unnecessary - it's the default operation) - ❌ Deleted `init` subcommand (auto-initializes on first run now) - ❌ Removed `cmd_init()` function (166 lines) - ❌ Removed `_add_common_args()` helper (54 lines) - ✅ All arguments now top-level on main parser ### Improved User Experience - ✅ `gaia-code "Build me an app"` - works directly - ✅ `gaia-code --interactive` - starts interactive mode - ✅ `gaia-code --help` - shows ALL arguments (previously hidden) - ✅ Auto-initialization - models load automatically on first use - ✅ All examples in help actually work ### Code Quality - **176 lines removed** (611 → 435 lines) - Simpler argument parsing - No more `sys.argv` manipulation hacks - Cleaner code structure ## Testing ```bash # All these now work as expected: gaia-code "Build me a todo app" gaia-code "Build me an app" --path ~/projects/myapp gaia-code --interactive gaia-code --list-tools gaia-code --help # Shows all arguments ``` ## Breaking Change The `run` subcommand has been removed. Users must update their commands: - ❌ `gaia-code run "Build me an app"` (no longer works) - ✅ `gaia-code "Build me an app"` (new syntax) --------- Co-authored-by: Claude Sonnet 4.5 <noreply@anthropic.com>
1 parent 4e18cbe commit 57aead6

12 files changed

Lines changed: 416 additions & 604 deletions

File tree

.claude/agents/api-documenter.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ Run GAIA agents for various AI tasks.
111111

112112
### Commands:
113113
- `gaia chat` - Interactive chat
114-
- `gaia code` - Code development
114+
- `gaia-code` - Code development
115115
- `gaia jira` - Issue management
116116
- `gaia blender` - 3D automation
117117
- `gaia mcp` - MCP server control
@@ -122,7 +122,7 @@ Run GAIA agents for various AI tasks.
122122
gaia llm "What is GAIA?"
123123

124124
# Code generation
125-
gaia code "Create REST API"
125+
gaia-code "Create REST API"
126126

127127
# Jira query
128128
gaia jira "show my open bugs"

.claude/agents/cli-developer.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ You are a GAIA CLI development specialist focused on command-line interface desi
1717
```bash
1818
gaia llm # Direct LLM queries
1919
gaia chat # Interactive chat
20-
gaia code # Code development agent
20+
gaia-code # Code development agent
2121
gaia talk # Voice interaction
2222
gaia blender # 3D content creation
2323
gaia jira # Issue management

docs/guides/code.mdx

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ The GAIA Code Agent turns a natural-language prompt into a working Next.js appli
8383

8484
<Step title="Generate an app">
8585
```bash
86-
gaia code "Build me a movie tracking app in nextjs where I can track the movie title, genre, date watched, and a score out of 10" --path movie-web-app
86+
gaia-code "Build me a movie tracking app in nextjs where I can track the movie title, genre, date watched, and a score out of 10" --path movie-web-app
8787
```
8888
</Step>
8989

@@ -101,31 +101,31 @@ The GAIA Code Agent turns a natural-language prompt into a working Next.js appli
101101
<Tabs>
102102
<Tab title="Workout Tracker">
103103
```bash
104-
gaia code "Build me a workout tracking app in nextjs where I can track workout, duration, date, and goal"
104+
gaia-code "Build me a workout tracking app in nextjs where I can track workout, duration, date, and goal"
105105
```
106106
</Tab>
107107

108108
<Tab title="Restaurant Reviews">
109109
```bash
110-
gaia code "Build me a restaurant rating application in nextjs. I want to be able to put the location of the restaurant, the food that I ate, and my review"
110+
gaia-code "Build me a restaurant rating application in nextjs. I want to be able to put the location of the restaurant, the food that I ate, and my review"
111111
```
112112
</Tab>
113113

114114
<Tab title="AI Tool Leaderboard">
115115
```bash
116-
gaia code "Build me an AI tool rater in nextjs where I can give the name of the AI programming tool, give it a score out of 10 for speed and quality in a text box, as well as provide a description. Show a little leaderboard that will show the highest performing to lowest performing tools by averaging those scores."
116+
gaia-code "Build me an AI tool rater in nextjs where I can give the name of the AI programming tool, give it a score out of 10 for speed and quality in a text box, as well as provide a description. Show a little leaderboard that will show the highest performing to lowest performing tools by averaging those scores."
117117
```
118118
</Tab>
119119

120120
<Tab title="Simple Todos">
121121
```bash
122-
gaia code "Build me a todo tracking app using typescript"
122+
gaia-code "Build me a todo tracking app using typescript"
123123
```
124124
</Tab>
125125

126126
<Tab title="Interactive Mode">
127127
```bash
128-
gaia code --interactive
128+
gaia-code --interactive
129129
# then type your prompt when prompted
130130
```
131131
</Tab>
@@ -172,21 +172,21 @@ your-app/
172172
<CardGroup cols={2}>
173173
<Card title="Debug Logging" icon="bug">
174174
```bash
175-
gaia code "Create a todo tracking app in nextjs" --debug
175+
gaia-code "Create a todo tracking app in nextjs" --debug
176176
```
177177
See internal decision logs
178178
</Card>
179179

180180
<Card title="JSON Trace" icon="file-code">
181181
```bash
182-
gaia code "Create a todo tracking app in nextjs" --trace
182+
gaia-code "Create a todo tracking app in nextjs" --trace
183183
```
184184
Save detailed execution trace
185185
</Card>
186186

187187
<Card title="Full Debug" icon="magnifying-glass-chart">
188188
```bash
189-
gaia code "Create a todo tracking app in nextjs" --debug --trace
189+
gaia-code "Create a todo tracking app in nextjs" --debug --trace
190190
```
191191
Maximum debugging information
192192
</Card>

docs/guides/routing.mdx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ The routing agent solves these problems by:
2828
- Separating routing concerns from agent logic
2929
- Using LLM-powered analysis to detect language/framework from natural language
3030
- Asking users for clarification when uncertain, rather than guessing
31-
- Providing a consistent routing experience across all agents (currently used for `gaia code`, with plans to expand)
31+
- Providing a consistent routing experience across all agents (currently used for `gaia-code`, with plans to expand)
3232

3333
## How It Works
3434

@@ -63,11 +63,11 @@ The routing agent is automatically used when you run certain GAIA commands:
6363

6464
```bash
6565
# Routing happens automatically
66-
gaia code "Create a REST API with Express and SQLite"
66+
gaia-code "Create a REST API with Express and SQLite"
6767
# → Detected: TypeScript backend → Creates TypeScript CodeAgent
6868

6969
# If ambiguous, you'll be prompted
70-
gaia code "Create a todo backend app"
70+
gaia-code "Create a todo backend app"
7171
# → What language/framework would you like to use for your backend project?
7272
# → (e.g., 'Express', 'Django', 'React', 'FastAPI')
7373
# User: Express
@@ -115,7 +115,7 @@ The routing agent uses the following rules for language detection:
115115
### High-Confidence Detection (No Questions)
116116

117117
```bash
118-
$ gaia code "Create an Express API with SQLite"
118+
$ gaia-code "Create an Express API with SQLite"
119119
[2025-11-18 10:08:03] | INFO | Analysis result: {
120120
'language': 'typescript',
121121
'project_type': 'backend',
@@ -127,7 +127,7 @@ $ gaia code "Create an Express API with SQLite"
127127
### Conversational Disambiguation
128128

129129
```bash
130-
$ gaia code "Build me a todo backend app"
130+
$ gaia-code "Build me a todo backend app"
131131

132132
What language/framework would you like to use for your backend project?
133133
(e.g., 'Express', 'Django', 'React', 'FastAPI')
@@ -145,7 +145,7 @@ What language/framework would you like to use for your backend project?
145145
### Multiple Disambiguation Rounds
146146

147147
```bash
148-
$ gaia code "Create an app"
148+
$ gaia-code "Create an app"
149149

150150
What kind of application would you like to build?
151151
(e.g., 'React web app', 'Python CLI tool', 'Express API', 'Django backend')
@@ -176,7 +176,7 @@ Add these to your `.env` file for persistent configuration.
176176

177177
The routing agent is currently integrated with:
178178

179-
- **`gaia code`**: Intelligently routes to Python or TypeScript CodeAgent based on framework detection
179+
- **`gaia-code`**: Intelligently routes to Python or TypeScript CodeAgent based on framework detection
180180

181181
**Future Integration Plans:**
182182
- `gaia docker`: Route to appropriate containerization strategy
@@ -217,7 +217,7 @@ echo $AGENT_ROUTING_MODEL
217217
echo $LEMONADE_BASE_URL
218218

219219
# Test with a clear request
220-
gaia code "Create an Express API with SQLite"
220+
gaia-code "Create an Express API with SQLite"
221221
```
222222

223223
### Low Confidence / Always Asks Questions

docs/playbooks/code-agent/part-1-introduction.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ Building modern web applications requires:
5252
### Example
5353

5454
```bash
55-
gaia code "Build me a movie tracking app in nextjs where I can track the movie title, genre, date watched, and a score out of 10"
55+
gaia-code "Build me a movie tracking app in nextjs where I can track the movie title, genre, date watched, and a score out of 10"
5656
```
5757

5858
**Result:** A complete Next.js app with:
@@ -151,7 +151,7 @@ GAIA Code uses a **Minimum Viable Product (MVP) approach** when generating appli
151151
<Tabs>
152152
<Tab title="Initial Prompt">
153153
```bash
154-
gaia code "Build me a movie tracking app"
154+
gaia-code "Build me a movie tracking app"
155155
```
156156
</Tab>
157157

@@ -175,7 +175,7 @@ GAIA Code uses a **Minimum Viable Product (MVP) approach** when generating appli
175175
<Tabs>
176176
<Tab title="Specific Prompt">
177177
```bash
178-
gaia code "Build me a movie tracking app in nextjs where I can track the movie title, genre, date watched, and a score out of 10"
178+
gaia-code "Build me a movie tracking app in nextjs where I can track the movie title, genre, date watched, and a score out of 10"
179179
```
180180
</Tab>
181181

@@ -261,11 +261,11 @@ The agent doesn't overengineer. It creates the minimum viable product based on y
261261

262262
```bash
263263
# Simple prompt = minimal schema
264-
gaia code "Build me a workout tracker"
264+
gaia-code "Build me a workout tracker"
265265
# Likely generates: workout name, date, completed
266266

267267
# Detailed prompt = detailed schema
268-
gaia code "Build me a workout tracking app in nextjs where I can track workout, duration, date, and goal"
268+
gaia-code "Build me a workout tracking app in nextjs where I can track workout, duration, date, and goal"
269269
# Generates exactly what you specified
270270
```
271271

@@ -313,7 +313,7 @@ Let's see GAIA Code in action:
313313

314314
<Step title="Generate an app">
315315
```bash
316-
gaia code "Build me a todo tracking app using typescript"
316+
gaia-code "Build me a todo tracking app using typescript"
317317
```
318318
</Step>
319319

docs/playbooks/code-agent/part-2-app-creation.mdx

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Let's walk through creating a movie tracking app to understand each component.
2626
### The Prompt
2727

2828
```bash
29-
gaia code "Build me a movie tracking app in nextjs where I can track the movie title, genre, date watched, and a score out of 10"
29+
gaia-code "Build me a movie tracking app in nextjs where I can track the movie title, genre, date watched, and a score out of 10"
3030
```
3131

3232
This single command triggers a complete generation pipeline.
@@ -573,31 +573,31 @@ Here are verified prompts that generate complete applications:
573573
### Movie Tracking App
574574

575575
```bash
576-
gaia code "Build me a movie tracking app in nextjs where I can track the movie title, genre, date watched, and a score out of 10"
576+
gaia-code "Build me a movie tracking app in nextjs where I can track the movie title, genre, date watched, and a score out of 10"
577577
```
578578

579579
### Workout Tracking App
580580

581581
```bash
582-
gaia code "Build me a workout tracking app in nextjs where I can track workout, duration, date, and goal"
582+
gaia-code "Build me a workout tracking app in nextjs where I can track workout, duration, date, and goal"
583583
```
584584

585585
### Restaurant Rating App
586586

587587
```bash
588-
gaia code "Build me a restaurant rating application. I want to be able to put the location of the restaurant, the food that I ate, and my review"
588+
gaia-code "Build me a restaurant rating application. I want to be able to put the location of the restaurant, the food that I ate, and my review"
589589
```
590590

591591
### AI Tool Rating with Leaderboard
592592

593593
```bash
594-
gaia code "Build me an AI tool rating algorithm in nextjs where I can give the name of the AI programming tool, give it a score out of 10 for speed and quality in a text box, as well as provide a description. Show a little leaderboard that will show the highest performing to lowest performing tools by averaging those scores"
594+
gaia-code "Build me an AI tool rating algorithm in nextjs where I can give the name of the AI programming tool, give it a score out of 10 for speed and quality in a text box, as well as provide a description. Show a little leaderboard that will show the highest performing to lowest performing tools by averaging those scores"
595595
```
596596

597597
### Simple Todo Tracker
598598

599599
```bash
600-
gaia code "Build me a todo tracking app using typescript"
600+
gaia-code "Build me a todo tracking app using typescript"
601601
```
602602

603603
---

docs/playbooks/code-agent/part-3-validation-building.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ From prompt to working app:
508508

509509
```bash
510510
# 1. Generate
511-
gaia code "Build me a workout tracking app in nextjs where I can track workout, duration, date, and goal"
511+
gaia-code "Build me a workout tracking app in nextjs where I can track workout, duration, date, and goal"
512512

513513
# 2. Run
514514
cd workout-tracking-app

docs/reference/cli.mdx

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -242,31 +242,31 @@ lemonade-server serve --ctx-size 32768
242242
Routing detects "Express" and uses TypeScript:
243243
<CodeGroup>
244244
```bash TypeScript/Express
245-
gaia code "Create a REST API with Express and SQLite for managing products"
245+
gaia-code "Create a REST API with Express and SQLite for managing products"
246246
```
247247
</CodeGroup>
248248

249249
Routing detects "Django" and uses Python:
250250
<CodeGroup>
251251
```bash Python/Django
252-
gaia code "Create a Django REST API with authentication"
252+
gaia-code "Create a Django REST API with authentication"
253253
```
254254
</CodeGroup>
255255

256256
Routing detects "React" and uses TypeScript frontend:
257257
<CodeGroup>
258258
```bash React Frontend
259-
gaia code "Create a React dashboard with user management"
259+
gaia-code "Create a React dashboard with user management"
260260
```
261261
</CodeGroup>
262262

263263
<CodeGroup>
264264
```bash Interactive Mode
265-
gaia code --interactive
265+
gaia-code --interactive
266266
```
267267

268268
```bash Cloud LLM
269-
gaia code "Create a REST API" --use-claude
269+
gaia-code "Create a REST API" --use-claude
270270
```
271271
</CodeGroup>
272272

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,6 +170,7 @@
170170
"gaia-mcp = gaia.mcp.mcp_bridge:main",
171171
"gaia-mcp-atlassian = gaia.mcp.atlassian_mcp:main",
172172
"gaia-emr = gaia.agents.emr.cli:main",
173+
"gaia-code = gaia.agents.code.cli:main",
173174
]
174175
},
175176
python_requires=">=3.10",

0 commit comments

Comments
 (0)