npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

codex-imagegen

v0.2.0

Published

Generate images through Codex's built-in image_gen tool.

Readme

codex-imagegen

codex-imagegen generates images through Codex's built-in image_gen tool.

It is designed for Claude Code workflows where Claude should trigger image generation through the locally authenticated Codex CLI. It is self-contained: it drives a fresh non-interactive codex exec session, makes the agent call image_gen exactly once, extracts the generated PNG from the session rollout, and writes it to --out.

Requirements

  • the codex CLI on your PATH, signed in via codex login (no OPENAI_API_KEY needed)
  • Node.js >= 20

Features

  • forwards prompts to Codex's image_gen tool
  • supports multiple reference images
  • extracts the image directly from the Codex session rollout (works across codex schema versions)
  • zero-dependency runtime
  • works as a standalone npm CLI and as a bundled skill

Usage

codex-imagegen --out assets/hero.png "A product render on white"
codex-imagegen --image refs/character.png --image refs/style.png "A cinematic poster"
codex-imagegen --images refs/a.png,refs/b.png --dry-run "A moody landscape study"

The final line printed to stdout is the absolute path of the written PNG (or a JSON object with --json), so it is safe to capture:

IMG=$(codex-imagegen "a red fox")

Multiple images

Use either:

  • repeated --image flags
  • a single --images flag with comma-separated or newline-separated paths

Both forms can be combined, and the wrapper preserves the order.

A note on --size

Codex's built-in image_gen tool has no size parameter. It routes to gpt-image-2-codex with size=auto and rounds output to an internal ~1.5MP budget, so requests are returned at non-standard dimensions (e.g. 1254×1254) regardless of what you ask for — this is an upstream limitation (openai/codex#28723, #19175).

--size is therefore an aspect-ratio / framing hint only (square vs landscape vs portrait comes through; exact pixels do not). If you need precise dimensions, resize the generated PNG afterward.

Environment

  • CODEX_HOME — Codex home dir (default ~/.codex)
  • IMAGEGEN_MODEL — overrides the default model (gpt-5.5)
  • IMAGEGEN_SANDBOX — overrides the default sandbox (workspace-write)
  • IMAGEGEN_TIMEOUT — overrides the default timeout (360 seconds)
  • IMAGEGEN_BYPASS=1 — same as --bypass

Testing

npm test --workspace codex-imagegen