Skip to content

Command line

There’s no separate CargoForge CLI to install. From a terminal you have three good options:

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.

Terminal window
git push origin main

Every action is one REST call. A small wrapper covers most needs:

Terminal window
export CARGOFORGE_API_KEY=... # from the dashboard's API Keys page
cf() { 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 POST

In CI, keep the key in the CI system’s secrets, and give it the Deploy scope and an expiry.

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.

Terminal window
claude mcp add --transport http cargoforge https://api.cargoforge.dev/mcp \
--header "Authorization: Bearer $CARGOFORGE_API_KEY"