Zergaw Cloud Docs

Command Line Interface(Cloudmonkey)

CloudMonkey (cmk) is the official, high-performance command-line interface (CLI) for Zergaw CloudStack. cmk provides a fast, standalone binary capable of managing your IaaS environments.

Key Capabilities

Installation & Setup

cmk is distributed as a single static binary for Linux, macOS, and Windows.

Linux (x86_64 / ARM64)

# Download latest Linux release
curl -L -o cmk https://fms.zergaw.com/index.php/s/p5k94DfTwT39kRE/download/cmk.linux.x86-64

# Grant execution permissions
chmod +x cmk

# Move to system path
sudo mv cmk /usr/local/bin/

# Verify installation
cmk version

macOS (Apple Silicon)

# macOS (ARM64 / M-series)
curl -L -o cmk https://fms.zergaw.com/index.php/s/ZajSRydCcHfmD34/download/cmk.darwin.arm64
chmod +x cmk
sudo mv cmk /usr/local/bin/

Windows (PowerShell)

Invoke-WebRequest -Uri "https://fms.zergaw.com/index.php/s/AjbRE9sTeyeo8RM/download/cmk.windows.x86-64.exe" -OutFile "cmk.exe"
Move-Item cmk.exe C:\Windows\System32\

Configuration & Authentication

Launch cmk without parameters to start the interactive shell:

cmk

To set up username/password authentication:

cmk > set url https://cloudstack.zergaw.com/client/api
cmk > set username USERNAME
cmk > set password PASSWORD
cmk > set domain DOMAIN

Before using auto-completion or querying new API endpoints, synchronize the local API cache with your CloudStack management server:

cmk > sync

Operating Modes

Interactive REPL Mode

Running cmk enters interactive mode.

$ cmk
🦧 Apache CloudStack 🐵 CloudMonkey 6.5.0
Type "help" for help, "how-to" for tips, "ctrl-c" or "exit" to exit.

Interactive Shell Shortcuts:

Direct CLI / One-Shot Mode

Execute single commands directly from your terminal or shell scripts:

cmk list virtualmachines state=Running

Output Formatting & Data Filtering

CloudMonkey provides multiple output formats to simplify both human reading and automated parsing.

Format Option Keyword Primary Use Case
Table table Human interactive reading (default)
JSON json Automation, piping to jq
YAML yaml Configuration manifests, readability
CSV csv Exporting reports to spreadsheets
Text text Simple scalar key-value listings

Quick Cloud Setup through cmk

(localcloud) cmk > create network zoneid=8de6d4e2-e032-4dce-b09b-468b69a8c398  name=demo-net displaytext=demo-net networkofferingid=8c784ca2-9f95-4b9a-9acd-515a4e04595f gateway=10.0.10.1 netmask=255.255.255.0 dns1=1.1.1.1 dns2=8.8.8.8 account=demo.admin domainid=e97a2cde-61a1-4f31-8c6c-8415860fcb99
(localcloud) cmk > deploy virtualmachine zoneid=8de6d4e2-e032-4dce-b09b-468b69a8c398 boottype=BIOS bootmode=LEGACY templateid=14db197e-8c84-418b-9800-50d2e55350a3 rootdisksize=30 startvm=true serviceofferingid=d26af6a7-cde4-46ab-b3fc-e99b9d94d6e3 iptonetworklist[0].networkid=6c87e9dd-f37f-473d-83a3-ff638b9cd1ce name=demo-vm displayname=demo-vm account=demo.admin domainid=e97a2cde-61a1-4f31-8c6c-8415860fcb99 

Don't forget to copy the password from the field password on the JSON response

Troubleshooting & FAQ

Issue 1: cmk: command not found

Issue 2: HTTP 401 Unauthorized / Invalid Credentials

Issue 3: Missing Autocompletions or New API Parameters