Skip to main content

A command-line interface for managing ZeroTier networks, built with Python.

Project description

ZeroTier API CLI

A command-line interface for managing ZeroTier networks, built with Python.

Features

  • List all members in your ZeroTier network
  • View pending (unauthorized) members
  • Authorize new members
  • Remove members from the network
  • JSON output support
  • Rich terminal output with tables

Installation

Recommended: Using pipx

pipx install zerotier-api-cli

Alternative: Using pip

pip install zerotier-api-cli

Development: Using Poetry

# Clone the repository
git clone https://github.com/yourusername/zerotier-api-cli.git
cd zerotier-api-cli

# Install dependencies
poetry install

# Install the package
poetry build
pip install dist/*.whl

Configuration

The CLI requires two pieces of information to work:

  1. ZeroTier API Token
  2. Network ID

You can provide these in three ways:

1. Environment Variables

export ZEROTIER_TOKEN="your_api_token"
export ZEROTIER_NETWORK_ID="your_network_id"

2. Command Line Arguments

ztcli --token your_api_token --network-id your_network_id [command]

3. Configuration File

You can save your settings to a configuration file using the save-settings command:

ztcli --token your_api_token --network-id your_network_id save-settings

The configuration file will be saved to:

  • Linux: ~/.config/zerotier-cli/config.yaml
  • macOS: ~/Library/Application Support/zerotier-cli/config.yaml
  • Windows: %APPDATA%\zerotier-cli\config.yaml

Once saved, you won't need to provide the token and network ID in subsequent commands.

Usage

List Network Members

# List all members
ztcli list

# List only pending members
ztcli list --pending

# Output as JSON
ztcli list --json

Authorize a Member

ztcli approve MEMBER_ID

Remove a Member

ztcli remove MEMBER_ID

Development

Setup Development Environment

# Clone the repository
git clone https://github.com/yourusername/zerotier-api-cli.git
cd zerotier-api-cli

# Install dependencies
poetry install

# Activate the virtual environment
poetry shell

Running Tests

poetry run pytest

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

zerotier_api_cli-0.1.1.tar.gz (4.6 kB view details)

Uploaded Source

Built Distribution

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

zerotier_api_cli-0.1.1-py3-none-any.whl (6.4 kB view details)

Uploaded Python 3

File details

Details for the file zerotier_api_cli-0.1.1.tar.gz.

File metadata

  • Download URL: zerotier_api_cli-0.1.1.tar.gz
  • Upload date:
  • Size: 4.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.6 Darwin/24.4.0

File hashes

Hashes for zerotier_api_cli-0.1.1.tar.gz
Algorithm Hash digest
SHA256 13721153bde45aafafd198f7d3bc6ec6bbd5cb4f69883ec9d3e1a853b4523f5f
MD5 eb389cc23d3c2277e19ad4bb4316a248
BLAKE2b-256 60495c5c0679cdb6689a92d831d24bb9ba86dca2662ff66e8e28379c5ea17558

See more details on using hashes here.

File details

Details for the file zerotier_api_cli-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: zerotier_api_cli-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 6.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.1.2 CPython/3.10.6 Darwin/24.4.0

File hashes

Hashes for zerotier_api_cli-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 84be90a300c46fc38ce1f25ad79baa5c174be62ec93ac901dcfd2d09ac003252
MD5 b94fdca0687cfd9936dc224e184d74d4
BLAKE2b-256 5af7cdd8d9578938c79c74b24ac80fb37ff53c6c31c8115380fea0d4fdb78f9f

See more details on using hashes here.

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