Skip to content
| Marketplace
Sign in
Visual Studio Code>Visualization>NATS LensNew to Visual Studio Code? Get it now.
NATS Lens

NATS Lens

Allan Nava

|
1 install
| (0) | Free
NATS client inside VS Code: connect via your nats CLI contexts, publish/subscribe/request on subjects, browse JetStream streams and consumers.
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

NATS Lens

NATS Lens

A NATS client inside VS Code — connect with the contexts you already have from the nats CLI, publish/subscribe/request on subjects, and browse JetStream streams and consumers without leaving the editor.

📖 Documentazione · Guida all'utilizzo · Sviluppo

Features

  • Your CLI contexts, zero config — reads ~/.config/nats/context/*.json (the nats CLI format: url, user/password, token, .creds); the CLI's selected context is highlighted. Credentials are used to connect and never displayed.
  • Connections view — activity-bar panel with one click connect/disconnect; status bar shows the active connection.
  • JetStream browser — streams with message/byte counts and subjects; expand a stream to see its consumers with pending/ack-pending counts.
  • Subscribe — any subject (wildcards * and > supported): messages stream into a dedicated Output channel, JSON payloads pretty-printed, headers shown, binary detected. Active subscriptions are listed in the tree and can be stopped individually.
  • Publish / Request — quick input boxes with subject validation; request replies open as a document.

Commands

Command What it does
NATS Lens: Connect to Context Pick a context and connect
NATS Lens: Publish Message Publish a payload to a subject
NATS Lens: Subscribe to Subject Live-tail a subject into an Output channel
NATS Lens: Stop a Subscription Stop one of the active subscriptions
NATS Lens: Send Request Request-reply with timeout
NATS Lens: Disconnect Close the connection (and all subscriptions)

Settings

Setting Default Description
natsLens.contextsDir ~/.config/nats/context Where the CLI context JSON files live
natsLens.extraServers [] Extra nats:// URLs shown alongside the contexts

Development

npm install
npm test             # unit tests + integration against a throwaway local nats-server
npm run build        # bundle to dist/
# F5 in VS Code launches the Extension Development Host

The core (context parsing, payload rendering, client wrapper) has no VS Code dependency and lives in src/core/ — the integration test spins up nats-server -js on a random port, exercises pub/sub, JetStream listing and request-reply, then tears it down. If nats-server is not installed the integration tests are skipped.

Branch protection & CI

We recommend protecting the main branch and requiring the CI workflow to pass before merging. Suggested protection rules:

  • Require status checks to pass (select the CI workflow).
  • Require pull request reviews before merge (1 or 2 reviewers).
  • Dismiss stale pull request approvals when new commits are pushed.
  • Restrict who can push to main (maintainers only).

These rules help enforce the TDD standard (npm test) and ensure releases are gated by passing CI.

License

MIT

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2026 Microsoft