Command-line tool for InCloud Manager IoT device management platform. Supports authentication, multi-environment context switching, API calls, and multiple output formats.
Paste the following into Claude Code:
Read https://raw.githubusercontent.com/inhandnet/incloud-cli/main/INSTALL.md and follow the instructions to install incloud CLI.
Download pre-built binaries from the Releases page.
# Requires Go 1.25+
make build # Output to bin/incloud
make install # Install to $GOPATH/binOn macOS,
CGO_ENABLED=0is required (already set in Makefile) to avoid dyld LC_UUID errors.
incloud config set-context dev --host nezha.inhand.dev --org myorg
incloud config use-context devincloud auth login # Global region (default)
incloud auth login --host cn # China regionLogin uses OAuth 2.0 Authorization Code + PKCE flow and automatically opens a browser for authorization.
The CLI reuses the platform frontend's SPA OAuth client, automatically fetching client_id and client_secret from the platform API at login time, sending credentials via client_secret_post (consistent with frontend behavior). You can also specify --client-id manually.
incloud auth status
incloud api /api/v1/users/meincloud auth login # Browser-based OAuth login
incloud auth status # View current auth status
incloud auth logout # Log outincloud config set-context <name> --host <url> --org <org>
incloud config use-context <name>
incloud config current-context
incloud config list-contexts
incloud config delete-context <name>incloud device list # List devices
incloud device get <id> # Get device details
incloud device create --name test --sn SN123 # Create device
incloud device update <id> --name new-name # Update device
incloud device delete <id> # Delete device
incloud device group list # List device groups
incloud device signal <id> # View signal quality
incloud device perf <id> # View performance metrics
incloud device exec ping <id> --target 8.8.8.8 # Remote ping
incloud device exec traceroute <id> --target 8.8.8.8 # Remote traceroute
incloud device exec capture <id> --download out.pcap # Packet capture with download
incloud device exec speedtest <id> # Interactive speed test
incloud device log syslog <id> --fetch # Fetch live syslog
incloud device config schema list --device <id> # List config schemas
incloud device config schema validate --device <id> --file config.json # Validate configincloud alert list # List alerts
incloud alert get <id> # Get alert details
incloud alert ack <id> # Acknowledge alert
incloud alert rule list # List alert rules
incloud alert rule create --name test --type disconnected,retention=600
incloud alert rule types # List all alert typesincloud firmware list # List firmware
incloud firmware get <id> # Get firmware details
incloud firmware upgrade create --firmware <id> --device <id> # Create upgrade task
incloud firmware upgrade list # List upgrade tasksincloud overview dashboard # Dashboard summary
incloud overview device # Device statistics
incloud overview alert # Alert statistics
incloud overview traffic # Traffic summaryincloud sdwan network list # SD-WAN networks
incloud oobm list # OOBM sessions
incloud connector list # List connectorsincloud org get # View organization info
incloud user list # List users
incloud role list # List roles
incloud activity list # Audit logincloud api /api/v1/users/me # GET request
incloud api /api/v1/devices -q page=0 -q limit=10 # With query params
incloud api /api/v1/devices -X POST -f name=test # POST with body fields
echo '{}' | incloud api /api/v1/devices -X POST --input - # Read JSON body from stdin
incloud api /api/v1/users/me -H "Sudo: user@example.com" # Custom headerincloud update # Update to latest version
incloud update --version v0.2.0 # Update to specific versionincloud device list --debug # Output debug info to stderr
INCLOUD_DEBUG=1 incloud device list # Enable via env var
incloud device list --debug -o json 2>/tmp/debug.log # Debug to file, keep stdout cleanincloud --context prod api /api/v1/users/me # Temporarily switch context
incloud --debug device list # Enable debug output
incloud version # Show versionSpecify output format with -o:
| Format | TTY Behavior | Pipe Behavior |
|---|---|---|
table (default in TTY) |
Aligned table + pagination summary | TSV |
json (default in pipe) |
Colorized pretty JSON | Compact JSON |
yaml |
YAML | YAML |
incloud device list -o table # Table output
incloud device list -o json # JSON output
incloud device list -o yaml # YAML outputApply jq expressions to filter output from any command:
incloud device list --jq '.[].name' # Extract device names
incloud device list --jq '.[] | select(.online)' # Filter online devicesDomain commands (device list, alert list, etc.) support --fields/-f to control returned and displayed fields:
incloud device list -o table -f name -f serialNumber -f online # Show specific fields
incloud device list -o json -f name -f status # JSON with specific fields--fields is passed to the API's fields parameter, reducing data transfer.
The generic api command uses --column/-c for client-side column filtering (not sent to API):
incloud api /api/v1/devices -o table -c name -c statusincloud device list --page 1 --limit 20 # First page (default), 20 per page
incloud device list --page 2 --limit 50 # Second page, 50 per page--page starts from 1. Table mode shows pagination summary: Showing 20 of 96 results (Page 1 of 5).
| Variable | Description |
|---|---|
INCLOUD_CONTEXT |
Override current context |
INCLOUD_HOST |
Override host in context |
INCLOUD_TOKEN |
Override token in context |
INCLOUD_DEBUG |
Set to any non-empty value to enable debug output |
INCLOUD_SUDO |
Impersonate a user (super admin only) |
Path: ~/.config/incloud/config.yaml (permissions 0600)
The config file stores all context information (host, org, token, etc.), managed via incloud config subcommands.
- Go 1.25+
- golangci-lint
- goimports
make build # Build to bin/incloud
make test # Run tests
make lint # Run golangci-lint
make clean # Clean build artifactscmd/incloud/ # CLI entrypoint
internal/
api/ # OAuth authentication, token transport
build/ # Build-time version info
cmd/ # Subcommand implementations
device/ # Device management
alert/ # Alert management
firmware/ # Firmware management
config/ # Config context management
auth/ # Authentication
... # (and more)
config/ # Config file I/O, context model
debug/ # Debug output (--debug / INCLOUD_DEBUG)
factory/ # Dependency injection factory
iostreams/ # Terminal output, formatting (JSON/Table/YAML)
ui/ # Interactive UI components
Proprietary — InHand Networks