OpenAI CLI

github.com
October 22, 2026
10 min read
54/100
Summary
OpenAI has released an official command-line interface for its REST API, providing resource-based commands for standard API operations, administrative endpoints, file management, image generation, and local image previewing. The CLI can be installed with Homebrew through `brew install openai/tools/openai` or built with Go 1.26 or later using `go install github.com/openai/openai-cli/cmd/openai@latest`. Standard API commands use `OPENAI_API_KEY`, while administrative commands require `OPENAI_ADMIN_KEY`. Commands support readable text output by default, including in pipelines, while `--format json` and `--format jsonl` support scripts. The CLI can transform successful and error output with GJSON syntax, accepts custom headers, and supports mutual TLS in beta when users configure separate PEM certificate and private-key files plus an mTLS API base URL. An untrusted-stdin mode prevents values piped from untrusted sources from resolving local-file references. Image generation saves files to `~/Downloads/gpt-images/` by default and uses `gpt-image-2.5-sunburst` unless a model or legacy response format is specified. The CLI checks for newer stable releases only in interactive terminals, no more than once daily, never installs updates automatically, and allows update checks to be disabled with `OPENAI_CLI_NO_UPDATE_CHECK=1`.
Key Takeaways
- OpenAI’s official CLI provides command-line access to its REST API, including responses, files, images, and administrative organization-usage endpoints.
- The CLI requires Go 1.26 or later for local installation, or can be installed through Homebrew with `brew install openai/tools/openai`.
- Image-generation commands save results locally by default and use `gpt-image-2.5-sunburst` when no explicit model or legacy response format is supplied.
- The CLI supports custom request headers, JSON and JSONL output, GJSON-based output extraction, and beta mutual TLS authentication.
- Interactive installations can check GitHub release metadata for updates, but the CLI never installs updates automatically.
What the discussion said
The thread treated the release less as a major AI capability announcement than as a small command-line wrapper whose purpose OpenAI failed to communicate. Several readers eventually converged on a distinction: Codex is an interactive coding-agent environment, while this CLI is aimed at scripting OpenAI API calls and potentially administering workspace or account operations. That makes it useful for automation, agent pipelines, and organizations that may approve a narrowly scoped API tool without granting access to a consumer-facing coding agent. But that modest utility was buried under distrust of OpenAI’s product practice. Commenters expect short-lived tooling, abrupt deprecations, confusing overlapping names, and rough releases that make even flagship voice and realtime features unreliable on current hardware. Some argued a REST API CLI needs little marketing because its audience already understands the use case; others said that is exactly why one plain sentence about the workflow and intended user was necessary. The strongest practical criticism was that a thin API wrapper is trivial to generate today, while durable value lies in predictable maintenance, composable Unix-style interfaces, and stable access. A separate concern was that OpenAI offers tooling around its APIs while still withholding APIs for users to organize and export their own ChatGPT conversations, reinforcing a sense of platform lock-in.
Where opinion split
The central dispute was whether the CLI is self-explanatory, appropriately scoped infrastructure or another poorly communicated, redundant OpenAI product. Defenders said it is simply a command-line interface to the API, distinct from Codex’s interactive agent role and useful for scripts and workspace controls. Critics argued that overlapping names and absent plain-language guidance make users guess at basic purpose, especially given OpenAI’s reputation for unstable tools and product churn.
Coverage & discussions
Hacker News · github.com
Community discussions
Community Sentiment
Positives
- Separating a scriptable API and workspace CLI from Codex’s interactive coding-agent role could let teams automate model workflows without approving a broader consumer agent.
- A first-party command-line interface may give agents and shell pipelines a standard way to invoke OpenAI services, including specialized capabilities such as image generation.
- Some readers see the release as overdue infrastructure: models can be trained or orchestrated around tools they know how to call rather than relying on ad hoc wrappers.
Concerns
- OpenAI’s repeated tool deprecations make developers wary of building AI workflows atop a CLI that could disappear before it becomes dependable infrastructure.
- Reports of broken realtime voice and transcription features on up-to-date flagship Macs fuel the view that OpenAI ships AI products before basic functionality is adequately tested.
- The Codex, ChatGPT, and CLI naming tangle obscures whether this is an agent, an API wrapper, or workspace administration, making adoption needlessly uncertain.
- A thin API wrapper is easy to generate; commenters doubt it earns trust unless OpenAI supplies the long-term maintenance and stability that generated glue code lacks.
- Providing API tooling while offering no API to organize users’ own ChatGPT histories looks like asymmetric access designed to deepen platform lock-in.
Related Articles

CEO fired developers to make room for AI. Developers create open source AI CEO
Aug 27, 2026

Google Workspace CLI
Mar 5, 2026

Launch HN: RunAnywhere (YC W26) – Faster AI Inference on Apple Silicon
Mar 10, 2026

Open Code Review – An AI-powered code review CLI tool
Jun 5, 2026
Clawdbot - open source personal AI assistant
Jan 26, 2026