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

drejx

v0.7.2

Published

CLI for [drej](https://drej.dev) — start a local OpenSandbox server, manage saved agent specs, and run/orchestrate `@drej/agent` sessions.

Readme

drejx

CLI for drej — start a local OpenSandbox server, manage saved agent specs, and run/orchestrate @drej/agent sessions.

bunx drejx init

Prefer not to run commands manually at all? pi install npm:drejx installs the drejx Pi extension, which bootstraps drejx automatically and teaches Pi its CLI syntax.


SDK — OpenSandbox config and the local spec cache

drejx init

Starts an OpenSandbox server in Docker and writes config to ~/.config/drejx/server.toml and drej.config.json.

drejx init

When using a server started this way, useServerProxy: true is written into drej.config.json automatically — sandbox containers run on Docker's bridge network and aren't reachable directly from the host.

drejx add <url> [--name <n>]

Fetches an agent spec (JSON) from a URL or local file and saves it under agentsDir (default ./agents).

drejx add https://registry.drej.dev/agents/python-data.json

drejx list

Lists saved agent specs.

drejx list

drejx remove <name>

Removes a saved agent spec.

drejx remove python-data

Agent — session lifecycle

These wrap @drej/agent's Agent.load()/Agent.resume()/Agent.attach()/Agent.spawn(). Sessions are always addressed by sandbox ID, not name — names aren't unique (running drejx spawn twice on the same spec produces two sandboxes with the same name), and a name-based lookup can hand back a sandbox that already died ungracefully. drejx spawn/drejx fork print the sandbox ID; save it.

drejx spawn <spec> [--prompt <msg>] [--rebuild] [--depth <n>] [--max <n>] [--json]

Start a brand-new, independent agent sandbox from a spec's own snapshot. This is the entry point for a fresh session — e.g. a host-level Pi session starting the master of a recursive-agent run.

drejx spawn ./agents/my-agent.json
drejx spawn ./agents/my-agent.json --prompt "Explain this repo" --json
  • --rebuild forces a full reinstall instead of restoring from the cached snapshot.
  • --depth <n> overrides the spec's own spawnDepth — see Recursive spawning below.
  • --max <n> overrides the spec's own maxAgents — see below.

drejx prompt <sandbox-id> <msg> [--spec <path>] [--json]

Send one prompt to a running sandbox and print the reply.

drejx prompt 4af65c3b-24a2-4fd1-999d-918faa9b97fd "What's in /tmp?"

--spec <path> skips the ledger lookup for the spec file — needed when the sandbox's own creation event lives in a different ledger than this CLI invocation's own (e.g. a child spawned via drejx fork from inside another sandbox).

drejx fork <name> <child-spec> [--prompt <msg>] [--depth <n>] [--max <n>] [--json]

Fork your own currently-running session's live sandbox — filesystem, installed packages, everything on disk right now — into a brand-new independent child. Meant to be run by that session's own Pi bash tool: name is the caller's own running session (used only to resolve its sandbox ID; not the child's).

drejx fork my-session ./agents/worker.json --prompt "Handle the auth module"

Unlike drejx spawn (always starts from a spec's own snapshot), drejx fork sees exactly what the calling sandbox sees right now, including uncommitted work — no install/setup steps run.

drejx agents [--json]

List running agent sessions. Cross-checks the local ledger's "Running" entries against a live query to the OpenSandbox control plane (not just the ledger, which can go stale if a sandbox died ungracefully). Also lists sandboxes running on the same server that weren't created by drejx (e.g. agent-spawned children using their own internal ledger).

drejx agents

drejx kill <sandbox-id>

Stop a sandbox.

drejx kill 4af65c3b-24a2-4fd1-999d-918faa9b97fd

drejx logs <name> [--json]

Print ledger events for a session.

drejx logs my-session

drejx --version

Print the installed version.


Recursive spawning (drejx fork)

A spec's spawnDepth is a nesting-depth budget — required for drejx fork to be allowed from inside a session at all. Each fork force-decrements it (current - 1) into the child's env; 0 means no budget left, undefined means forking was never enabled for that spec.

maxAgents is a separate, optional ceiling on total descendants for one lineage, independent of nesting depth. Unset means uncapped. Not coordinated across sibling branches spawned in parallel — it's a per-lineage counter, not a global one.

{
  "name": "orchestrator",
  "cli": "pi",
  "spawnDepth": 2,
  "maxAgents": 10
}

Pi extension

pi install npm:drejx installs the drejx extension into Pi at user scope. Once installed, any Pi session:

  • Bootstraps drejx automatically on first use (installs it, runs drejx init) — no manual setup.
  • Gets drejx spawn/drejx fork CLI syntax injected into its own guidance, dynamically chosen based on whether the current session is itself running inside a drej-managed sandbox.

The extension source lives at pi-extension/drejx.ts in this package.


Manual server setup

If you prefer not to use Docker, run the server directly with uvx:

uvx opensandbox-server

With ~/.sandbox.toml:

[server]
host = "127.0.0.1"
port = 8080

[runtime]
type = "docker"
execd_image = "opensandbox/execd:v1.0.19"

[docker]
network_mode = "bridge"

[ingress]
mode = "direct"

[egress]
mode = "dns"

With this setup, leave useServerProxy unset (defaults to false) — the server is on the host, so direct container IPs are reachable.


License

Apache 2.0