ms — Biznetgio ManageService CLI
CLI tool for managing Biznetgio ManageService resources including CloudStack and Prometheus.
Installation
npm install -g @biznetgio/ms
bun install -g @biznetgio/ms
Quick Start
ms config set baseUrl https://your-api-server.com
ms auth login
ms key create --name my-key
ms cloudstack list
ms prometheus metrics
Configuration
ms config
ms config set <key> <value>
ms config get [key]
ms config reset
baseUrl | http://localhost:3000 | API server base URL |
accessKey | (not set) | API key access key |
secretKey | (not set) | API key secret key |
jwtToken | (not set) | JWT token (set automatically on login) |
refreshToken | (not set) | Refresh token (set automatically on login) |
Config is stored at ~/.config/ms/config.json.
baseUrl can also be set via the MS_BASE_URL environment variable, which takes priority over the stored config.
Authentication
ms auth login
ms auth logout
ms auth whoami
Login stores a JWT token automatically. It is used for ms auth, ms key, and ms credentials commands.
API Keys
API keys are used to authenticate CloudStack and Prometheus requests (X-API-Key header).
ms key list
ms key create --name <name>
ms key revoke <id>
ms key activate <id>
ms key delete <id>
The secret key is shown once on creation and stored to ~/.config/ms/config.json.
If you lose it, delete the key and create a new one.
CloudStack
Pass-through interface to the CloudStack API.
Browse available commands
ms cloudstack list
ms cloudstack list --search <term>
ms cloudstack help <command>
Example:
ms cloudstack list --search virtual
ms cloudstack help deployVirtualMachine
Run a command
ms cloudstack run <command> [-p key=value ...]
Parameters are passed as repeatable -p key=value pairs.
Examples:
ms cloudstack run listZones
ms cloudstack run listVirtualMachines -p zoneid=abc-123
ms cloudstack run deployVirtualMachine \
-p zoneid=abc-123 \
-p serviceofferingid=def-456 \
-p templateid=ghi-789 \
-p name=my-vm
Output is JSON. For async commands (e.g. deployVirtualMachine), a jobid is returned — poll it with:
ms cloudstack run queryAsyncJobResult -p jobid=<jobid>
Prometheus
Query and explore Prometheus metrics.
Browse available metrics
ms prometheus metrics
ms prometheus metrics --search <term>
ms prometheus metrics --type <type>
Example:
ms prometheus metrics --search cpu
ms prometheus metrics --type gauge
Instant query
ms prometheus query <promql> [--time <timestamp>] [--json]
Examples:
ms prometheus query 'up'
ms prometheus query 'up{job="kubelet"}'
ms prometheus query 'rate(http_requests_total[5m])'
ms prometheus query 'node_cpu_seconds_total' --time 2024-01-01T00:00:00Z
Range query
ms prometheus range <promql> --start <ts> --end <ts> [--step <s>] [--json]
Timestamps can be Unix seconds or RFC3339. Step defaults to 15s.
ms prometheus range 'up' --start 2024-01-01T00:00:00Z --end 2024-01-01T01:00:00Z
ms prometheus range 'node_cpu_seconds_total' --start 1700000000 --end 1700003600 --step 60s
Other commands
ms prometheus targets [--filter up|down]
ms prometheus labels [--match <selector>]
ms prometheus alerts [--state firing|pending|inactive]
ms prometheus status
Add --json to any command to get raw JSON output.
Credentials
Third-party credentials (CloudStack and Prometheus) are stored server-side per account.
ms credentials set cloudstack
ms credentials set prometheus
ms credentials get
ms credentials delete cloudstack
ms credentials delete prometheus