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):
~/.config/nats-tui/config.toml./pyproject.toml(under[tool.nats-tui])./.nats-tui.toml./nats-tui.tomlNATS_TUI_CONFIGenvironment variable (if set)-c/--configCLI option (highest priority)
Environment Variable
You can set the NATS_TUI_CONFIG environment variable to specify a config file path:
export NATS_TUI_CONFIG=/path/to/config.toml
nats-tui # Will use the config from env var
This is useful for containerized deployments where you want to pre-configure the config path.
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
- Textual - TUI framework
- nats-py - NATS client
- rich-click - CLI with Rich formatting
- tomlkit - TOML parsing
- platformdirs - Platform-specific directories
License
MIT
Related Projects
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file nats_tui-0.3.0.tar.gz.
File metadata
- Download URL: nats_tui-0.3.0.tar.gz
- Upload date:
- Size: 62.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a539e5ccb5d585b116324b1af2661e5d0d322a7bacd9a5b1e9b989770d47303
|
|
| MD5 |
c8aff352ae194409d150405a4402d634
|
|
| BLAKE2b-256 |
eeaec097b77454a93411cccd4a2467ba99a825605a730c1985d8273becfcbefb
|
Provenance
The following attestation bundles were made for nats_tui-0.3.0.tar.gz:
Publisher:
publish.yml on cmetech/nats-tui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nats_tui-0.3.0.tar.gz -
Subject digest:
4a539e5ccb5d585b116324b1af2661e5d0d322a7bacd9a5b1e9b989770d47303 - Sigstore transparency entry: 821203984
- Sigstore integration time:
-
Permalink:
cmetech/nats-tui@372f066fec61a61006527baea01372660704a18c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cmetech
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@372f066fec61a61006527baea01372660704a18c -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file nats_tui-0.3.0-py3-none-any.whl.
File metadata
- Download URL: nats_tui-0.3.0-py3-none-any.whl
- Upload date:
- Size: 85.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
598cc59280a439319bbade3256a36c6b4a01446c09822bbd709c469b34338637
|
|
| MD5 |
d55e4dbca9f0ef59404a2f677bdd64e8
|
|
| BLAKE2b-256 |
8d77c05dfcccb571f6ecc7fad0de2b8745755e3046c11b61a3c0694936c6032b
|
Provenance
The following attestation bundles were made for nats_tui-0.3.0-py3-none-any.whl:
Publisher:
publish.yml on cmetech/nats-tui
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
nats_tui-0.3.0-py3-none-any.whl -
Subject digest:
598cc59280a439319bbade3256a36c6b4a01446c09822bbd709c469b34338637 - Sigstore transparency entry: 821203997
- Sigstore integration time:
-
Permalink:
cmetech/nats-tui@372f066fec61a61006527baea01372660704a18c -
Branch / Tag:
refs/heads/main - Owner: https://github.com/cmetech
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@372f066fec61a61006527baea01372660704a18c -
Trigger Event:
workflow_dispatch
-
Statement type: