cg CLI reference
cg is the CloudGrange command-line interface. Install it on any machine with network access to your CloudGrange server. The CLI talks to the platform REST API and renders output as a table by default or as JSON with --output json.
CloudGrange is in preview, not GA. The command surface below reflects current code in cloudgrange-cli and may change during the preview. See current product and release status.
Global options
These options apply to every command.
| Option | Description |
|---|---|
--output, -o <format> |
Output format: table (default) or json. |
--server <url> |
Override the configured server URL for this invocation. |
--verbose, -v |
Enable verbose output. |
--help |
Show help for any command. |
--version |
Show the CLI version. |
Configuration and authentication
cg stores configuration in ~/.cloudgrange/config.json and the cached session token in ~/.cloudgrange/session.json. Authentication uses the OAuth device-code flow against the configured server.
cg config set server https://cloudgrange.contoso.com
cg auth login
Command tree
| Command | Description |
|---|---|
cg auth login |
Log in via device-code flow and cache credentials. |
cg auth logout |
Clear the cached session token. |
cg config get <key> |
Read a configuration value (server, org, or output). |
cg config set <key> <value> |
Write a configuration value. |
cg config list |
List all configuration values. |
cg cluster list |
List all clusters. |
cg cluster get <id> |
Show cluster detail. |
cg cluster add |
Register a cluster. |
cg cluster remove <id> |
Remove a cluster. |
cg agent list |
List registered per-host agents. |
cg agent register |
Register an agent. |
cg agent remove <id> |
Remove an agent. |
cg deploy plan --cluster <name> |
Create a deployment plan for a cluster. |
cg deploy apply |
Apply a deployment plan. |
cg deploy status |
Show deployment status. |
cg module list |
List installed modules. |
cg module install <id> |
Install a module. |
cg module uninstall <id> |
Uninstall a module. |
cg module enable <id> |
Enable a module. |
cg module disable <id> |
Disable a module. |
cg module catalog list [--installed] [--verified] |
List modules in the published catalog. --verified shows only cosign-verified modules. |
cg module catalog get <id> |
Show a catalog module's detail. |
cg platform update check |
Check for available platform updates. |
cg platform update apply [--yes] |
Download and apply the latest update. |
cg platform update --rollback [--yes] |
Roll back to the previous platform version. |
cg watch --job <id> |
Stream a job's progress in real time. |
Examples
# Point the CLI at a server and log in
cg config set server https://cloudgrange.contoso.com
cg auth login
# List clusters as JSON
cg cluster list --output json
# Watch a running job until it completes
cg watch --job 9f1c2a34-0000-0000-0000-abcdef123456
# Apply the latest platform update without confirmation prompts
cg platform update apply --yes