Gmail CLI is a high-performance, open-source command-line tool and programmatic automation interface designed specifically for the Google Gmail API (v1). Maintained under the SpaceCorps open-source engineering collective, the project originated to provide developers and autonomous AI agents with a single, standalone binary capable of operating seamlessly across macOS, Linux, and Windows without runtime dependencies or interpreter overhead.
Modern terminal workflows and AI-driven automation demand rapid feedback loops and absolute security. The original prototype CLI was implemented as a .NET console application by Niels Bosma (nielsbosma/Gmail.Console). While functional, autonomous coding assistants and shell pipelines benefit immensely from static binaries that start in 1 to 3 milliseconds without managed runtime startup latencies. In 2026, the CLI was completely re-architected in native Rust 2024 to achieve instant startup, predictable resource utilization, and zero external runtime dependencies.
Gmail CLI is built around four uncompromising principles: safety, determinism, prompt-injection defense, and speed.
--- untrusted email content begins --- / --- untrusted email content ends ---) to protect LLM agents from adversarial prompt injections.--account flag. There is no ambiguous default account.Every command and flag in the CLI is grounded directly in the official Google Gmail REST API v1 specification, providing full support for message search, thread hydration, attachment downloading with directory traversal defense, label management, draft composition, and comprehensive environment diagnostics.