Cloudlink CLI

A small command-line wrapper around the Cloudlink REST API for health checks, scans, cost data, regressions, budget checks and deploy events.

Getting the CLI

The CLI is a single Python file, cloudlink_cli.py, in Cloudlink's backend source code. It is not published to PyPI or npm. If you want to use it, email satvikranga60@gmail.com.

It needs Python 3 and the httpx package (pip install httpx).

Configuration

VariableFlagDescription
CLOUDLINK_API_URL--api-urlAPI base URL. Set it to https://cloudlink-agents.onrender.com (the default is http://localhost:8000).
CLOUDLINK_API_KEY--api-keyYour API key. Required for every command except health.

Flags go before the command, for example python cloudlink_cli.py --api-key ... stats.

Quick start

export CLOUDLINK_API_URL=https://cloudlink-agents.onrender.com
export CLOUDLINK_API_KEY=YOUR_API_KEY

python cloudlink_cli.py health
python cloudlink_cli.py stats
python cloudlink_cli.py costs --days 30

Commands

CommandWhat it does
healthCalls GET /health
statsCalls GET /stats
costs [--days N]Calls GET /v1/costs (default 30 days)
anomaliesCalls GET /v1/anomalies
scanStarts a scan with POST /scan
budget-checkRuns budget threshold checks now with POST /budgets/check
regressions list [--status open|acknowledged|resolved]Calls GET /regressions
deploys list [--service NAME]Calls GET /deploys
deploys create --service NAME --version VERSION [--environment ENV] [--source SOURCE] [--metadata JSON]Records a deploy with POST /deploys. --environment defaults to production and --source to cli.

Output is printed as JSON. If the API returns an error, the CLI prints the status code and message and exits.

Examples

# List open regressions
python cloudlink_cli.py regressions list --status open

# Record a deploy from CI or your laptop.
# --service must match a Cost Explorer service name, e.g. "AWS Lambda".
python cloudlink_cli.py deploys create \
  --service "AWS Lambda" \
  --version "$(git rev-parse --short HEAD)" \
  --environment production \
  --source github-actions

# Start a scan
python cloudlink_cli.py scan

# Check budget thresholds now
python cloudlink_cli.py budget-check