New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

tui-devtools

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

tui-devtools

All-in-one TUI automation + DevTools — run, screenshot, interact, and inspect React component trees in terminal apps. Built for AI agents.

latest
Source
npmnpm
Version
0.1.1
Version published
Maintainers
1
Created
Source

tui-devtools

All-in-one TUI automation + DevTools for terminal apps.

Run, screenshot, interact, and inspect — built for AI agents.

What It Does

Works with any TUI/CLI app — no framework dependency:

tui-devtools start                          # Start daemon
tui-devtools run "htop"                     # Run any TUI app in a PTY
tui-devtools screenshot                     # Capture screen as text
tui-devtools press q                        # Send keystrokes
tui-devtools type "hello"                   # Type text
tui-devtools wait "Ready"                   # Wait for text to appear
tui-devtools kill-session                   # Kill the app
tui-devtools stop                           # Stop daemon

Bonus for Ink (React) apps — component tree & state inspection:

tui-devtools run "DEV=true npx my-ink-app"  # Run with DevTools enabled
tui-devtools tree                            # React component hierarchy
tui-devtools inspect MyComponent             # Props, state, hooks
tui-devtools find Text                       # Search components by name
tui-devtools logs --level error              # Captured console output

Install

npm install -g tui-devtools

Two Layers

LayerWorks WithWhat You Get
PTY AutomationAny TUI/CLI apprun, screenshot, press, type, wait, scroll, kill
React DevToolsInk apps + DEV=truetree, inspect, find, logs

PTY automation works universally — Ink, Bubbletea, Ratatui, htop, vim, anything that runs in a terminal. React DevTools is an additional layer that activates when the app supports it.

Quick Start

Any TUI App

tui-devtools start
tui-devtools run "npx create-next-app"
tui-devtools wait "project name"
tui-devtools type "my-app"
tui-devtools press Enter
tui-devtools screenshot
tui-devtools kill-session
tui-devtools stop

Ink App with DevTools

tui-devtools start
tui-devtools run "DEV=true npx my-ink-app"
tui-devtools wait ">"

# Screen (what the user sees)
tui-devtools screenshot

# Structure (what React sees)
tui-devtools tree
tui-devtools inspect App --json

# Errors (what the console says)
tui-devtools logs --level error

tui-devtools kill-session
tui-devtools stop

Commands

PTY Automation (Universal)

CommandDescription
startStart daemon (WebSocket + IPC server)
stopStop daemon
run "<command>"Run command in PTY (shell auto-wrapped)
screenshotCapture current terminal screen
screenshot --strip-ansiWithout ANSI color codes
press <key> [key...]Send keystrokes (Enter, Tab, ArrowDown, Ctrl-c, etc.)
type "<text>"Type text
wait "<text>"Wait for text to appear on screen
wait "<text>" --timeout 5000With custom timeout
scroll up/down [N]Scroll viewport
kill-sessionKill PTY process
sessionsList running PTY sessions
statusShow daemon & connection status

React DevTools (Ink Apps Only)

CommandDescription
treeComponent hierarchy
tree --depth NLimit depth
tree --jsonJSON output
inspect <name>Props, state, hooks
inspect --id <N>By fiber ID
find <name>Search components by name
logsCaptured console.log/warn/error
logs --level errorFilter by level
logs --tail NLast N entries

React DevTools requires: react-devtools-core installed in the app + DEV=true env var.

Key Names

KeyName
EnterEnter
TabTab
EscapeEscape
ArrowsArrowUp ArrowDown ArrowLeft ArrowRight
BackspaceBackspace
SpaceSpace
Ctrl+CCtrl-c
Multiplepress ArrowDown ArrowDown Enter

Session Management

# Daemon-level sessions (-s) for isolation
tui-devtools -s project1 start
tui-devtools -s project2 start --port 8098

# Multiple PTY sessions within one daemon (--sid)
tui-devtools -s test run "app1" --sid app1
tui-devtools -s test run "app2" --sid app2
tui-devtools -s test screenshot --sid app1

Output Formats

tui-devtools screenshot                # Text (human-readable)
tui-devtools screenshot --json         # JSON (automation)
tui-devtools tree --json               # JSON component tree
tui-devtools sessions --json           # JSON session list

How It Works

┌─────────────────────────────────────────────────────┐
│ tui-devtools daemon                                 │
│                                                     │
│  ┌──────────────┐    ┌───────────────────────────┐  │
│  │ PTY Manager  │    │ React DevTools Server     │  │
│  │ (node-pty +  │    │ (WebSocket :8097)         │  │
│  │  xterm)      │    │                           │  │
│  │              │    │ Ink app ──ws──► fiber tree │  │
│  │ Any TUI app  │    │              ► console    │  │
│  └──────┬───────┘    └───────────┬───────────────┘  │
│         │                        │                  │
│         └────────┬───────────────┘                  │
│                  │ Unix socket IPC                  │
└──────────────────┼──────────────────────────────────┘
                   │
            CLI commands ◄── AI agent / human

Requirements

  • Node.js >= 18
  • macOS or Linux (PTY support)

For React DevTools features (optional):

  • Target app must use Ink (React-based TUI)
  • react-devtools-core package installed in the app
  • App launched with DEV=true environment variable

Troubleshooting

# posix_spawnp failed (macOS)
chmod +x $(npm root -g)/tui-devtools/node_modules/node-pty/prebuilds/darwin-*/spawn-helper

# Daemon status
tui-devtools -s test status

# Debug logs
cat ~/.tui-devtools/test.log

License

MIT

Keywords

tui

FAQs

Package last updated on 19 Mar 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts