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

@garrepa/adapter-codex-cli

v0.0.4

Published

Community scaffold for [OpenAI Codex CLI](https://github.com/openai/codex).

Readme

@garrepa/adapter-codex-cli

Community scaffold for OpenAI Codex CLI.

This package is not first-party product. Garrepa’s supported harness is Claude Code (@garrepa/adapter-claude-code). This adapter exists so the architecture stays “one harness = one adapter package” and so the community can take Codex further without touching core.

First-party maintainers will keep the package building and tests green when shared APIs change. They will not implement Codex feature parity (MCP, git interception, richer shell parsing, safety hardening beyond what already exists).

If you want Codex to work well, this is the package to fork or send PRs against. Do not add Codex-specific types or shell parsing to @garrepa/core.

What it does today

Codex CLI has no dedicated file-read tool. The model reads files via the Bash shell tool (unified exec). This adapter uses best-effort pattern matching on the command string (cat, head, tail, …) and, on a match above threshold, denies the tool and asks the model to run garrepa summarize.

Limitations (read before using)

  • Uncommon read commands are missed (rg --passthru, awk, sed -n p, …) — they pass through.
  • Piped or chained commands are missed (cat file | grep pattern, cat file && echo done). Any shell metacharacter is a deliberate pass-through: false positives (blocking a real compound command) are worse than false negatives.
  • Quoted or space-containing paths are missed — tokenization is whitespace-only.
  • MCP, git, and safety work that lands on Claude are not ported here unless a community PR does it inside this package.

Hook mechanism

Source: Codex hooks. Shell / unified exec is Bash with tool_input.command. Older builds used exec_command and tool_input.cmd; the adapter accepts both.

  1. PreToolUse on stdin when tool_name is Bash (or legacy exec_command).
  2. Inspect tool_input.command (or legacy cmd) for a simple read pattern (parse-read-command.ts).
  3. If matched, read the file and check threshold.
  4. Deny via permissionDecision: "deny" and point at garrepa summarize when above threshold.

Config

Same garrepa.config.json as the Claude adapter. Optional Codex-only readCommands allowlist:

{
  "threshold": { "minChars": 32000 },
  "provider": { "type": "anthropic", "apiKeyEnvVar": "ANTHROPIC_API_KEY" },
  "readCommands": ["cat", "head", "tail", "less", "more", "bat", "rg"]
}

Default readCommands: cat, head, tail, less, more, bat.

Hook registration

garrepa init --harness codex-cli writes <project>/.codex/hooks.json and a skill under .agents/skills/. Community users can use that path; it is not the default init harness.

{
  "hooks": {
    "PreToolUse": [
      {
        "matcher": "^Bash$",
        "hooks": [
          { "type": "command", "command": "node /path/to/pre-tool-use-hook.js", "timeout": 30 }
        ]
      }
    ]
  }
}