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-relay-agent

v0.10.0

Published

Connect a macOS or Linux Codex machine to a self-hosted Codex Relay.

Readme

Codex Relay Agent

Connect a macOS or Linux machine running Codex CLI to your self-hosted Codex Relay. The connection is outbound-only, so the machine does not need a public IP or an open inbound port.

The Agent also provides workspace helpers for directory browsing, Git branch discovery, isolated worktree creation, and authenticated streaming of local artifacts referenced by Codex Markdown.

Artifact serving is constrained to regular files inside workspaces already opened by the active Codex app-server session. Files are streamed on demand through Relay with HTTP Range support and are not stored on the Relay host.

Requirements

  • macOS or Linux
  • Node.js 20 or newer
  • Codex CLI installed and already authenticated for the current user
  • A Relay URL, machine ID, and matching agent token

Verify Codex first:

codex --version
codex app-server --help

Install as a user service

Run this as the same OS user that is logged in to Codex:

npx codex-relay-agent install \
  --relay https://relay.example.com \
  --token 'your-machine-token' \
  --machine-id work-mac \
  --name 'Work Mac'

To avoid putting the token in shell history, set AGENT_TOKEN in the environment and omit --token.

The installer creates a per-user service:

  • macOS: ~/Library/LaunchAgents/com.codex-relay.agent.plist
  • Linux: ~/.config/systemd/user/codex-relay-agent.service

No sudo is required or recommended. Keeping the service under the current user ensures it can access that user's Codex authentication and workspaces.

Commands

npx codex-relay-agent doctor
npx codex-relay-agent status
npx codex-relay-agent@latest restart
npx codex-relay-agent uninstall

Run in the foreground without installing a service:

npx codex-relay-agent run --relay https://relay.example.com --token 'your-machine-token'

Use npx codex-relay-agent --help for all options, including proxy and private CA configuration.

Automatic updates

Services installed by version 0.5.2 or newer check npm after connecting and then about every six hours. The Agent verifies npm's integrity hash, syntax-checks the downloaded runtime, atomically replaces it, and lets launchd/systemd restart the process. If the replacement fails to become healthy three times, the previous runtime is restored automatically. Update progress and errors appear beside the machine in Relay.

Set --auto-update false (or AUTO_UPDATE=false) to opt out. A private npm-compatible registry can be selected with --update-registry <url>.

Linux notes

The installer uses a systemd user service. On a desktop it runs while the user session is active. To keep it running after logout, an administrator may enable lingering for that user:

sudo loginctl enable-linger "$USER"

Upgrade

Upgrade the Codex CLI used by the installed service, then restart that service:

npx codex-relay-agent@latest upgrade-codex --dry-run
npx codex-relay-agent@latest upgrade-codex
# npm installations can also select an exact Codex version:
npx codex-relay-agent@latest upgrade-codex --version 0.111.0

Run as the service owner, without sudo. Supports global npm installations (including custom Node prefixes) and Homebrew on macOS. The command reads the existing service configuration, preserves the machine ID, token and workspace settings, and verifies codex --version and codex app-server --help before restarting. Upgrade or verification failure prevents the restart; custom/manual Codex installations are rejected with instructions rather than silently replaced. A failed package-manager operation may still have changed the installation; inspect its output before retrying.

Restarting interrupts active tasks and reconnects the machine. Run it after tasks finish. This upgrades Codex only, not the Agent runtime; Agent automatic updates remain separate. restart can also be used after manually upgrading Codex.

Agents older than 0.5.2 need one final manual install with the same machine ID and configuration. After that, verified stable releases are installed automatically unless automatic updates are disabled.