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

@grackle-ai/runtime-codex

v0.145.0

Published

Grackle OpenAI Codex runtime implementation

Readme

@grackle-ai/runtime-codex

Grackle runtime that drives OpenAI's Codex agent.

Overview

This package implements the AgentRuntime interface from @grackle-ai/runtime-sdk by wrapping OpenAI's Codex SDK (@openai/codex-sdk), which in turn drives the Codex CLI. The exported CodexRuntime is registered with the PowerLine runtime registry under the name codex, so tasks can run against Codex anywhere PowerLine runs (Docker, local, SSH, Codespace).

When a session starts, the runtime creates a Codex thread, runs the prompt with runStreamed(), and translates the SDK's thread events into Grackle's normalized agent event stream (text, reasoning, tool use/results, usage, and errors). It supports multi-turn conversations, follow-up input, resuming a previous thread, MCP servers, and maxTurns enforcement.

Configuration

All configuration is supplied via environment variables so the runtime behaves identically across every environment type.

| Variable | Required | Description | | ----------------- | -------- | ------------------------------------------------------------------ | | OPENAI_API_KEY | yes* | OpenAI API key. Read automatically by the Codex SDK. | | CODEX_API_KEY | no | Explicit API-key override; takes precedence over OPENAI_API_KEY. | | OPENAI_BASE_URL | no | Custom base URL for the OpenAI API. | | CODEX_CLI_PATH | no | Path to the Codex CLI binary, overriding default PATH resolution. |

* Either OPENAI_API_KEY or CODEX_API_KEY must be set. If neither is present, Codex returns no messages and the session reports an authentication error.

Threads are created with full filesystem access (sandboxMode: "danger-full-access"), no approval prompts (approvalPolicy: "never"), and the git-repo check skipped, since the agent runs inside an already-isolated Grackle environment. The working directory and model are set per session from the spawn options; system context is injected as Codex developer_instructions, and MCP servers are translated into Codex's mcp_servers config.

Models

The model is selected per session from the spawn options and passed straight through to the Codex thread. When no model is specified, the Codex SDK / CLI default is used. This package does not pin or restrict the model list — any model your installed Codex CLI accepts is valid.

Credentials

Codex authenticates with an OpenAI API key, resolved in this order:

  1. CODEX_API_KEY (explicit override)
  2. OPENAI_API_KEY (read automatically by the SDK)

Grackle delivers these credentials to the PowerLine over the gRPC connection at task start, so nothing needs to be baked into the environment image.

Requirements

  • Node.js >= 22
  • The Codex CLI installed and available on PATH (or set CODEX_CLI_PATH)
  • An OpenAI API key (OPENAI_API_KEY or CODEX_API_KEY)

The @openai/codex-sdk package is installed lazily on first use into an isolated per-runtime directory, so it does not need to be a direct dependency of your project.

License

MIT