hn.today

OpenAI CLI

github.com119 points70 comments
Screenshot of OpenAI CLI

This is the official command-line client for the OpenAI REST API, provided as a GitHub repository with installation via Homebrew or go install, and runnable locally through a provided script. It exposes a resource-based command structure (openai subresource... flags) with separate authentication for standard API calls (OPENAI_API_KEY) and admin endpoints (OPENAI_ADMIN_KEY). The CLI includes extensive built-in help that works offline, tab completion, optional command insertion, and update-notice checks (disabled via OPENAI_CLI_NO_UPDATE_CHECK). Repository artifacts include docs, tests, changelog, contribution and security guidance, and release configuration.

Functionally it supports responses, file management, and image workflows with sensible defaults and scripting-friendly output. Files can be uploaded with a purpose, inspected, and downloaded by ID; images generated with prompts are saved (default model gpt-image-2.5-sunburst) to ~/Downloads/gpt-images/ unless overridden, images edit replaces the retired create-variation flow, and preview reopens saved images without an API call. JSON, JSONL, raw and YAML outputs are supported and readable by default; error reporting prints actionable summaries with an option to emit full error envelopes (format-error json). Global flags and environment variables control org/project, mTLS, webhook secrets, debug logging, and base URL for alternate backends.

Read on github.com70 comments on Hacker News

Summary generated by AI from the linked article. hn.today is not affiliated with Hacker News or Y Combinator.

More in AI

The daily digest

Today's best Hacker News stories, summarized and screenshotted, one email a day.