Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@procedures/shell

Latest version: v0.68.17

Overview

Last scanned
29 Nov 2026
Published
29 Nov 2026
npm package Publisher: mark1russell7
0 Stars
0 Forks
123 Versions
41.2K Downloads
TypeScript Repo language

Scan summary

@procedures/shell was last scanned on 29 Nov 2026 at version 0.68.17. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 123 versions; the latest 5 were published within 4 days (26–29 Nov 2026).
  • Findings: No rules fired in version 0.68.17.
  • Downloads: 41,233 downloads.

Versions

123 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.68.17 LATEST 29 Nov 2026 No rules fired
0.68.16 29 Nov 2026 No rules fired
0.68.15 28 Nov 2026 No rules fired
0.68.14 26 Nov 2026 Not shown
0.68.13 26 Nov 2026 Not shown

No rules fired in 0.68.17

Findings

Findings for v0.68.17. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 0.68.17; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@procedures/shell

npm

npm install @procedures/shell

License: MIT TypeScript Node.js

Generic shell command execution procedures - the foundation layer for all CLI wrapper packages in the Mark ecosystem.

Table of Contents

  • Overview
  • Installation
  • Architecture
  • Quick Start
  • API Reference
    • shell.run
    • shell.exec
    • shell.which
  • Use Cases
  • Cross-Platform Notes
  • Integration
  • Requirements
  • License

Overview

client-shell provides low-level shell command execution as RPC procedures:

  • shell.run - Spawn processes with arguments (no shell interpretation, safer)
  • shell.exec - Execute command strings via shell (supports pipes, redirects)
  • shell.which - Find command paths cross-platform
  • shell.stream - Run a command with arguments, and give each output line while it runs

This package is the foundation for all CLI wrapper packages.

Command helpers

The wrapper packages start their programs with the helpers of @procedures/shell/command. This entry point registers no procedures.

Helper What it does
runCommand(command, options) It runs a program to its end and gives exitCode, stdout, stderr and duration. It does not throw.
streamCommand(command, options) It gives each output line while the program runs, then an exit item. Its input is text, bytes or a stream for stdin.
createLineSplitter(options) It splits chunks of output into lines, as streamCommand does, for a caller with its own pipes. It has no I/O.
processes It records a long-running program: start, list, waitFor, output, subscribe, follow, stop.
killTree(child) It kills a child process and all the processes that it started.
spawnProgram(command, args, options) It starts a program that the caller keeps, for example a detached process with files as its standard input and output. It takes the options of spawn of Node, without shell, and it gives the child.
spawnProgramSync(command, args, options) It starts a program and waits for its end, as spawnSync of Node does.
execProgramSync(command, args, options) It starts a program, waits for its end and gives its standard output, as execFileSync of Node does. It throws when the program fails, with the fields status, signal, stdout and stderr.
execProgram(command, args, options) It starts a program and gives a promise of its standard output and standard error, as the promise form of execFile of Node does. The promise fails when the program fails, passes its timeout or writes more than maxBuffer.

The rules of the helpers:

  • A helper passes the arguments as a list. No shell reads them.
  • The timeout and the signal kill the whole process tree. Windows uses taskkill /T /F. The other systems use a process group.
  • Each output stream has a limit (maxOutputBytes, 64 MiB by default). The helper keeps the first bytes, or the last bytes with keep: "tail".
  • A program without an input gets an empty stdin.
  • streamCommand pipes an input stream to stdin. The end of the stream ends stdin. The helper does not destroy the stream.
  • A line ends at \n or \r\n. A line longer than maxLineLength comes out in parts.
  • When the reader of streamCommand is slow, the helper stops reading the pipes, so the program waits.
  • When the host ends, the helpers kill each child that still runs. spawnProgram and spawnProgramSync do not record the child, so the caller decides when it stops.
  • On Windows, a program name with no folder starts only from a folder of PATH, not from the working folder. So a git.exe in a cloned repository does not start when a tool runs git in its folder. When no folder of PATH has the program, the start fails with ENOENT.
  • Only this package starts programs in the repository of the procedures. The import rule program-start-outside-shell fails each other package that imports node:child_process. An import of the types is permitted.
import { runCommand } from "@procedures/shell/command";

const result = await runCommand("git", { args: ["status", "--porcelain"], cwd, signal: ctx.signal });
The output of a recorded process

processes.output(id) gives the end of the output that the registry keeps: the last 64 KiB. Two functions give the output that comes later:

Function What it does
subscribe(id, { output, end }) output gets each new piece with its stream (stdout or stderr) and its bytes. end gets the record at the end of the process. The result removes the subscriber.
follow(id, { backlog, signal, maxBufferedBytes }) It gives an async stream of items: backlog, output, dropped and the last item end.
  • The end of the process removes each subscriber, so a subscriber of an ended process does not stay.
  • follow subscribes when the reader asks for the first item. The end of the process, an abort of signal and a reader that stops end the stream and remove its subscriber.
  • With backlog: true, the first item has the kept output. The kept output and the new output have no gap between them.
  • follow decodes UTF-8 for each stream, so a character in two pieces stays whole.
  • The registry cannot slow the process. When more than maxBufferedBytes (1 MiB by default) wait for a slow reader, follow drops the oldest pieces and gives a dropped item with the number of bytes.
import { processes } from "@procedures/shell/command";

for await (const item of processes.follow(id, { backlog: true, signal: ctx.signal })) {
  if (item.type === "output") process.stdout.write(item.text);
}

Installation

npm install @procedures/shell

Since 0.2.0, an import of the package registers nothing. To register its procedures in the global registry:

import "@procedures/shell/register";

Architecture

System Overview
graph TB
    subgraph "Application Layer"
        App[Your Application]
    end

    subgraph "client-shell"
        Run[shell.run<br/>Spawn with args]
        Exec[shell.exec<br/>Shell string]
        Which[shell.which<br/>Find command]
    end

    subgraph "Node.js"
        Spawn[child_process.spawn]
        ExecFn[child_process.exec]
        WhichFn[which / where]
    end

    subgraph "Output"
        Result[exitCode, stdout, stderr,<br/>success, duration]
    end

    App --> Run
    App --> Exec
    App --> Which
    Run --> Spawn
    Exec --> ExecFn
    Which --> WhichFn
    Spawn --> Result
    ExecFn --> Result
Command Execution Flow
sequenceDiagram
    participant App as Application
    participant Shell as client-shell
    participant Node as Node.js
    participant OS as Operating System

    App->>Shell: shell.run({ command: "git", args: ["status"] })
    Shell->>Shell: Validate input
    Shell->>Node: spawn("git", ["status"], options)
    Node->>OS: Execute process
    OS-->>Node: stdout, stderr, exitCode
    Node-->>Shell: Process result
    Shell->>Shell: Build output
    Shell-->>App: { success, stdout, stderr, exitCode, duration }
Dependency Tree
graph TB
    subgraph "CLI Wrapper Packages"
        CLI[client-cli]
        Pnpm[client-pnpm]
        Git[client-git]
        Docker[client-docker]
        Vitest[client-vitest]
        Cue[client-cue]
    end

    subgraph "Foundation"
        Shell[client-shell]
    end

    subgraph "Core"
        Client[client]
    end

    CLI --> Shell
    Pnpm --> Shell
    Git --> Shell
    Docker --> Shell
    Vitest --> Shell
    Cue --> Shell
    Shell --> Client

Quick Start

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/shell/register"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));

// Run a command with arguments
const result = await client.exec(["shell", "run"], {
  command: "git",
  args: ["status", "--short"],
  cwd: "/path/to/repo",
});

console.log(result.stdout);
// M  src/index.ts
// ?? new-file.ts

API Reference

Procedures Summary
Path Description
shell.run Spawn process with arguments (no shell)
shell.exec Execute command string through shell
shell.which Find full path to a command

shell.run

Spawn a process directly without shell interpretation. Safer for untrusted input.

interface ShellRunInput {
  command: string;              // Command to run
  args?: string[];              // Arguments (default: [])
  cwd?: string;                 // Working directory
  env?: Record<string, string>; // Environment variables
  timeout?: number;             // Timeout in ms
  encoding?: string;            // Output encoding (default: "utf8")
}

interface ShellRunOutput {
  exitCode: number;
  stdout: string;
  stderr: string;
  success: boolean;  // true if exitCode === 0
  duration: number;  // ms
}

Example:

await client.exec(["shell", "run"], {
  command: "npm",
  args: ["install", "--save-dev", "typescript"],
  cwd: "/my/project",
  timeout: 60000,
});

shell.exec

Execute a command string through the system shell. Supports pipes, redirects, etc.

interface ShellExecInput {
  command: string;              // Full command string
  cwd?: string;                 // Working directory
  env?: Record<string, string>; // Environment variables
  timeout?: number;             // Timeout in ms
  shell?: boolean | string;     // Shell to use (default: true)
  maxBuffer?: number;           // Max stdout/stderr buffer
  stdin?: string;               // Input to pipe to stdin
}

interface ShellExecOutput {
  exitCode: number;
  stdout: string;
  stderr: string;
  success: boolean;
  duration: number;
  signal?: string;  // Signal that terminated process
}

Example:

await client.exec(["shell", "exec"], {
  command: "git log --oneline | head -5",
  cwd: "/my/repo",
});

shell.which

Find the full path to a command. Uses where on Windows, which on Unix.

interface ShellWhichInput {
  command: string;  // Command to find
}

interface ShellWhichOutput {
  path: string | null;  // Full path or null if not found
  found: boolean;
}

Example:

const { path, found } = await client.exec(["shell", "which"], {
  command: "node",
});
// { path: "/usr/local/bin/node", found: true }

Use Cases

Building CLI Wrappers

A CLI wrapper package (gh, npm, pnpm, docker, cli.run) defines its runner with defineCliTool() of @procedures/shell/cli. Each command goes as an argument list to shell.run, through ctx.client, so the host applies its rules to the nested call. packages/documentation/SERVER-LAYERS.md ("The run path of a CLI wrapper") gives the reasons.

import { cliToolOutputSchema, defineCliTool } from "@procedures/shell/cli";

const docker = defineCliTool({ name: "docker" });

// In a handler: a value that starts with "-" is refused, and no shell runs
const result = await docker.run(["ps", "--filter", docker.arg("filter", input.filter)], { cwd: input.cwd }, ctx);
// result: { exitCode, stdout, stderr, success, duration }, the shape of cliToolOutputSchema("docker")
  • run and runJson give a failed result and do not throw. output and json throw the error of the tool.
  • resolve finds the program at each command. nodeScript(), execPathProgram() and findInPath() help to find a script of a .cmd file.
  • buildArgv(), parseJsonDocument() and parseJsonOutput() build an argv and read JSON output.

The tests of a wrapper use fakeShell(results) of @procedures/shell/testing:

import { fakeShell } from "@procedures/shell/testing";

const shell = fakeShell([{ stdout: "[]" }, { exitCode: 1, stderr: "not found" }]);
const registry = createRegistry(shell.module, dockerModule); // the first module of a name counts
// or, for a handler that a test calls directly: { client: shell.client }
expect(shell.args()).toEqual(["ps"]);
Checking Command Availability
async function ensureGitAvailable() {
  const { found } = await client.exec(["shell", "which"], { command: "git" });
  if (!found) {
    throw new Error("Git is not installed or not in PATH");
  }
}
Piping Commands
// Using shell.exec for pipes
const result = await client.exec(["shell", "exec"], {
  command: "cat package.json | jq '.dependencies'",
  cwd: "/my/project",
});

Cross-Platform Notes

shell.which Behavior
graph LR
    subgraph "Unix/macOS"
        UnixWhich["which command"]
    end

    subgraph "Windows"
        WinWhere["where command"]
    end

    subgraph "Result"
        Path["/usr/bin/git<br/>or C:\\Program Files\\Git\\bin\\git.exe"]
    end

    UnixWhich --> Path
    WinWhere --> Path
shell.run vs shell.exec

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @procedures/shell

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Microsoft's Official agent framework Hijacked
AI & VibeSec

BREAKING: Hijacked Releases of Microsoft’s Official agent-framework Steals Azure and CI Credentials

Copy of Template Design OX Blog (1)
Research

Thousands Of GitHub Accounts Hijacked With wfx-loot CI Secret Stealing Malware Via GitHub Actions & npm

Frame 2085668439 (1)
Group 1261154229