Query and display your cpolar tunnel status from the local cpolar dashboard API.
- Logs into the local cpolar dashboard and lists all tunnels
- Shows each tunnel as
name public_url → 127.0.0.1:localport - Filter tunnels by name (
--filter) - Output raw JSON (
--json) - Chinese / English localized output via gettext
- Packaged as a Nix flake
- bash
- curl
- jq
- gettext
cpolar-status --username <user> --password <pass> [options]
Options:
| Option | Description |
|---|---|
--username <user> |
login username (required) |
--password <pass> |
login password (required) |
--baseurl <url> |
dashboard base URL (optional, default http://127.0.0.1:9200) |
--filter <name> |
only show the named tunnel (e.g. ssh) |
--json |
output raw JSON |
-h, --help |
show help |
Examples:
cpolar-status --username user@example.com --password xxxx
cpolar-status --username user@example.com --password xxxx --filter ssh
cpolar-status --username user@example.com --password xxxx --filter ssh --json
cpolar-status --username user@example.com --password xxxx --jsonSample text output:
ssh https://xxxxx.r2.cpolar.cn → 127.0.0.1:22
admin https://xxxxx.r2.cpolar.cn → 127.0.0.1:8080
./cpolar-status.sh --username user@example.com --password xxxxBuild and install the flake package:
nix build
nix profile install . # or: nix profile install .#defaultEnter the development shell (contains jq, curl, gettext):
nix developRun the test suite with real credentials passed via environment variables (they are never written into any file):
CPOLAR_USERNAME=user@example.com CPOLAR_PASSWORD=xxxx ./test_cpolar-status.shA demo script that walks through every option is also provided:
CPOLAR_USERNAME=user@example.com CPOLAR_PASSWORD=xxxx ./demo_cpolar-status.shBoth scripts require gettext/msgfmt and a zh_CN.UTF-8 locale (as
provided by nix develop).
Translations live in po/ and are compiled with msgfmt. The language is
chosen from LANG/LC_ALL/LC_MESSAGES; English is the fallback when no
catalog matches.
po/cpolar-status.pot— translation templatepo/zh_CN.po— Simplified Chinese catalog
MIT