pic-create

module
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2026 License: MIT

README

pic-create

pc is a minimal Go CLI that generates or edits images through a ChatGPT OAuth session. It reuses the login managed by Codex CLI, so it does not need an API key.

Installation

go install github.com/xingkaixin/pic-create/cmd/pc@latest

To install from a local checkout instead:

go install ./cmd/pc

Releases

Published versions use semantic version tags. Install a specific release when you need a reproducible build:

go install github.com/xingkaixin/pic-create/cmd/pc@v0.1.0

The @latest installation command tracks the newest published tag, not unreleased commits on main.

Authentication

Sign in through Codex CLI before using pc:

codex login

pc reads ~/.codex/auth.json and refreshes the OAuth session when needed. It preserves the rest of the Codex auth file when writing refreshed tokens.

Usage

pc 16:9 "A cinematic city skyline at sunset" -o ./out -n skyline
pc 2.35:1 --prompt-file prompt.txt -n banner.png
pc 9:16 prompt.txt -o ./out -n poster.png

The default model is gpt-image-2, and the default long edge is 1536 pixels. Output dimensions are scaled proportionally and aligned to multiples of 16 as required by the Image API.

Edit an Image

pc edit input.png "Replace the background with a clean white studio backdrop" -o ./out -n edited
pc edit input.png --prompt-file edit-prompt.txt --input-fidelity high -n edited.png

Edit mode reads the prompt the same way as generate mode: pass text directly, pass a path as the prompt argument, or use --prompt-file.

The ChatGPT OAuth image route currently returns PNG only. The --format compatibility option therefore accepts only png.

Development

Install the pinned Go toolchain and run the full validation suite with mise:

mise install
mise run check

Run mise tasks ls to see the available formatting, testing, linting, building, installation, and source-run tasks.

To verify the real OAuth generation and editing flow, run:

mise run smoke

The smoke test keeps both images under a new out/smoke-test.* directory for visual comparison. Pass a non-existing output directory after -- to choose the location: mise run smoke -- /tmp/pic-create-smoke.

Directories

Path Synopsis
cmd
pc command
internal
cli

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL