Repository navigation
v0.1.1
mistctl v0.1.1
First release of mistctl, a read-only, kubectl-style command line client for the Juniper Mist API, built on mistapi-go.
$ mistctl get devices --site HQ
NAME TYPE MODEL MAC IP STATUS VERSION UPTIME
ap-lobby ap AP45 5c5b35000001 10.0.0.10 connected 0.14.1 1d1h
sw-core switch EX4100 5c5b35000002 - disconnected - -Highlights
- kubectl-style commands.
getlists resources,describeshows one object with its config and stats, and-o table|wide|json|yaml|namecontrols the output. Objects can be referred to by name, ID or MAC address in any format. - 38 curated resource types. These cover orgs, sites, devices, inventory, clients (wireless and wired merged by MAC), NAC and WAN clients, WLANs and templates, networks, EVPN topologies, maps, settings, alarms and events, SLEs, RRM, ports, BGP/OSPF peers, tunnels and Mist Edges. Run
mistctl api-resourcesfor the list and the API endpoints behind each one. - Wired clients show where they really are. A wired client's row shows only its access switch and port. Uplinks between org switches, stale locations and busy trunk ports are filtered out.
- Remote shell:
mistctl attach DEVICE. Opens an interactive Junos shell on a switch or gateway through the Mist cloud, including one member of an SRX HA cluster (--node node1). Type~.at the start of a line to quit. - Contexts, like kubeconfig. Each context stores a cloud, a token (or the name of an environment variable holding it), a default org and a default site. Switch with
config use-contextor--context. TheMIST_APITOKEN,MIST_HOSTandMIST_ORG_IDenvironment variables are honored. - API budget awareness.
mistctl usageshows the calls left in the current hourly window. A local name/ID cache keeps tab-completion and name lookups from spending that budget. - Shell completion for bash, zsh, fish and PowerShell, with dynamic completion of org, site and device names. Release packages install it automatically.
Read-only by design
Every API request goes through a transport that refuses anything other than GET before it leaves your machine. The single allow-listed exception is the POST that opens the attach remote shell. mistctl cannot restrict what is typed inside that shell, so use an API token with the Observer (read-only) role. mistctl whoami and mistctl attach warn when the token can do more than read.
The shell websocket must use wss:// on the selected cloud's own hosts, and the token is never sent anywhere else. Terminal control characters coming from the API are escaped in table output.
Install
| Platform | Command |
|---|---|
| macOS / Linux (Homebrew) | brew install --cask tmunzer-AIDE/tap/mistctl |
| Windows (Scoop) | scoop bucket add mistctl https://github.com/tmunzer-AIDE/scoop-bucket then scoop install mistctl |
| Debian / Ubuntu, RHEL / Fedora, Alpine | .deb, .rpm and .apk packages below |
| Any platform | Archives below, or go install github.com/tmunzer-AIDE/mistctl/cmd/mistctl@v0.1.0 |
Binaries are built for Linux, macOS and Windows on amd64 and arm64. The macOS binaries are signed with a Developer ID certificate and notarized by Apple. Each archive has an SBOM, and checksums.txt lists the SHA-256 of every file.
Quick start
echo "$MIST_TOKEN" | mistctl config set-context prod --cloud global01 --token-stdin --org "ACME"
mistctl whoami
mistctl get sites -o wide
mistctl get devices -A --status disconnected
mistctl get clients --type wired --site HQ
mistctl describe device sw-core
mistctl get alarms --severity critical --duration 7dSee the README for every command, resource and flag.
Known limitations
mistctl api <path>(raw access to any GET endpoint) is not in this release yet; it is on the roadmap.- Windows binaries are not Authenticode-signed, so a browser download may show a SmartScreen prompt. Installing through Scoop is not affected.
- winget support is pending review of the package submission.
Support is best-effort open source. Issues and pull requests are welcome.
Changelog
- 126daf5: Release from the maintainer's Mac: sign and notarize with the local keychain (#26) (@tmunzer-AIDE)
- dd44f9b: ci: pin macOS runner and add job timeout (#24) (@tmunzer-AIDE)
- 844f595: release-secrets: prompt for missing files and IDs, expand ~ in paths (#25) (@tmunzer-AIDE)