CLI for API tokens
The Lightning Cloud CLI signs you in and gives you a JWT token to use with the API. Its command is harbor. Do everything else in the console or with the API.
Pre-release
The CLI is in pre-release. Its commands, flags and credential storage may change before version 1.0. If you can't use it, contact support for API access.
Install
Download the binary for your platform from the latest release.
macOS (Apple Silicon)
curl -fsSL https://github.com/voltagepark/harbor-cli/releases/latest/download/harbor-darwin-arm64 -o harbor && sudo install -m 755 harbor /usr/local/bin/harbor && rm harbormacOS (Intel)
curl -fsSL https://github.com/voltagepark/harbor-cli/releases/latest/download/harbor-darwin-amd64 -o harbor && sudo install -m 755 harbor /usr/local/bin/harbor && rm harborLinux (x86_64)
curl -fsSL https://github.com/voltagepark/harbor-cli/releases/latest/download/harbor-linux-amd64 -o harbor && sudo install -m 755 harbor /usr/local/bin/harbor && rm harborLinux (ARM64)
curl -fsSL https://github.com/voltagepark/harbor-cli/releases/latest/download/harbor-linux-arm64 -o harbor && sudo install -m 755 harbor /usr/local/bin/harbor && rm harborWindows (PowerShell)
curl.exe -sSL https://github.com/voltagepark/harbor-cli/releases/latest/download/harbor-windows-amd64.exe -o harbor.exe
# ARM64: harbor-windows-arm64.exeCheck the install:
harbor versionSign in and get a token
| Command | What it does |
|---|---|
harbor auth login |
Signs you in through your browser. Uses sea1 unless you add --region. |
harbor auth status |
Shows who you're signed in as, your organization, and when the token expires. |
harbor auth token |
Prints a valid access token for API calls. |
harbor auth logout |
Signs you out and removes the cached token. |
harbor auth login
export API_URL=https://api.sea1.voltagepark.com
export TOKEN=$(harbor auth token --region sea1)
curl "$API_URL/v1/fleets" -H "Authorization: Bearer $TOKEN"Regions
Tokens only work in the region they were issued for. Each command picks its region separately, and signing in to a region doesn't make it the default. Add the same --region to both login and token, and call that region's endpoint:
harbor auth login --region iad1
export API_URL=https://api.iad1.voltagepark.com
export TOKEN=$(harbor auth token --region iad1)See Regions & endpoints.
Token caching
The CLI caches one token per region under ~/.harbor/ and refreshes it before it expires. Run harbor auth token again whenever you need a current token. For example, run it at the start of each script instead of storing the token.
See Authentication for how tokens and principals work.
Was this page helpful?
Thanks for the feedback.