OpenAI CLI
$ openai Official Med RiskOpenAI CLI (openai) is OpenAI's official Go command-line interface for the OpenAI REST API, covering Responses, Audio/Speech, Images, Batches, Files, and Vector Stores. It supports --format json / jsonl / yaml / raw, OPENAI_API_KEY / OPENAI_BASE_URL env configuration, and flag-per-parameter invocation.
brew install openai/tools/openai openai maps directly to OpenAI REST endpoints with --format json and zero Node/Python runtime dependencies.
Agent-Readiness Checklist
Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.
FCRS-1.0 6-Dimension Breakdown
First-class --format json / jsonl, strict non-interactive flag mapping, OPENAI_CLI_NO_UPDATE_CHECK=1 suppression, and fast Go startup.
- Global
--format jsonand--format jsonlacross all resource subcommands - Fast single-binary Go CLI with non-interactive flags
Uses standard OPENAI_API_KEY / OPENAI_ADMIN_KEY env vars cleanly, though write/create commands execute billed API calls without a --dry-run flag.
- Env-based API key isolation; direct remote API mutations incur billing
Single static Go binary available via Homebrew, go install, and GitHub releases for macOS, Linux, and Windows.
- Distributed via
brew install openai/tools/openai,go install, and releases
Full REST API coverage (responses, audio, images, batches, vector stores) plus OPENAI_BASE_URL proxy routing.
- Covers Responses, Audio, Images, Batches, Files, and Vector Stores
Official first-party openai/openai-cli repository under Apache-2.0.
- Official first-party
openai/openai-clirepo (Apache-2.0)
Self-describing --help across resources and official OpenAI CLI documentation.
- Comprehensive
--helpand official repository documentation
Security, Auth & Guardrails
Reads OPENAI_API_KEY and OPENAI_ADMIN_KEY from environment variables (with optional OPENAI_BASE_URL override).
Apache-2.0 open-source Go CLI; all API calls are billed to the configured OPENAI_API_KEY organization.
# OpenAI CLI Agent Rules - Always pass `--format json` and set `OPENAI_CLI_NO_UPDATE_CHECK=1` for clean parsing. - Confirm before running `batches create`, `files delete`, or large media generation calls, as API usage is billed immediately.
Agent-Ready Command Recipes
Safe Read-Only Queries
OPENAI_CLI_NO_UPDATE_CHECK=1 openai --format json models list
Queries available OpenAI models in strict JSON without update-check noise.
openai --format json batches list
Lists active and completed Batch API jobs in JSON format.
Controlled Writes & Previews
openai --format json responses create --model gpt-4o-mini --input "Return OK"
Executes one bounded API call and outputs the raw JSON response envelope.
Strengths for Agents
- + Fast single Go binary with
--format json/jsonlandOPENAI_BASE_URLsupport. - + Comprehensive, auto-aligned flag coverage for OpenAI REST resources.
Caveats & Pitfalls
- ! No
--dry-runflag;responses create,images,audio, andbatchesimmediately incur API charges. - ! Requires
OPENAI_CLI_NO_UPDATE_CHECK=1in strict CI/agent pipelines to prevent update notices.