FGEN

Terminal image generation / CLI + TUI

FGEN
HELP.

Generate images from your own ChatGPT subscription, straight from the terminal. fgen and fuckinggen are the same program, with a CLI and a real TUI.

fgen / help
$ fgen gen "a red square on white"
→ ~/Downloads/a-red-square-on-white.png

$ fgen -t
Interactive prompt, references, image grid, history, and save checklist.

01Install

Install the published binary for your platform, then run fgen auth. The release archives contain both fgen and fuckinggen, which invoke the same CLI.

macOS

Homebrew is the supported package-manager path. Manual Apple silicon and Intel archives are available from the latest release.

brew tap prophesourvolodymyr/fuckinggen
brew install fuckinggen

Linux / AUR

Arch users can install the AUR package. Linux users can also use Homebrew or build from source; the current release page does not publish a Linux archive.

yay -S fgen

Windows

Download the latest x86_64 Windows GNU zip, extract it to a permanent folder, and add that folder to your user PATH.

$release = Invoke-RestMethod "https://api.github.com/repos/prophesourvolodymyr/fuckinggen/releases/latest"
$asset = $release.assets | Where-Object name -Like "*-x86_64-pc-windows-*.zip" | Select-Object -First 1
Invoke-WebRequest $asset.browser_download_url -OutFile "$env:TEMP\fgen.zip"
Expand-Archive "$env:TEMP\fgen.zip" -DestinationPath "$env:LOCALAPPDATA\fgen" -Force
$bin = (Get-ChildItem "$env:LOCALAPPDATA\fgen" -Filter fgen.exe -Recurse | Select-Object -First 1).DirectoryName
$env:Path += ";$bin"
[Environment]::SetEnvironmentVariable("Path", [Environment]::GetEnvironmentVariable("Path", "User") + ";$bin", "User")
fgen --version

From source

Build and install with Cargo when a package or release archive is not the right fit.

cargo install --git https://github.com/prophesourvolodymyr/fuckinggen --locked

Existing files are never overwritten: a requested name becomes thing-v2.png, then thing-v3.png, and so on.

02Auth

fgen reads the ChatGPT OAuth token already stored by Codex. It does not ask for or use an OpenAI API key, and it does not log in to a separate service.

codex login
fgen auth

Run fgen auth to see token, account, and expiry status. If the status is invalid, log in with codex login and check again.

03CLI usage

Positional prompts and --prompt are both accepted. A single prompt writes to ~/Downloads by default; use --out or --out-dir to choose the destination.

fgen gen "a red square on white"
fgen gen "poster" --out ~/Desktop/poster.png
fgen gen "prompt" --quality high
fgen last -n 5
fgen --help
CommandPurpose
fgen gen [PROMPT...]Generate one or more images.
fgen tuiOpen the interactive terminal interface. fgen -t is the short form.
fgen last -n NList recent generations, newest first.
fgen authShow the status of the existing ChatGPT OAuth credential.
--out PATHSave one prompt to an exact path, or use a directory to keep the prompt-derived filename.
--out-dir DIRSave generated files in a chosen directory.
--quality QRequest low, medium, high, or auto quality.
--size auto|WxHRequest dimensions; the backend may choose the final dimensions.

04Batch jobs

Pass multiple prompts to one gen command. --concurrency controls how many jobs run at once, while --out-dir keeps the outputs together.

fgen gen "poster A" "poster B" --out-dir ./assets --concurrency 2

Progress reports each job and prints the resulting path. Add --json when another process should consume structured events instead of terminal prose.

05References and edits

Use --images (or repeat --image) to attach one or more local PNG, JPEG, WebP, or GIF references to every prompt. Use --last to attach a recent generation without finding its path.

fgen gen "recolor the square to blue" --images red-square.png --out blue.png
fgen gen "make it blue" --last
fgen gen "keep going" --last 2

Reference files are sent with the generation request. Follow-up edits keep the selected image in context; use a fresh prompt when you do not want that image attached.

06JSON output

Machine-readable mode writes JSON Lines progress events for agents and scripts. Events include the start, generation phase, saved path and final summary.

fgen gen "hero shot" --json
{"event":"start",...}
{"event":"phase","phase":"generating",...}
{"event":"saved","path":"/…/hero-shot.png","bytes":912344,...}
{"event":"summary","ok":true,...}

07Rich TUI

Open fgen tui or fgen -t for a prompt bar, references strip, square image grid, history, save checklist and command palette.

Prompt and refs.

Press Enter to generate. Shift+Enter adds a line. Drag or paste image paths to attach references; a path never starts a generation accidentally.

Grid and controls.

Generations occupy square cells. Up enters the grid, left and right walk it, and Down loads the selected prompt back into the prompt bar.

Image actions.

Keep, remove, regenerate, cut out the background, copy the prompt, or begin a fresh prompt from the selected image.

Commands.

Type / for the palette. Useful commands include /open, /view, /save, /history, /ctx, /settings, and /help.

The first run includes a four-page tour; /guide opens it again. The terminal title reflects the prompt, active rendering, or keep checklist.

08History and cache

Finished generations are remembered newest first, capped at 50, in ~/.local/state/fuckinggen/state.json. That state powers --last and fgen last.

The TUI stages output in a scratch cache and starts empty. Unkept files are removed after 24 hours, so a session does not silently become a permanent image archive.

ctrl-c        # open the keep/discard checklist
ctrl-c ctrl-c # quit and leave staged files in the cache
enter         # keep the selected gallery image

Tick images with Space and press Enter to save them to the current directory (or ~/Downloads after /root). Unticked images are deleted. Existing files use never-overwrite naming.

09Configuration

The TUI settings command cycles the theme, quality and login flow. The default save directory can also come from FUCKINGGEN_OUT_DIR; the CLI quality and size flags remain per-command requests.

fgen gen "prompt" --quality low
fgen gen "prompt" --size 1024x1024
FUCKINGGEN_OUT_DIR=./images fgen gen "prompt"

Quality and size are requests to the backend. The backend may choose final dimensions.

10Agent skill

The repository ships gpt-image-gen-latest, an agent skill that teaches an agent when and how to call fgen for text-to-image, reference edits, follow-ups, batch jobs, progress and TUI work.

./install.sh
sudo bash /usr/share/fgen/install.sh --skills-only
bash "$(brew --prefix fuckinggen)/share/fgen/install.sh" --skills-only

The repository installer builds and installs both binaries, then copies the skill into detected agent skill directories. Package installs can use --skills-only: AUR ships it under /usr/share/fgen, and Homebrew ships it under its share directory. On Windows, copy skills\gpt-image-gen-latest from the release zip into your agent's skills folder; the installer script is Bash-only.