CLI
After this page you can set up a project, check a program’s health, explain a failing transaction, and verify every moving part — all from the terminal.
The CLI ships as the @wiretap-labs/cli package
with a wiretap binary. Run it without installing
via npx @wiretap-labs/cli <cmd>, or install globally with npm i -g @wiretap-labs/cli and then call
wiretap <cmd> directly. Every command takes --chain <chain> (default solana, the only
chain supported today).
wiretap init
Section titled “wiretap init”The quickstart entry point. Interactive; safe to re-run.
npx @wiretap-labs/cli init- Detects Anchor workspaces and IDLs (
Anchor.toml/declare_id!); registers the detected program ID(s) on the chosen cluster (--cluster localnet|devnet|mainnet). - Fetches the on-chain Anchor IDL so errors decode to names (or pass
--idl <path>). - On first run against a self-hosted/dev API, mints a dev API key and saves it to
~/.wiretap.json. - Prints the Telegram deep link to connect a chat.
- With
--sdk, also runs the SDK codemod on./src(wrapsnew Connection(...)).
wiretap status [program]
Section titled “wiretap status [program]”Failure rate, top issues, CU headroom, and provider split for a program. Omit the argument to use the program detected in the current directory.
npx @wiretap-labs/cli statuswiretap why <sig>
Section titled “wiretap why <sig>”Explain why a single transaction failed, dropped, or never sent — the same decoded story the Telegram bot and MCP server return.
npx @wiretap-labs/cli why <signature>wiretap doctor
Section titled “wiretap doctor”One command that tells you which plane is broken when something looks wrong. It checks the
API, ClickHouse, the RPC endpoint (--rpc <url>), and the Telegram transport:
npx @wiretap-labs/cli doctor✓ API reachable http://127.0.0.1:8790✓ Telegram transport mock (no token)✓ ClickHouse http://127.0.0.1:8123✓ RPC reachable http://127.0.0.1:8899Generating test failures
Section titled “Generating test failures”The CLI itself doesn’t emit traffic. To exercise the full pipeline without waiting for real users, run the bundled demo program’s traffic driver (see the quickstart):
pnpm --filter @wiretap/demo-program traffic -- --url https://api.devnet.solana.comIt fires a labeled mix of successes and deliberate failures (slippage 6001, guard 6000,
compute-budget exhaustion) and prints each signature to feed to wiretap why, /why, or MCP
why(sig).
MCP server
Section titled “MCP server”The MCP server is a separate package, @wiretap-labs/mcp (binary wiretap-mcp) — not a wiretap
subcommand. Point your MCP client at it directly:
claude mcp add wiretap -- npx -y @wiretap-labs/mcpSee MCP server for hosted and per-client setup.