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

@hatanakahiroki/code-x-cli

v0.1.30

Published

Mac helper installer for Remote Code X.

Downloads

2,220

Readme

Code X CLI

Fresh Mac setup:

Paste the setup command shown in the iPhone app into Terminal. It starts with macOS built-in bash/curl, installs Node.js into ~/.codex-remote/node only when missing, installs Codex CLI and Code X into ~/.codex-remote/npm-global, then opens the QR.

/bin/bash -lc 'set -e; export RCX_CLOUD_RELAY_URL="https://remote-code-x-relay-hh.fly.dev"; RCX_HOME="$HOME/.codex-remote"; NODE_HOME="$RCX_HOME/node"; NPM_PREFIX="$RCX_HOME/npm-global"; mkdir -p "$RCX_HOME" "$NPM_PREFIX"; RCX_PATH_LINE="export PATH=\"\$HOME/.codex-remote/npm-global/bin:\$HOME/.codex-remote/node/bin:\$PATH\""; for f in "$HOME/.zprofile" "$HOME/.zshrc"; do touch "$f"; if ! grep -Fq ".codex-remote/npm-global/bin" "$f"; then printf "\n# Remote Code X\n%s\n" "$RCX_PATH_LINE" >> "$f"; fi; done; export PATH="$NPM_PREFIX/bin:$NODE_HOME/bin:/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin"; if command -v code-x >/dev/null 2>&1; then echo "Opening Code X..."; exec code-x; fi; echo "Remote Code X setup"; echo "-------------------"; if ! command -v node >/dev/null 2>&1 || ! command -v npm >/dev/null 2>&1; then arch="$(uname -m)"; case "$arch" in arm64) node_arch="arm64" ;; x86_64) node_arch="x64" ;; *) echo "Unsupported Mac CPU: $arch"; exit 1 ;; esac; node_ver="v22.20.0"; node_pkg="node-$node_ver-darwin-$node_arch"; tmp="$(mktemp -d)"; echo "Installing Node.js to $NODE_HOME..."; curl -fL "https://nodejs.org/dist/$node_ver/$node_pkg.tar.gz" -o "$tmp/node.tgz"; rm -rf "$NODE_HOME"; mkdir -p "$NODE_HOME"; tar -xzf "$tmp/node.tgz" -C "$NODE_HOME" --strip-components=1; rm -rf "$tmp"; export PATH="$NODE_HOME/bin:$PATH"; else echo "Node.js/npm already installed."; fi; npm config set prefix "$NPM_PREFIX" >/dev/null; export PATH="$NPM_PREFIX/bin:$PATH"; echo "Installing/updating Codex CLI..."; npm install -g --prefix "$NPM_PREFIX" @openai/codex@latest; echo "Installing Code X..."; npm install -g --prefix "$NPM_PREFIX" --force @hatanakahiroki/code-x-cli; hash -r 2>/dev/null || true; if ! command -v code-x >/dev/null 2>&1; then echo "Code X installed. Open a new Terminal, then run: code-x"; exit 1; fi; echo "Opening QR..."; exec code-x'

This does not require Homebrew. If Homebrew already exists, that is fine, but Code X does not depend on it for first setup.

If Node.js/npm already exists, this shorter command also works:

npm install -g --force @hatanakahiroki/code-x-cli && code-x

After setup, reopen the QR screen with:

code-x

The setup command immediately opens code-x when it is already installed. On a new Mac, Node.js, Codex CLI, and the helper are installed only when missing. If an old remote-code-x-cli command exists from a previous build, the installer avoids the system global path and installs into the Remote Code X user directory.

The installer starts the Remote Code X Mac services, connects to the stable outside-home relay, and prints one pairing QR for the iPhone app.

Normal mode keeps iPhone access ON while the Terminal window stays open. Close the Terminal window to stop access. While access is ON, Code X keeps the Mac awake so Wi-Fi and outside-home access do not stop during idle sleep. The display may still lock or turn off.

The QR can save both:

  • a local same-Wi-Fi relay URL
  • a stable HTTPS relay URL for outside-home access

After the first setup, code-x reopens the same setup and QR screen. If the same Terminal still says command not found, open a new Terminal window or run source ~/.zshrc.

If you intentionally want it to keep running after Terminal closes:

code-x background

Stop iPhone access to this Mac:

code-x stop

Check whether it is running:

code-x status

Check the installed helper version:

code-x --version

Made by HatanakaHiroki / Hiro no Piano no Heya.