You need to rewrite your CLI for AI agents
New CLI accepts raw JSON payloads, provides runtime schema introspection, and enforces context window discipline for agents.
A Google engineer has published a manifesto arguing that traditional human-first Command Line Interfaces (CLIs) are fundamentally ill-suited for AI agents, and a new design paradigm is required. Justin Poehnelt's 'gws' CLI for Google Workspace is built with agents as the primary consumer from the ground up, prioritizing machine-readable JSON payloads over human-friendly flags and runtime schema introspection over static documentation. This shift acknowledges that CLIs are becoming the lowest-friction interface for agents to reach external systems, requiring deterministic output and safety rails against hallucinations.
The technical implementation reveals a stark design choice: the CLI accepts the full API payload via a single --json flag, mapping directly to the underlying API schema for zero translation loss. Crucially, it includes a 'gws schema' command that dumps method signatures as machine-readable JSON, allowing agents to self-serve current API specs. To combat context window bloat, it mandates the use of field masks to limit API responses and supports NDJSON pagination for stream-processing large datasets. This approach creates a canonical, up-to-date source of truth that agents can query at runtime, moving beyond expensive and stale system prompt documentation.
- Accepts full API payloads via --json flag, eliminating lossy translation from human-centric flags like --title.
- Provides runtime schema introspection via 'gws schema' commands, serving as a self-updating documentation source for agents.
- Enforces context window discipline with mandatory field masks and NDJSON pagination to prevent token waste on massive API blobs.
Why It Matters
As AI agents automate more workflows, the tools they use must be redesigned for predictability and security, not human ergonomics.