{
 "schema_version": 1,
 "generated": "2026-10-29",
 "id": "openai-openai-cli--generate-images-from-the-terminal-with-openai-cli",
 "repo": "openai/openai-cli",
 "repo_url": "https://github.com/openai/openai-cli",
 "repo_slug": "openai-openai-cli",
 "title": "Generate and save images from your terminal with the OpenAI CLI",
 "page_title": "How to generate and save images from your terminal with the OpenAI CLI with OpenAI CLI",
 "summary": "Install the official OpenAI CLI and make images with one command, saved straight to disk.",
 "who": "A developer or designer who needs a few generated images for a mockup and does not want to open a web app.",
 "problem": "Generating an image through the API usually means writing a script just to save the file.",
 "outcome": "Images generated from a prompt and saved to a folder, with their paths printed.",
 "steps": [
  "Install with `brew install openai/tools/openai`",
  "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",
  "Find the files in ~/Downloads/gpt-images/, or pass `--output-dir` or `--name` to choose where they go",
  "Run `openai images generate --help` for editing and model selection options"
 ],
 "agent_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.",
 "agents": [
  "any"
 ],
 "difficulty": "Beginner",
 "time": "10 minutes",
 "basis": "readme",
 "caveat": "",
 "category": "Software and DevOps",
 "tags": [
  "Software and DevOps"
 ],
 "lang": "go",
 "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"
 ],
 "risk": "none",
 "seen_in_the_wild": false,
 "mentioned_publicly": false,
 "risks": [
  {
   "tag": "credentials",
   "notice": "Your API key is billed per request; keep it in the setup guide or a secret manager, never in a script you commit."
  }
 ],
 "best": true,
 "score": 1.0,
 "evidence": [],
 "url": "https://dedupedai.com/use-cases/openai-openai-cli/generate-images-from-the-terminal-with-openai-cli/",
 "md": "https://dedupedai.com/use-cases/openai-openai-cli/generate-images-from-the-terminal-with-openai-cli/index.md",
 "disclaimer": "Deduped lists open-source repositories that belong to other people. We do not own, maintain, audit, or vouch for any of them, and a repo appearing here is not an endorsement or a safety check. The use cases, steps, and prompts are written by AI and may be incomplete, outdated, or just wrong. Where a use case is marked \"Seen in the wild\", we link to public posts where someone described something similar, but we have not verified those posts and the use case itself is still our AI's own write-up. Use all of this at your own risk. Only run code, commands, or agents on systems and accounts you are authorized to use, and read the code and every command before you run it, especially anything that touches credentials, files, or the network. Nothing here is professional, security, legal, or financial advice. All trademarks and project names belong to their respective owners, and their use here does not imply affiliation. Content is provided as is, without warranties of any kind. Found a mistake, a safety problem, or something you want removed? Email hello@dedupedai.com and we will look at it promptly.",
 "api": "https://dedupedai.com/api/v1/usecases/openai-openai-cli--generate-images-from-the-terminal-with-openai-cli.json",
 "api_version": "v1"
}
