DEDUPED Hot AI repos. Real use cases. What people build. Get the Monday 5

How to generate and save images from your terminal with the OpenAI CLI with OpenAI CLI

Install the official OpenAI CLI and make images with one command, saved straight to disk.

Short answer: 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. All steps.

Credentials. Your API key is billed per request; keep it in the setup guide or a secret manager, never in a script you commit.

Who it is forA developer or designer who needs a few generated images for a mockup and does not want to open a web app.

The problemGenerating an image through the API usually means writing a script just to save the file.

The outcomeImages generated from a prompt and saved to a folder, with their paths printed.

What you need first

  • 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

Steps

  1. Install with brew install openai/tools/openai
  2. Run openai help setup to enter your API key safely
  3. Run openai images generate --prompt "A tiny orange robot watering a houseplant" with your own prompt
  4. Find the files in ~/Downloads/gpt-images/, or pass --output-dir or --name to choose where they go
  5. Run openai images generate --help for editing and model selection options

Prompt for your agent

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.

Caveat.

Use this in your AI agent

Ask your agent

Using the Deduped MCP, get the setup steps for openai/openai-cli and "Generate and save images from your terminal with the OpenAI CLI"

Add Deduped to Claude Code once

claude mcp add --transport http deduped https://dedupedai.com/mcp

Cursor, ChatGPT, others

Share: X LinkedIn Hacker News Email Copy link

Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer