Skip to main content

Nginx Proxy Manager CLI

A stateful CLI harness for managing Nginx Proxy Manager via its REST API.

Installation

pip install cli-anything-npm

Quick Start

# Check NPM health
cli-anything-npm health --url http://npm.example.com:81/api

# Login
cli-anything-npm login --identity admin@example.com --secret password

# List proxy hosts
cli-anything-npm proxy-host list

# Create proxy host
cli-anything-npm proxy-host create \
  --domain example.com \
  --forward-host 10.0.0.1 \
  --forward-port 8080

# Enable/disable hosts
cli-anything-npm proxy-host enable 1
cli-anything-npm proxy-host disable 1

# Get JSON output (for agent consumption)
cli-anything-npm proxy-host list --json

Commands

Authentication

cli-anything-npm login --identity <email> --secret <password>
cli-anything-npm login --identity <email> --secret <password> --2fa <code>
cli-anything-npm logout

Proxy Hosts

cli-anything-npm proxy-host list [--expand] [--query]
cli-anything-npm proxy-host get <id>
cli-anything-npm proxy-host create --domain <domains> --forward-host <host> --forward-port <port>
cli-anything-npm proxy-host update <id> [options]
cli-anything-npm proxy-host delete <id>
cli-anything-npm proxy-host enable <id>
cli-anything-npm proxy-host disable <id>

Certificates

cli-anything-npm cert list
cli-anything-npm cert get <id>
cli-anything-npm cert renew <id>
cli-anything-npm cert delete <id>
cli-anything-npm cert dns-providers

Streams

cli-anything-npm stream list
cli-anything-npm stream get <id>
cli-anything-npm stream create --incoming-port <port> --forwarding-host <host> --forwarding-port <port>
cli-anything-npm stream update <id> [options]
cli-anything-npm stream delete <id>
cli-anything-npm stream enable <id>
cli-anything-npm stream disable <id>

Stream Options

Option Description
--incoming-port Port to listen on
--forwarding-host Target host to forward to
--forwarding-port Target port to forward to
--tcp/--no-tcp Enable TCP forwarding (default: enabled)
--udp/--no-udp Enable UDP forwarding (default: disabled)
--certificate SSL certificate ID (0 = no SSL)
--json-input Read configuration from JSON file

Stream Examples

# Create a TCP port proxy (port 3095 -> sais-web-dev:80)
cli-anything-npm stream create \
  --incoming-port 3095 \
  --forwarding-host sais-web-dev \
  --forwarding-port 80

# Create with UDP support
cli-anything-npm stream create \
  --incoming-port 53 \
  --forwarding-host dns-server \
  --forwarding-port 53 \
  --udp

# Update forwarding target
cli-anything-npm stream update 8 --forwarding-host new-backend

# Get stream details
cli-anything-npm stream get 8

# Delete stream
cli-anything-npm stream delete 8

Access Lists

cli-anything-npm access-list list

Users

cli-anything-npm user list
cli-anything-npm user get <id>

Global Options

Option Description Default
--url NPM API base URL http://127.0.0.1:81/api
--token JWT auth token From session
--json Output as JSON False

REPL Mode

cli-anything-npm repl
npm> health
npm> login --identity admin@example.com --secret password
npm> proxy-host list
npm> proxy-host create --domain test.local --forward-host 10.0.0.1 --forward-port 80
npm> exit

JSON Output

All commands support --json for programmatic consumption:

cli-anything-npm proxy-host list --json
# [{"id": 1, "domain_names": ["example.com"], ...}]

Session Persistence

Session state is saved to ~/.npm-cli/session.json including:

  • API base URL
  • JWT token
  • User info
  • Output preferences

Python API

from cli_anything.npm import NPMClient, Session

# Create client
client = NPMClient(base_url="http://npm.example.com:81/api")

# Login
result = client.login("admin@example.com", "password")
client.set_token(result["token"])

# List proxy hosts
hosts = client.list_proxy_hosts()

# Create proxy host
host = client.create_proxy_host({
    "domain_names": ["example.com"],
    "forward_host": "10.0.0.1",
    "forward_port": 8080,
    "enabled": True
})

# Enable/disable
client.enable_proxy_host(host["id"])
client.disable_proxy_host(host["id"])

License

MIT

Download files

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

Source Distribution

cli_anything_npm-1.0.0.tar.gz (19.6 kB view details)

Uploaded Source

Built Distribution

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

cli_anything_npm-1.0.0-py3-none-any.whl (22.7 kB view details)

Uploaded Python 3

File details

Details for the file cli_anything_npm-1.0.0.tar.gz.

File metadata

  • Download URL: cli_anything_npm-1.0.0.tar.gz
  • Upload date:
  • Size: 19.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for cli_anything_npm-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6f8862baa0c043f23131f42760d9b408a0458e9b39ea7fcd3d03f894573f3fe5
MD5 0020d63908baccd88c3a6552c5446ba4
BLAKE2b-256 286403053cd50bb861b48eff40acf9b5a9b04479988ff14efe22426b9f475b0c

See more details on using hashes here.

File details

Details for the file cli_anything_npm-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for cli_anything_npm-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3b882102d8025a30d579182f3a01f3a81d8f1c1fd64e2c6cc3445bbb381d0559
MD5 8a8ea44599a5f6d0e3584f88c5838233
BLAKE2b-256 8c9aed48c8f740c91a5b06f418514f1e31881b993e963bbaed70ee412c33df33

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