OpenAI officially released its official command-line tool openai-cli, allowing developers to directly call the OpenAI API in the terminal without writing SDK code, significantly improving the efficiency of local development, automated scripts, and server deployment.

image.png

Project Open Source and Installation Methods

The tool is now open-sourced on GitHub under the Apache 2.0 license. Users can install it directly via Homebrew or Go for quick setup.

The tool adopts a resource-based command structure, for example:

openai responses create --input "..." --model <model>

The operation is clear and intuitive, following modern CLI tool design conventions.

Core Highlights: Full Support for Responses API and Cloud Tools

The most significant advantage of openai-cli is native support for Responses API, and it can call all built-in tools hosted by OpenAI, including:

  • Web search
  • Code interpreter
  • File retrieval
  • Image generation, etc.

This means developers can directly build and run Agent-style workflows in the command line without setting up complex environments.

Structured Output, Perfectly Compatible with Unix Pipes

The tool supports multiple structured output formats, including JSON, YAML, JSONL, pretty, raw, among others, making it easy to chain with other command-line tools through pipes. Combined with the built-in GJSON syntax, developers can quickly extract fields, similar to using jq, greatly simplifying the data processing workflow.

One-Click Completion of Multimodal Tasks

Previously, tasks requiring Python scripts to call the SDK can now be completed with a single command:

  • Image generation and image editing
  • Speech transcription (Transcription)
  • Text-to-speech (TTS)

This greatly reduces the entry barrier for multimodal AI features.

Team and Operations Friendly: Integrated Management Features

The tool also integrates project management capabilities, supporting the creation of Projects, generation, and management of API Keys, providing convenience for team collaboration and operations personnel.

File uploads use a familiar @file.ext syntax (consistent with curl), and binary content can also be passed via @data:// for base64 encoding, offering a unified and powerful user experience.

An Important Addition from SDK to Shell

For a long time, OpenAI has mainly provided SDKs in languages such as Python and Node.js. For developers who prefer the command line, DevOps engineers, and CI/CD scenarios, they could only rely on bare curl commands or self-encapsulated scripts. Now openai-cli brings SDK capabilities directly into the Shell environment, becoming an important part of automation processes, especially suitable for the rapid development and deployment of Agent-like applications.

AIbase Review: Although the release of openai-cli is positioned as a lightweight project, it fills the gap in the OpenAI official toolchain for the command line, offering developers more flexible and efficient choices. More detailed documentation is expected to be released soon and is worth continuous attention.

Developers can visit the GitHub repository openai/openai-cli to get the latest version and usage instructions.

Project URL: https://github.com/openai/openai-cli