Skip to content

GAIA Code CLI update#147

Merged
itomek-amd merged 6 commits intoamd:mainfrom
itomek:feature/gaia-code-cli
Jan 9, 2026
Merged

GAIA Code CLI update#147
itomek-amd merged 6 commits intoamd:mainfrom
itomek:feature/gaia-code-cli

Conversation

@itomek
Copy link
Collaborator

@itomek itomek commented Jan 7, 2026

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

# 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)

itomek and others added 2 commits January 6, 2026 15:12
- Create new standalone CLI at src/gaia/agents/code/cli.py following EMR pattern
- Add gaia-code entry point in setup.py
- Remove code subcommand from main CLI (parser and handler)
- Delete deprecated src/gaia/agents/code/app.py
- Update documentation: replace 'gaia code' with 'gaia-code' in 8 files

The new gaia-code CLI includes:
- RoutingAgent integration for intelligent language detection
- Lemonade initialization (32768 context)
- init subcommand for model setup
- All features from previous implementation
- Rich console output following EMR agent pattern
Remove confusing `run` and `init` subcommands from gaia-code CLI.
The `run` subcommand was unnecessary (it's the only operation), and
`init` is now automatic on first use.

Changes:
- Remove all subparser logic (run/init subcommands)
- Move all arguments to top-level parser
- Remove manual init command (auto-initializes on first run)
- Fix help display to show all available arguments
- Update examples to match actual usage
- Reduce code from 611 to 435 lines (-176 lines)

Users can now simply run:
  gaia-code "Build me an app"
  gaia-code --interactive
  gaia-code --help

Instead of requiring:
  gaia-code run "Build me an app"
  gaia-code init

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
Copilot AI review requested due to automatic review settings January 7, 2026 18:24
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR successfully simplifies the gaia-code CLI by removing confusing subcommands and creating a standalone command-line tool with a flat, intuitive interface. The refactoring eliminates the need for the run subcommand and moves all functionality into a dedicated CLI module.

Key changes:

  • Created a new standalone CLI entry point (gaia-code) instead of using a subcommand under gaia
  • Removed 245 lines of code from the main CLI by extracting the code agent functionality
  • Updated all documentation and examples to use gaia-code instead of gaia code

Reviewed changes

Copilot reviewed 12 out of 12 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
src/gaia/agents/code/cli.py New standalone CLI module with argument parsing and command execution logic
src/gaia/cli.py Removed code subcommand parser and handler function (clean removal)
src/gaia/agents/code/app.py Deleted old app.py file (no longer needed)
setup.py Added new gaia-code entry point to console_scripts
docs/reference/cli.mdx Updated all examples from gaia code to gaia-code
docs/playbooks/code-agent/*.mdx Updated all tutorial examples to use new command syntax
docs/guides/*.mdx Updated guide examples to use gaia-code
.claude/agents/*.md Updated agent documentation references

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

itomek added 3 commits January 7, 2026 13:52
- Remove unused CodeAgent import from src/gaia/agents/code/cli.py
- Remove unused CodeAgent import block from src/gaia/cli.py
- Update copyright headers to 2025-2026

All lint checks now pass:
- Black: PASS
- isort: PASS
- Pylint: PASS
- Flake8: PASS
Extract duplicated interactive mode loop into helper function,
add explicit return values, and remove unused code (_print_header
and Panel import). Reduces code by 53 lines while maintaining
identical functionality.
@itomek-amd itomek-amd added documentation Documentation changes enhancement New feature or request labels Jan 7, 2026
@itomek-amd itomek-amd marked this pull request as draft January 7, 2026 20:15
@itomek-amd itomek-amd added the ready_for_ci Run CI workflows on draft PR without requesting review label Jan 7, 2026
@itomek itomek changed the title Simplify gaia-code CLI by removing subcommands GAIA Code CLI update Jan 7, 2026
@itomek itomek marked this pull request as ready for review January 8, 2026 14:56
@itomek-amd itomek-amd merged commit 2d494e2 into amd:main Jan 9, 2026
34 of 40 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Documentation changes enhancement New feature or request ready_for_ci Run CI workflows on draft PR without requesting review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants