Skip to content

A0 cli#997

Open
TerminallyLazy wants to merge 6 commits intoagent0ai:developmentfrom
TerminallyLazy:a0-cli
Open

A0 cli#997
TerminallyLazy wants to merge 6 commits intoagent0ai:developmentfrom
TerminallyLazy:a0-cli

Conversation

@TerminallyLazy
Copy link
Contributor

Summary

  • Add a0 CLI tool for interacting with Agent Zero from the terminal
  • Includes animated pixel-art banner, interactive launcher menu, REPL chat with real-time progress, Docker management, and ACP (Agent Client Protocol) server for IDE integration
  • Built with Typer + Rich for a lightweight CLI experience without heavy TUI frameworks

What's in the CLI

Launcher experience: Running a0 with no arguments shows an animated pixel-art "A" logo with "AGENT ZERO" text in cyan-to-blue gradient, followed by an interactive 4-option menu (Chat, Status, Start/Stop, Settings) navigable via arrow keys or number keys.

REPL chat (a0 chat): Interactive chat session with real-time spinner that polls Agent Zero's log API to show what the agent is currently doing (thinking, using tools, browsing web, running code). Responses render as left-aligned Rich Markdown.

Single-shot mode (a0 chat "message"): Send a message and get a response without entering the REPL. Useful for scripting and piping.

  1. Docker management (a0 start / a0 stop / a0 status): Start, stop, and check the Agent Zero container directly from the CLI. The REPL auto-detects when Agent Zero isn't running and offers to start it.

ACP server (a0 acp): JSON-RPC 2.0 over stdio bridge that translates between the Agent Client Protocol and Agent Zero's HTTP polling API. Enables IDE integrations (VS Code, etc.) to connect to Agent Zero as an agent backend.

Configuration (a0 config): TOML-based config at ~/.config/a0/config.toml with --show, --set key=value, and --reset options. Supports env var overrides (AGENT_ZERO_URL, AGENT_ZERO_API_KEY).

Architecture

  a0-cli/src/a0/
  ├── cli.py              # Typer app with all commands
  ├── banner.py           # Animated ANSI pixel-art banner
  ├── launcher/
  │   ├── menu.py         # Raw-mode interactive menu (no framework)
  │   └── actions.py      # Action handlers (REPL, status, docker, settings)
  ├── client/
  │   ├── api.py          # Async httpx client for Agent Zero API
  │   └── poller.py       # Log polling with typed events
  ├── acp/
  │   └── server.py       # ACP JSON-RPC stdio bridge
  └── utils/
      ├── config.py       # Pydantic config with TOML persistence
      └── docker.py       # Docker compose helpers

Test plan

  • a0 — banner animates, menu renders, arrow keys navigate, Enter selects, Esc quits
  • a0 chat — REPL connects, sends messages, shows real-time progress spinner, renders markdown responses
  • a0 chat "hello" — single-shot mode returns response and exits
  • a0 status — shows running/not-running status
  • a0 start / a0 stop — manages Docker container
  • a0 config --show — displays current config
  • a0 config --set agent_url=http://localhost:8080 — persists to TOML
  • a0 acp — accepts JSON-RPC on stdin, responds on stdout

TerminallyLazy and others added 6 commits February 6, 2026 21:09
Design for interactive launcher that shows animated banner
followed by a menu with Chat, Status, Docker, and Settings options.
Includes navigation model, auto-start flow, and one-line installer.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Detailed task breakdown with phases, dependencies, and time estimates.
Total estimated time: ~5 hours across 7 phases.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Add launcher package with menu renderer and action handlers
- Banner → Menu flow with arrow keys, number keys, escape
- Auto-start Agent Zero if not running when Chat selected
- Fix CSS path (was breaking TUI with brown screen)
- Fix quit binding visibility in footer
- Escape in TUI returns to menu instead of just cancelling

Menu options:
  [1] Chat (TUI) - Full terminal interface
  [2] Chat (REPL) - Simple text chat
  [3] Status - Check Agent Zero connection
  [4] Start/Stop - Toggle Docker container
  [5] Settings - View configuration

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
The menu was blocking on stdin.read() when user pressed Escape alone,
because it was waiting for arrow key sequence characters that never came.

Now uses select() with 50ms timeout to distinguish:
- Plain Escape: just \x1b, no follow-up
- Arrow keys: \x1b[A, \x1b[B sequences

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- New banner matches Agent Zero logo aesthetic
- Horizontal slats extend right with fade effect
- Proper triangular A shape with inner hole
- Gradient coloring (bright center, fading edges)
- Smooth slide-in animation from right

Also:
- Fix escape key detection using select() with timeout
- Remove debug output from cli.py
- Clean up unused variables

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Introduced a new CLI tool with ACP support, including a banner and interactive menu.
- Added configuration management with defaults and environment variable support.
- Implemented core functionalities for sending messages and handling sessions via the Agent Zero API.
- Included a log polling mechanism to track updates in real-time.
- New dependencies added: textual for enhanced UI and various libraries for API interactions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant