Skip to main content

A terminal UI for NATS cluster management

Project description

NATS TUI

A terminal user interface for NATS cluster management, built with Textual.

Features

  • Connection Management: Connect to NATS servers with optional authentication
  • TLS Support: Secure connections with CA certificates, mutual TLS, and insecure mode for self-signed certs
  • Subject Browser: Discover and browse subjects with hierarchical tree view
  • Message Publishing: Publish messages with custom payloads and headers
  • Message Subscribing: Subscribe to subjects with wildcard support and real-time display
  • JetStream Streams: Create, delete, purge, and manage JetStream streams
  • JetStream Consumers: Create, delete, pause/resume consumers
  • Theming: 19+ built-in themes including light and dark modes
  • Configuration: TOML-based config with named connection profiles

Installation

pip install nats-tui

Quick Start

# Connect to local NATS server
nats-tui -s nats://localhost:4222

# Connect with TLS
nats-tui -s tls://server:4222 --tls --tls-ca-cert /path/to/ca.crt

# Use a saved connection profile
nats-tui -P prod

# Launch with a specific theme
nats-tui -t nats-tui-light

Usage

nats-tui [OPTIONS]

Connection:
  -s, --server URL      NATS server URL (nats:// or tls://)
  -P, --profile NAME    Connection profile name from config file

TLS:
  --tls                 Enable TLS connection
  --tls-ca-cert PATH    Path to CA certificate file
  --tls-cert PATH       Path to client certificate (for mutual TLS)
  --tls-key PATH        Path to client key (for mutual TLS)
  --tls-insecure        Disable certificate verification (insecure)

Configuration:
  -c, --config PATH     Path to config file (TOML)
  -t, --theme NAME      Theme name (see --help for available themes)
  --version             Show version and exit
  --help                Show help and exit

TLS Connections

nats-tui supports secure TLS connections to NATS servers.

Basic TLS with CA Certificate

nats-tui -s tls://server:4222 --tls --tls-ca-cert /path/to/ca.crt

TLS with Self-Signed Certificates (Insecure)

nats-tui -s tls://server:4222 --tls --tls-ca-cert /path/to/ca.crt --tls-insecure

Mutual TLS (mTLS) with Client Certificates

nats-tui -s tls://server:4222 --tls \
  --tls-ca-cert /path/to/ca.crt \
  --tls-cert /path/to/client.crt \
  --tls-key /path/to/client.key

TLS in Configuration Profiles

[profiles.prod]
server = "tls://prod.example.com:4222"
tls = true
tls_ca_cert = "/path/to/ca.crt"

[profiles.dev]
server = "tls://dev.example.com:4222"
tls = true
tls_ca_cert = "/path/to/ca.crt"
tls_insecure = true  # For self-signed certificates

[profiles.mtls]
server = "tls://secure.example.com:4222"
tls = true
tls_ca_cert = "/path/to/ca.crt"
tls_cert = "/path/to/client.crt"
tls_key = "/path/to/client.key"

TLS is automatically enabled when using tls:// URLs.

Key Bindings

Key Action
q Quit
? / F1 Show help
c Open connection dialog
d Disconnect
r Refresh current view
Escape Go back
j Switch to JetStream view
p Publish message
s Subscribe to subject
u Unsubscribe
n Create new stream/consumer
Delete Delete selected item
Space Pause/resume consumer
Shift+P Purge stream
Enter View consumers (in stream view)

Configuration

NATS TUI looks for configuration files in the following locations (in order of priority):

  1. ~/.config/nats-tui/config.toml
  2. ./pyproject.toml (under [tool.nats-tui])
  3. ./.nats-tui.toml
  4. ./nats-tui.toml

Example Configuration

# Default profile to use when none specified
default_profile = "local"

# Default theme
theme = "nats-tui"

# Connection profiles
[profiles.local]
server = "nats://localhost:4222"

[profiles.prod]
server = "tls://prod.example.com:4222"
username = "admin"
password = "secret"
tls = true
tls_ca_cert = "/etc/nats/ca.crt"

[profiles.staging]
server = "tls://staging.example.com:4222"
tls = true
tls_ca_cert = "/etc/nats/ca.crt"
tls_insecure = true

# Custom key bindings (optional)
[keybindings]
quit = "ctrl+q"

Using Profiles

# Use the default profile from config
nats-tui

# Use a specific profile
nats-tui -P prod

# Override profile server with CLI flag
nats-tui -P prod -s tls://different-server:4222

Themes

NATS TUI includes 19+ themes. Use -t or --theme to select:

# Dark theme (default)
nats-tui -t nats-tui

# Light theme
nats-tui -t nats-tui-light

# Built-in Textual themes
nats-tui -t dracula
nats-tui -t monokai
nats-tui -t nord

Run nats-tui --help to see all available themes.

Development

Setup

# Clone the repository
git clone https://github.com/coreyellis/nats-tui.git
cd nats-tui

# Create virtual environment
python -m venv .venv
source .venv/bin/activate  # or .venv\Scripts\activate on Windows

# Install in development mode
pip install -e ".[dev]"

Running Tests

pytest tests/ -v

Running the App

# From source
nats-tui

# Or directly
python -m nats_tui

Requirements

  • Python 3.10+
  • NATS server (for actual usage)

Dependencies

License

MIT

Related Projects

  • NATS - The NATS messaging system
  • nats-py - Python client for NATS
  • Harlequin - SQL IDE for the terminal (inspiration for this project)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nats_tui-0.1.0.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nats_tui-0.1.0-py3-none-any.whl (57.7 kB view details)

Uploaded Python 3

File details

Details for the file nats_tui-0.1.0.tar.gz.

File metadata

  • Download URL: nats_tui-0.1.0.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nats_tui-0.1.0.tar.gz
Algorithm Hash digest
SHA256 d933b75183bb5dd40dee01999364c9f05a4873d4f4e04257a68664e20c7a904b
MD5 48bb214497f2fd0940e2526793eddf82
BLAKE2b-256 06ad17ad71e486f04c9441d4e01ab7a5e5b7423bb5fda045b9b5ed11ac3cffd5

See more details on using hashes here.

Provenance

The following attestation bundles were made for nats_tui-0.1.0.tar.gz:

Publisher: publish.yml on cmetech/nats-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nats_tui-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nats_tui-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 57.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for nats_tui-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a5d73d1882f0e84119c0960d5ddc14ac90efc3bbd36a7ddad9837ff0d5d4cffd
MD5 c6013ba74085eb9ab8818ee5744cc038
BLAKE2b-256 cff61d94cafca5addf7a0c072b3b9b6bd5f0564a8a66eda0a0a9d4ba6bfc2b31

See more details on using hashes here.

Provenance

The following attestation bundles were made for nats_tui-0.1.0-py3-none-any.whl:

Publisher: publish.yml on cmetech/nats-tui

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page