CLI Overview
The Clank CLI is a standalone Go binary that lets you deploy, manage, and inspect your Clank services from the terminal. It communicates with the Clank API over HTTPS and stores an authenticated session locally so you stay logged in between commands.
Installation
Section titled “Installation”Download the pre-built binary for your platform from the Clank dashboard under Settings > CLI, or use curl:
# macOS (Apple Silicon)curl -fsSL https://clank.host/api/install/cli/darwin-arm64 -o clankchmod +x clank && sudo mv clank /usr/local/bin/
# macOS (Intel)curl -fsSL https://clank.host/api/install/cli/darwin-amd64 -o clankchmod +x clank && sudo mv clank /usr/local/bin/
# Linux (x86_64)curl -fsSL https://clank.host/api/install/cli/linux-amd64 -o clankchmod +x clank && sudo mv clank /usr/local/bin/Verify the installation:
clank versionAuthentication
Section titled “Authentication”Before using any command, point the CLI at your Clank instance and log in:
clank config set base_url https://your-clank-instance.comclank loginclank login opens a browser window for authentication. After you log in, a session cookie is stored in your local config file (~/.clank.yaml by default). You can also set CLANK_URL as an environment variable instead of using config set.
Command reference
Section titled “Command reference”| Command | Description |
|---|---|
clank login | Authenticate with the Clank platform |
clank logout | Clear the stored session |
clank deploy | Trigger a deployment for a service |
clank rollback | Roll back a service to its previous deployment |
clank logs | Stream or fetch recent logs for a service |
clank projects list | List all projects in the current team |
clank projects create | Create a new project |
clank services list | List services in a project |
clank services info | Show details for a specific service |
clank servers list | List enrolled agent servers |
clank servers add | Register a new server |
clank servers remove | Remove a server from the platform |
clank team list | List team members |
clank team invite | Invite a user to the team |
clank team remove | Remove a member from the team |
clank config set | Set a configuration value (e.g., base_url) |
clank config get | Read a configuration value |
clank open | Open the current project in the Clank dashboard |
clank version | Print the CLI version |
Every command supports --help for detailed usage and available flags.
Common workflows
Section titled “Common workflows”Deploy from the terminal
Section titled “Deploy from the terminal”Trigger a deployment for a service by name:
clank deploy --project my-app --service apiThe CLI streams build and deploy output in real time and exits with a non-zero code if the deployment fails, making it suitable for CI pipelines.
View logs
Section titled “View logs”Tail the most recent logs for a running service:
clank logs --project my-app --service api --followManage servers
Section titled “Manage servers”List all connected agent servers and their health status:
clank servers listRoll back a broken deploy
Section titled “Roll back a broken deploy”If a deployment causes issues, roll back to the previous version:
clank rollback --project my-app --service apiConfiguration file
Section titled “Configuration file”The CLI reads its configuration from ~/.clank.yaml. The file stores the platform URL, session credentials, and the currently selected team. You can override the config path with --config or the CLANK_CONFIG environment variable.