MCPcopy Index your code
hub / github.com/erikh/ztui

github.com/erikh/ztui @v0.1.7

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.7 ↗ · + Follow
76 symbols 169 edges 7 files 2 documented · 3%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

ztui: your one-stop shop for ZeroTier terminal UI goodness

ztui aims to be a frontend for all interactions with ZeroTier in an attempt to transform how people work with it. It provides the following features:

  • Main Screen:
    • Bookmarks for Networks (disconnecting does not make the network id disappear from the list, and you can rejoin easily)
    • Interaction directly with Central members from the network list.
    • Joining, Leaving Networks
    • Per-Network bandwidth statistics
    • Bind arbitrary commands to keys that use a template to launch (see more on this below)
    • Review the network JSON formatted pretty
    • Launch $EDITOR against a file of network rules (and save them back to central)
  • Central / Member List:
    • Rename members
    • Auth, Unauth, and Delete members

Networks List View:

Members List / Network View:

Installing

Get Rust 1.60 or better if you need to. You'll need it.

cargo install ztui

You may also appreciate our GitHub Releases!

Configuring arbitrary commands

Rules

  • Command must not be mapped by existing commands
  • Will be executed in a shell; quote accordingly

Configuration Syntax

After you start ztui for the first time, $HOME/.config.zerotier/settings.json will be created for you with your last-saved network information. Now, what we want to do is create $HOME/.config.zerotier/config.json and add something like this:

{
    "network_commands": {
        "1": "/bin/tcpdump -i %i"
    },
    "member_commands": {
        "1": "/bin/iperf -c %a"
    }
}

Network format strings available:

  • %i: the interface of the ZeroTier network
  • %n: the network ID of the ZeroTier network
  • %a: the first addresses in the list of assigned IP addresses

In this case, it would allow me to press 1 over a network to tcpdump its interface; then I would control+C out of it to come back to ztui.

Member format strings available:

  • %n: the network ID of the ZeroTier network
  • %i: the identity of the member of this ZeroTier network
  • %a: the first assigned IP address of this member
  • %N: the name (not the fqdn!) of the ZeroTier network member as it appears in central

In the above example, it allows me to start an iperf client against the address of the selected member.

Author

Erik Hollensbe git@hollensbe.org

Core symbols most depended-on inside this repo

get
called by 13
src/config.rs
len
called by 9
src/nets.rs
api_key_for_id
called by 8
src/config.rs
central_client
called by 7
src/client.rs
get_network_id_by_pos
called by 5
src/config.rs
authtoken_path
called by 5
src/client.rs
local_client_from_file
called by 5
src/client.rs
filter
called by 4
src/config.rs

Shape

Function 34
Method 33
Enum 5
Class 4

Languages

Rust100%

Modules by API surface

src/config.rs22 symbols
src/client.rs17 symbols
src/app.rs15 symbols
src/display.rs10 symbols
src/nets.rs8 symbols
src/terminal.rs2 symbols
src/main.rs2 symbols

For agents

$ claude mcp add ztui \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page