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-exec-json

v0.1.2

Published

Run Codex exec in non-persistent mode and write structured JSON output to a temp file

Readme

codex-exec-json

This is a tiny wrapper around codex exec. It runs a one-shot, non-interactive Codex task, forces a JSON-shaped final answer, writes that JSON to a file, prints the file path, and exits. It is meant for agents and automations that want a predictable machine-readable output and no long-lived session.

Install / npx

npx -y codex-exec-json "summarize this repo"

Usage

codex-exec-json [options] <prompt...>

Options are --schema <json> for an inline JSON schema string, --schema-file <path> to load a schema from disk, --out <path> to control the output file path (default is /tmp/.codex-exec.<uuid>.json), --model <name> to select a model, --reasoning <level> to set reasoning effort, --codex-bin <path> to point at a different Codex binary, --yolo to bypass approvals and sandboxing, --keep-trace to keep Codex session files, --models to print available models, --models-json to print models as JSON, and --help to show usage.

Pass through args to Codex after --:

codex-exec-json -- --add-dir /tmp "update the README"

For LLMs and agents

The point is to return a JSON file and exit. Treat stdout as the file path and read the JSON from disk.

npx -y codex-exec-json --schema '{"type":"object","properties":{"summary":{"type":"string"},"next":{"type":"array","items":{"type":"string"}}},"required":["summary","next"]}' "Summarize and list next steps"

Example flow:

OUT=$(npx -y codex-exec-json "Describe the repo in JSON")
cat "$OUT"

By default the tool deletes any new Codex session files created during the run. Use --keep-trace if you want to keep those files.

Models and reasoning levels

To list available models and their supported reasoning levels with descriptions, run:

npx -y codex-exec-json --models

For JSON output:

npx -y codex-exec-json --models-json

This uses a built-in preset list that matches Codex’s own defaults, no API calls required.

Default schema

If no schema is provided, this default is used, so you always get a predictable JSON object:

{
  "type": "object",
  "additionalProperties": false,
  "properties": {
    "ok": { "type": "boolean" },
    "result": { "type": "string" },
    "error": { "type": "string" }
  },
  "required": ["ok", "result"]
}

Skill

If you use the Codex skills format, a ready-to-pull skill is included at skills/codex-exec-json/SKILL.md.