Install the CLI
platformctl is the official command-line interface for the Crusoe AI Platform. It allows you to package and deploy agents, serverless functions, and container workloads, interact with deployed agents, manage secrets, inspect logs, and configure project settings directly from your terminal or CI/CD pipelines.
Installation
Choose the installation method that fits your operating system and environment:
- One-Line Installer
- Build from Source
Run the automated installer script in your terminal:
curl -fsSL https://cli.codyhill.dev/install.sh | bash
The script automatically detects your OS and architecture, downloads the latest platformctl release, and installs it to /usr/local/bin.
If you have a Go development environment (go >= 1.26, the version cli/platformctl/go.mod declares — an older toolchain refuses the module outright), you can build platformctl directly from source:
git clone https://github.com/crusoecloud/crusoe-ai-platform.git
cd crusoe-ai-platform
make platformctl
export PATH="$PWD/bin:$PATH"
make platformctl is the version-stamped build: it passes the linker the repo version, so platformctl version reports a real version instead of dev. A plain cd cli/platformctl && go build -o ../../bin/platformctl . produces a working binary without that stamp.
Verify the installation:
platformctl --help
You should see the list of available command groups (login, deploy, invoke, list, logs, secrets, and more).
Endpoint Configuration
By default, platformctl automatically connects to the public Crusoe AI Platform API at https://api.codyhill.dev.
If you need to direct traffic to a custom API gateway or private staging environment, set the CAI_API environment variable or pass the --api flag:
export CAI_API=https://api.codyhill.dev
You can also specify service-specific overrides when using private endpoints:
CAI_SERVERLESS_APICAI_PUBSUB_APICAI_MEMORYSTORE_APICAI_VECTORDB_APICAI_GATEWAY_APICAI_INFERENCE_API
Authentication
Sign in to your platform account using your credentials:
platformctl login --email user@example.com --password 'your-password'
Upon successful authentication, platformctl writes the session token to your user configuration directory (e.g., ~/.config/crusoe-ai/token or ~/Library/Application Support/crusoe-ai/token). The token is stored as plain text, protected by file permissions only: the file is 0600 inside a 0700 directory. It is a bearer credential — anyone who can read that file can act as you until it expires. If the CLI cannot determine a user config directory, it falls back to $TMPDIR/crusoe-ai-token, which on a shared host is a worse place for it; set XDG_CONFIG_HOME rather than accept the fallback. Session tokens remain valid for 12 hours.
Verify your active identity at any time:
platformctl whoami
Output:
user@example.com role=user (credential: cached login)
To sign out and clear your cached credentials:
platformctl logout
Setting Default Scope
Most platformctl operations run within the context of a specific Project. List your available projects and set a default:
platformctl projects list
Output:
SLUG NAME SHORT ROLE ID
ml-team ML Team ab12cd member 1f2e3d4c-5678-90ab-cdef-1234567890ab
Set your active default project by slug or short ID:
platformctl config set-project ml-team
The CLI checks scope in the following order of precedence:
- Explicit
--projectflag CAI_PROJECTenvironment variable- Saved default project setting
Output Formats
platformctl supports multiple output formats for easy terminal reading or automated scripting:
# Default table output
platformctl projects list
# JSON format for jq parsing
platformctl projects list -o json
# YAML format
platformctl projects list -o yaml
Next Steps
- Deploy Your First Agent: Follow the 5-minute quickstart guide.
- Deploy Your First Function: Ship a serverless function endpoint.
- CLI Reference: Browse the complete CLI command reference.