Skip to content

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).

The quickstart entry point. Interactive; safe to re-run.

Terminal window
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 (wraps new Connection(...)).

Failure rate, top issues, CU headroom, and provider split for a program. Omit the argument to use the program detected in the current directory.

Terminal window
npx @wiretap-labs/cli status

Explain why a single transaction failed, dropped, or never sent — the same decoded story the Telegram bot and MCP server return.

Terminal window
npx @wiretap-labs/cli why <signature>

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:

Terminal window
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:8899

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):

Terminal window
pnpm --filter @wiretap/demo-program traffic -- --url https://api.devnet.solana.com

It 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).

The MCP server is a separate package, @wiretap-labs/mcp (binary wiretap-mcp) — not a wiretap subcommand. Point your MCP client at it directly:

Terminal window
claude mcp add wiretap -- npx -y @wiretap-labs/mcp

See MCP server for hosted and per-client setup.