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

NATS CLI

$ nats Foundation Med Risk
CNCF / Synadia · Database & Data · Apache-2.0 · macos / linux / windows

The nats CLI manages NATS Core pub/sub, JetStream streams and consumers, KV buckets, Object Stores, and server diagnostics. Supports -j JSON output on inspection commands, named --context profiles, and clean non-interactive execution.

FCRS-1.0 Score
86 /100
Good
Medium Confidence
Zero-Friction Install
brew install nats-io/nats-tools/nats
CLI vs MCP Decision CLI Only

nats stream ls -j, nats kv get --raw, and nats server info -j expose JetStream and KV state cleanly in shell pipelines without MCP.

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 22 / 25

Supports -j (--json) across JetStream/server/account inspection, --raw on kv get, and named contexts.

  • Supports -j JSON output, --raw, and nats context profiles
Trust & Safety 21 / 25

Clean context separation and NKey/JWT creds support; destructive purge/rm commands prompt unless -f is passed.

  • Confirmation prompts on destructive purge/rm unless --force is used
Setup & Portability 14 / 15

Single Go binary via Homebrew, go install, and GitHub Releases for macOS, Linux, and Windows.

  • Static Go binary (nats-io/natscli)
Utility & Efficiency 14 / 15

Swiss army knife for NATS pub/sub, JetStream streams, KV stores, object stores, and benchmarking.

  • Covers Core NATS, JetStream, KV, Object Store, and RTT/bench
Maintenance & Lineage 8 / 10

Official CNCF/Synadia nats-io/natscli repository under Apache-2.0.

  • Official nats-io/natscli repository
Docs & Verifiability 7 / 10

Well-documented at docs.nats.io with rich --help output.

  • Official docs at docs.nats.io/using-nats/nats-tools/nats_cli

Security, Auth & Guardrails

Auth Modes
No Auth Config File Env API Key
Credential Storage

Connection contexts saved in ~/.config/nats/context/ (nats context), or supplied via NATS_URL and --creds.

Side Effects
Read-Only Remote Write Destructive
Cost & Quotas

100% free and Apache-2.0 open-source (CNCF project).

Copyable Guardrail for CLAUDE.md / AGENTS.md
# NATS CLI Agent Rules
- Always pass `-j` for `stream`, `consumer`, `kv`, and `server` inspection commands.
- Pass `--count=1` (or `--wait`) to `nats sub` so subscriptions exit instead of streaming indefinitely.
- NEVER run `nats stream purge`, `nats stream rm`, or `nats kv del` without confirmation.

Agent-Ready Command Recipes

Safe Read-Only Queries

List JetStream streams in JSON
nats stream ls -j

Outputs configured JetStream stream names and state as JSON.

Read a key from a JetStream KV bucket
nats kv get config app.settings --raw

Fetches the raw value of a KV entry without decorative formatting.

Controlled Writes & Previews

Publish a single JSON test message
nats pub events.test '{"ok":true}'

Publishes one structured payload to a test subject and exits immediately.

Strengths for Agents

  • + -j JSON output and --raw KV reads make automation effortless.
  • + nats context cleanly isolates dev, staging, and prod credentials.
  • + Single binary handles messaging, JetStream, KV, and Object Store.

Caveats & Pitfalls

  • ! nats sub streams forever unless bounded with --count=<n>.
  • ! Commands without -j often render ASCII tables or interactive prompts.

Tested Agent Hosts

Claude Code Codex CLI Gemini CLI