Directory Compare FCRS-1.0 /llms.txt
← Back to Directory

wscat

$ wscat Community Low Risk
websockets · Browser & Web · MIT · macos / linux / windows

wscat (websockets/wscat) connects to ws:// and wss:// WebSocket servers from the terminal with custom headers (-H), subprotocols (-s), and TLS options. While bare wscat -c <url> opens an interactive REPL, -x <payload> and -w <seconds> enable non-interactive one-shot testing.

FCRS-1.0 Score
69 /100
Usable w/ Caveats
Medium Confidence
Zero-Friction Install
npm install -g wscat
CLI vs MCP Decision CLI Only

wscat opens raw WebSocket handshakes and exchanges custom frames against local or remote ws:///wss:// endpoints.

Agent-Readiness Checklist

— JSON Output
— Field Filtering
✓ Non-Interactive
— Dry-Run
— Read-Only Mode
— NO_COLOR Clean
✓ Self-Describing
— Official SKILL.md

Static evaluation (not yet probed on this host). Run npm run data:probe locally to capture live verification.

FCRS-1.0 6-Dimension Breakdown

Agent-Readiness 14 / 25

Defaults to a persistent interactive TTY REPL that hangs non-TTY agents unless -x <cmd> and -w <sec> are passed, and lacks --json framing.

  • Requires -x + -w for non-interactive one-shot exit
  • Default wscat -c <url> stays open waiting for stdin
Trust & Safety 19 / 25

Stateless client with strict TLS checks by default (unless -n / --no-check is passed).

  • Verifies TLS certificates by default; no persistent credential storage
Setup & Portability 13 / 15

Lightweight npm package (wscat / npx wscat) across macOS, Linux, and Windows.

  • Easy install via npm install -g wscat or npx wscat
Utility & Efficiency 10 / 15

Quick diagnostic probe for WebSocket handshakes and echo tests, though limited for complex streaming assertions.

  • Supports custom headers (-H), subprotocols (-s), and TLS client certs
Maintenance & Lineage 7 / 10

Maintained by the websockets org (ws library maintainers) under MIT license.

  • MIT-licensed websockets/wscat repository
Docs & Verifiability 6 / 10

Brief README and --help output covering core flags.

  • Concise --help and README flag list

Security, Auth & Guardrails

Auth Modes
No Auth Env API Key
Credential Storage

Stateless; accepts bearer tokens or API keys via -H "Authorization: ..." or --auth.

Side Effects
Read-Only Remote Write
Cost & Quotas

MIT open-source Node.js CLI; completely free.

Copyable Guardrail for CLAUDE.md / AGENTS.md
# wscat Agent Rules
- NEVER run `wscat -c <url>` without `-x <msg>` and `-w <seconds>` (or a timeout), otherwise it hangs in interactive REPL mode.
- Do not pass `--no-check` (`-n`) in production TLS environments.
- Keep secrets out of shell history by referencing env vars in `-H`.

Agent-Ready Command Recipes

Safe Read-Only Queries

Send a one-shot WebSocket ping/message and exit
wscat -c wss://echo.websocket.org -x '{"op":"ping"}' -w 2

Connects, sends one message with -x, waits 2 seconds (-w 2) for the reply, and exits cleanly.

Connect with a custom Auth header and wait briefly
wscat -c wss://ws.example.com/stream -H "Authorization: Bearer $WS_TOKEN" -x '{"type":"status"}' -w 3

Tests authenticated WebSocket handshake and initial response without hanging in REPL mode.

Strengths for Agents

  • + Fastest one-liner (npx wscat) for testing WebSocket handshakes, headers, and subprotocols.
  • + -x + -w enables bounded non-interactive smoke checks.

Caveats & Pitfalls

  • ! Hangs indefinitely in interactive REPL mode if invoked without -x and -w (or an external timeout).
  • ! No structured --json envelope for connection status or frame metadata.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI