What do you want to do?
3 use cases
-
Generate and save images from your terminal with the OpenAI CLI
Install the official OpenAI CLI and make images with one command, saved straight to disk.
View prompt
Install openai/openai-cli with Homebrew, run `openai help setup`, then generate <n> images for <prompt> into <folder> with `openai images generate --prompt ... --output-dir <folder>` and list the saved paths.
-
Run a batch of OpenAI requests from a JSONL file
Upload a JSONL file of requests, create a batch, wait for it and download the results.
- REPO
openai/openai-cli - Software and DevOps
- Intermediate
View prompt
Use openai/openai-cli to upload <requests.jsonl> with `--purpose batch`, create a batch on /v1/responses with a 24h window, wait for it with `openai batches wait`, and save results to ./results. Report how many requests failed.
- REPO
-
Export OpenAI models, files and usage as JSON for your scripts
List models and files as JSON or JSONL, extract fields, and pull organization usage with an admin key.
- REPO
openai/openai-cli - Software and DevOps
- Intermediate
View prompt
With openai/openai-cli, export my models and files as JSON, then pull completions usage for <date range> with the admin usage command and summarize it per day. Check exit codes before using any output file.
- REPO
Quick start with OpenAI CLI
- Check you have what it needs: An OpenAI API key (OPENAI_API_KEY); admin endpoints need OPENAI_ADMIN_KEY; Homebrew, Go 1.26 or later, or a prebuilt binary from GitHub Releases; Optional: jq for parsing JSON output.
- Open openai/openai-cli on GitHub and read the README and license.
- Install with
brew install openai/tools/openai - Run
openai help setupto enter your API key safely - Run
openai images generate --prompt "A tiny orange robot watering a houseplant"with your own prompt - Find the files in ~/Downloads/gpt-images/, or pass
--output-diror--nameto choose where they go
These steps come from our top use case, Generate and save images from your terminal with the OpenAI CLI, which also has a copy-paste agent prompt.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for openai/openai-cli
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeAbout this repo
- Who it is forDevelopers and ops people who want to script OpenAI API calls without writing an application.
- Why it is hot1.1k stars, talked about in 2 AI sources we track
- LanguageGo
- Sourcegithub.com/openai/openai-cli ยท Back to Hot repos
Requirements
- An OpenAI API key (OPENAI_API_KEY); admin endpoints need OPENAI_ADMIN_KEY
- Homebrew, Go 1.26 or later, or a prebuilt binary from GitHub Releases
- Optional: jq for parsing JSON output
Add this badge to your README
Maintain OpenAI CLI? Show readers where to find these use cases.
Markdown
[](https://dedupedai.com/use-cases/openai-openai-cli/?utm_source=github&utm_medium=badge&utm_campaign=openai-openai-cli)
HTML
<a href="https://dedupedai.com/use-cases/openai-openai-cli/?utm_source=github&utm_medium=badge&utm_campaign=openai-openai-cli"><img src="https://dedupedai.com/badge/openai/openai-cli.svg" alt="Use cases on Deduped" height="20"></a>
A static image, no tracking script. About the badge
Questions about OpenAI CLI
What is OpenAI CLI?
OpenAI CLI is the official command-line tool for the OpenAI REST API. It calls the API from your terminal or shell scripts: generate images, upload and download files, submit batches, export API data as JSON or JSONL, and read organization usage with an admin key. It is an open-source project on GitHub: https://github.com/openai/openai-cli.
How do I use OpenAI CLI?
Install with brew install openai/tools/openai; then run openai help setup to enter your API key safely; run openai images generate --prompt "A tiny orange robot watering a houseplant" with your own prompt. The use cases on this page give the full steps and a copy-paste agent prompt for each job.
Who is OpenAI CLI for?
Developers and ops people who want to script OpenAI API calls without writing an application.
What can I do with OpenAI CLI?
3 use cases so far, for example: Generate and save images from your terminal with the OpenAI CLI; Run a batch of OpenAI requests from a JSONL file; Export OpenAI models, files and usage as JSON for your scripts. Each has steps and a copy-paste agent prompt.
What do I need to run OpenAI CLI?
An OpenAI API key (OPENAI_API_KEY); admin endpoints need OPENAI_ADMIN_KEY; Homebrew, Go 1.26 or later, or a prebuilt binary from GitHub Releases; Optional: jq for parsing JSON output.
What are alternatives to OpenAI CLI?
Other hot AI repos in Software and DevOps: Deep Infer, Harness2, Orca, Opencode, Graphify.
Is OpenAI CLI safe to run?
Deduped does not own, audit or vouch for it. Read the README and license, run it on your own systems first and review every command before you run it.