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

pty-to-stdio

Latest version: v0.9.0

Overview

Last scanned
25 Nov 2026
Published
25 Nov 2026
npm package Publisher: brusdeylins
0 Stars
0 Forks
2 Versions
TypeScript Repo language

Scan summary

pty-to-stdio was last scanned on 25 Nov 2026 at version 0.9.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 2 versions, all published on 25 Nov 2026.
  • Findings: No rules fired in version 0.9.0.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
0.9.0 LATEST 25 Nov 2026 No rules fired
0.0.0-stage 25 Nov 2026 Not shown

No rules fired in 0.9.0

Findings

Findings for v0.9.0. 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.9.0; other versions have their own rules, not their own score.

README

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

PTY-to-Stdio

Bridge a program in a pseudo-terminal to standard input/output

github (author stars) github (author followers)

Abstract

This is a small Command-Line Interface (CLI) for conveniently running an interactive program, like the AI agent harness CLIs Claude Code, Codex, or Copilot, in a pseudo-terminal (PTY) and bridging this pseudo-terminal to plain standard input/output pipes. It allows a Node.js application to host interactive terminal programs without depending on the native addon node-pty itself: the application just spawns npx -y pty-to-stdio -- <command> [<arg> ...] as an ordinary child process and talks to it over its pipes.

The PTY-to-Stdio program runs the given command in a pseudo-terminal of the given initial size, in the given working directory and with its own environment (see Environment below), copies the raw output of the pseudo-terminal to standard output, reads framed input data and resize requests from standard input (see Protocol below), and terminates with the exit status of the command.

Installation

$ npm install -g pty-to-stdio

Usage

Usage: pty-to-stdio [options] -- <command> [<arg> ...]

Bridge a program in a pseudo-terminal to standard input/output

Options:
  -V, --version     show program version information
  -c, --cols <n>    initial terminal columns (default: "80", env: COLS)
  -r, --rows <n>    initial terminal rows (default: "24", env: ROWS)
  -d, --cwd <dir>   working directory of the command (default: ".")
  -h, --help        show this usage help

Example:
  $ npx -y pty-to-stdio \
      --cols 120 \
      --rows 40 \
      --cwd  ~/project \
      -- \
      claude --continue

Protocol

  • Standard Output carries the raw output of the pseudo-terminal, unchanged and without any framing.

  • Standard Input carries a sequence of frames, so that input data and control messages never mix. Each frame consists of a 1-byte type, a 4-byte unsigned big-endian payload length (at most 1 MiB), and the payload:

    • type i (0x69): input data, passed unchanged to the pseudo-terminal
    • type r (0x72): resize, a payload of the 2-byte columns and the 2-byte rows, both unsigned big-endian

    Any other frame is a protocol violation, which kills the command and terminates with exit status 1.

  • Closing Standard Input hangs up the pseudo-terminal: the command receives SIGHUP and, if it is still running after 5 seconds, SIGKILL. The signals SIGHUP, SIGINT, and SIGTERM received by PTY-to-Stdio itself are passed on to the command.

  • Exit Status is the one of the command, resp. 128 plus the number of the signal which terminated it.

Example (Node.js):

import { spawn } from "node:child_process"

const frame = (type, payload) => {
    const head = Buffer.alloc(5)
    head.writeUInt8(type.charCodeAt(0), 0)
    head.writeUInt32BE(payload.length, 1)
    return Buffer.concat([ head, payload ])
}

const child = spawn("npx", [ "-y", "pty-to-stdio", "--", "bash" ],
    { stdio: [ "pipe", "pipe", "inherit" ] })
child.stdout.on("data", (data) => { process.stdout.write(data) })
child.stdin.write(frame("i", Buffer.from("stty size; exit\r")))
const size = Buffer.alloc(4)
size.writeUInt16BE(132, 0)
size.writeUInt16BE(50, 2)
child.stdin.write(frame("r", size))

Environment

The command inherits the environment of PTY-to-Stdio, except for what npm resp. npx injected when it started PTY-to-Stdio, so the command sees the environment of the caller of npx instead:

  • the configuration and lifecycle variables npm_*,
  • the variables INIT_CWD, NODE, and COLOR, and
  • the directories .../node_modules/.bin and .../node-gyp-bin prepended to PATH, which would otherwise shadow the programs of the caller with the ones of the npx package cache.

EDITOR is kept, as npm sets it only when the caller had no own value. When PTY-to-Stdio is started directly instead of through npm or npx, the environment is passed on unchanged. Use the option --cwd to run npx from a neutral directory (without a package.json or .npmrc of its own) while the command still runs in the intended working directory.

Platforms

The pseudo-terminal is provided by the native addon node-pty, whose prebuilt binaries need neither an install script nor a C/C++ toolchain:

  • macOS (x64, arm64): prebuilt binaries
  • Linux with the GNU C library (x64, arm64): prebuilt binaries
  • Linux with the musl C library: built from source only
  • Windows (x64, arm64): prebuilt binaries, but untested

On Linux with the musl C library (e.g. Alpine Linux), the prebuilt binaries cannot be loaded, so PTY-to-Stdio refuses to start unless node-pty was built from source: install it with the install scripts of node-pty allowed, npm_config_build_from_source=true, and a C/C++ toolchain (python3, make, g++).

License

Copyright © 2026 Matthias Brusdeylins

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

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 pty-to-stdio

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

Ethersphere Hijacked With Crypto Stealing Malware (1)
npm

Ethersphere Hijacked With Crypto Stealing Malware Via Github & npm

Copy of Template Design OX Blog (1)
Research

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

Plug and Pray: Your AI Agents Are Taking Orders From Strangers
Research

Plug and Pray: Your AI Agents Are Taking Orders From Strangers

Frame 2085668439 (1)
Group 1261154229