gcai is the command-line client for the GC AI API. Every command maps to a REST endpoint, so anything you can do over the API you can do from your terminal, with tab-completable commands, typed flags, and human-readable output.
Reach for the CLI for quick one-off calls, shell scripts, and piping results into other tools. For a long-running integration or an AI assistant working on your behalf, the REST API and MCP server are the better fit.
Install
Requires Node.js 22 or newer.Quickstart
1
Authenticate
2
Verify
3
Run a command
chat create waits for the answer and prints it. Add --json for raw output you can pipe to jq.Finding your way around
- Surface map lists every command at a glance.
- Commands gives the full synopsis and flags for each command, grouped by resource.
- Concepts worth reading once: Authentication, Output and scripting, and Async and polling.
--json (raw JSON output), --api-key, and --base-url.