Command line
There’s no separate CargoForge CLI to install. From a terminal you have three good options:
git push
Section titled “git push”Connect the project to GitHub or GitLab (see Push to deploy) and a push to the chosen branch builds and deploys it. Pull requests get previews on Cargo.
git push origin maincurl and an API key
Section titled “curl and an API key”Every action is one REST call. A small wrapper covers most needs:
export CARGOFORGE_API_KEY=... # from the dashboard's API Keys pagecf() { curl -fsS -H "Authorization: Bearer $CARGOFORGE_API_KEY" \ -H "Content-Type: application/json" "https://api.cargoforge.dev$1" "${@:2}"; }
cf /projects | jq '.[] | {id, name}'cf /containers | jq '.[] | {service_name, state}'cf "/projects/$PROJECT/deployments/$DEPLOYMENT/restart" -X POSTIn CI, keep the key in the CI system’s secrets, and give it the Deploy scope and an expiry.
An AI coding agent
Section titled “An AI coding agent”Claude Code and other agents can drive CargoForge through its MCP server: “deploy this compose file and tell me the URL” works from your terminal.
claude mcp add --transport http cargoforge https://api.cargoforge.dev/mcp \ --header "Authorization: Bearer $CARGOFORGE_API_KEY"