Bidirectional log streaming for AI coding agents
wcp (wormhole control protocol) creates Unix domain sockets for sharing terminal output across multiple processes. Run background dev servers while monitoring logs from external terminals.
curl -fsSL https://wcp.dev/install | bashOr with Deno:
deno install -gAf --name wcp https://raw.githubusercontent.com/umbrellamode/wcp/main/mod.tsIn your AI coding session, run:
wcp devThis auto-detects your project and starts the dev server in a wormhole.
wcp watchThat's it! Your AI agent runs the dev server while you watch the logs separately.
Run wcp init to set up your project:
wcp initThis will:
- Generate
CLAUDE.mdandAGENTS.mdfor AI agents - Detect your dev server command
- Save configuration to
WCP.md
Once initialized, start your dev server with:
wcp startOr have it auto-start when watching:
wcp watchSee your current configuration and active sessions:
wcp statusThe WCP.md file stores your project settings in a human-readable format:
# WCP.md
This file configures [wcp](https://wcp.dev) for this project.
## Dev Server
**Command:** `npm run dev`
**Source:** package.json
## Configuration
\`\`\`json { "project": { "type": "Node.js", "packageManager": "npm" },
"devServer": { "name": "dev", "command": ["npm", "run", "dev"], "source":
"package.json" } } \`\`\`Edit this file to customize your dev command. The JSON block in the Configuration section is parsed by wcp.
wcp init Set up project and detect dev command
wcp start Start dev server from saved config
wcp watch Monitor logs (auto-starts if needed)
wcp status Show project config and sessions
wcp dev Detect and select dev command interactively
wcp <id> -- <command> Create named session with command
wcp <id> Connect to existing session
wcp list List active sessions
wcp kill <id> Close a session
wcp update Update to latest version
wcp help Show help
# Initialize project (creates WCP.md)
wcp init
# Start configured dev server
wcp start
# Watch all sessions (auto-starts if needed)
wcp watch
# Check project status
wcp status
# Run a Next.js dev server
wcp 3000 -- npm run dev
# Run with a named identifier
wcp api -- cargo run
# Connect from another terminal
wcp api
# Kill a session
wcp kill api
# List all active sessions
wcp list- Daemon spawns your command and captures stdout/stderr
- Output is stored in a ring buffer and broadcast to all clients
- Clients connect and receive replay of recent output, then live stream
- Clients can send stdin back to the child process
All communication uses Unix domain sockets at
~/.wormhole/wormhole-<port>.sock.
- Deno v2.x or later
# Clone the repository
git clone https://github.com/umbrellamode/wcp.git
cd wcp# Run in development mode
deno task dev
# Run with arguments
deno task dev 3000 -- echo "hello"# Run all tests
deno task test
# Run tests with watch mode
deno test --allow-all --watch# Format code
deno fmt
# Check formatting (CI mode)
deno fmt --check
# Lint code
deno lint# Compile to a standalone binary
deno task compile
# The binary will be created as ./wormhole
./wormhole helpmod.ts # Entry point
src/
├── cli/ # Command-line interface
│ ├── args.ts # Argument parsing
│ ├── commands.ts # Command handlers
│ ├── animation.ts # ASCII animations
│ ├── detect.ts # Project detection
│ ├── init.ts # Init command
│ ├── menu.ts # Interactive menu
│ └── output.ts # Output formatting utilities
├── core/ # Core functionality
│ ├── daemon.ts # Server/daemon
│ ├── client.ts # Client connection
│ ├── broadcast.ts # Message broadcasting
│ ├── process.ts # Child process handling
│ └── protocol.ts # Message protocol
└── utils/ # Utilities
├── config.ts # Project configuration
├── ring-buffer.ts # Circular buffer
└── socket.ts # Socket management
See CONTRIBUTING.md for guidelines.