Overview
sgpctl is the command-line interface for managing Agentex cloud builds and deployments. It covers the same operations available through the SGP dashboard and the API/SDK, packaged for terminal workflows.
The CLI is organized under sgpctl agentex-cloud with two subcommand groups:
build: submit cloud builds, list builds, stream build logs, and cancel running builds.deploy: submit deployments, list deployments, stream deploy logs, and watch rollouts in real time.
Setup
Install sgpctl
Homebrew (macOS):Configure environment variables
Allsgpctl agentex-cloud commands require three environment variables:
All three environment variables are required. Commands will fail immediately if any of them is missing.
~/.bashrc, ~/.zshrc) or load them from a .env file in your CI pipeline.
Build commands
Build commands live undersgpctl agentex-cloud build. They let you submit new image builds, query build status, stream logs, and cancel running builds.
Submit a build
Package your agent source code and submit it for a cloud build:submit command reads your manifest.yaml, packages the build context using prepare_cloud_build_context(), uploads the resulting tar.gz archive, and creates a build via POST /v5/builds.
On success, the command prints the build details as JSON:
You can pass multiple build arguments by repeating the flag:
Get build details
Retrieve the full details of a specific build:List builds
List recent builds, optionally filtered by agent name:
Options:
Stream build logs
Stream real-time build logs for a running or completed build:Cancel a build
Cancel a build that is queued or running:cancelled status. Builds that have already completed cannot be cancelled.
Deploy commands
Deploy commands live undersgpctl agentex-cloud deploy. They let you submit deployments, check deployment status, stream logs, and watch rollouts.
Submit a deployment
Deploy an agent using a completed build:submit command reads manifest.yaml and environments.yaml from the directory specified by --agent-path, then creates a deployment via POST /v5/agentex/deployments.
Alternatively, specify an image directly instead of a build ID:
You must provide either
--build-id or both --image-name and --tag. The command will reject the request if neither or both are specified.Watch a deployment roll out
Pass--watch to deploy submit to enter a fullscreen Rich dashboard immediately after the deployment is created:
healthy or failed). Press q or Ctrl+C to exit early.
Get deployment details
Retrieve the full details and events for a specific deployment:List deployments
List recent deployments:
Options:
Streaming logs
Both build and deploy commands support log streaming, but they use different transport mechanisms.Build logs (SSE)
Build logs stream via Server-Sent Events. Thebuild logs command opens a persistent connection and prints each log line as it arrives:
Deploy logs (cursor-paged polling)
Deploy logs use cursor-based polling. Thedeploy logs command fetches new log lines at a configurable interval:
--plain flag:
grep:
Common workflows
Ship from laptop
Build an image and deploy it in one sequence:--watch gives you a live view of the rollout from start to finish.
Check what is deployed
List active deployments to see which builds are currently serving traffic:Roll back to a previous build
Redeploy a known-good build by referencing its build ID:Tail logs on a running deployment
Stream container logs from a deployment that is already running:--plain to capture logs in a file:
Next steps
- API and SDK: programmatic access to builds and deployments
- CI/CD with Gitea Actions: automate builds triggered by git push
- Secrets: store and reference credentials used during builds and deployments

