Automate CI/CD and ephemeral staging on Thai cloud with xverctl and REST API
How DevOps teams use xverctl CLI, REST API v2, Reserved IPs and MCP mode to spin up hourly Bangkok staging servers and delete them after tests
On this page
DevOps teams can provision Bangkok staging servers, run automated integration suites and delete them the moment tests finish with xverctl CLI and REST API v2. Combined with true hourly billing, CI jobs only pay for the hours a test environment actually exists.
CI/CD tooling & guardrails at a glance
- Non-interactive auth
Export
XVER_TOKENin CI secrets and pass-o jsonso every response is a single clean JSON document- Safe retries
--dry-runpreviews pricing and blockers before spending credit;--idempotency-keyprevents duplicate resources on retries- Covered services
Cloud Servers, Container Apps, Reserved IPs, S3 Object Storage keys and built-in read-only
xverctl mcp- Reference docs
Ephemeral staging lifecycle in CI/CD#
Each Pull Request can spin up a fresh Bangkok VM, execute integration tests and remove the machine automatically so no idle charges linger overnight.
- Pull Request opened on
GitHub
- xverctl server create (--idempotency-key)
- Build and run integration tests
- xverctl server delete --yes (billing stops immediately)
Running an integration test for 2 hours on s-2vcpu-4gb and deleting the VM afterward costs a small fraction of a day or month. Live figures from the billing API:
What you need before setting up CI/CD
1. Install xverctl and create a scoped API token#
Create a least-privilege API token in the console (my.xver.cloud/account/api-tokens) scoped only to what your pipeline needs, then install xverctl and verify connectivity.
# macOS / Linux via Homebrew
brew install xver-cloud/tap/xverctl
# Or via the official install script
curl -fsSL https://github.com/xver-cloud/xverctl/releases/latest/download/install.sh | sh
# Verify binary version and active token (with XVER_TOKEN set)
xverctl version
xverctl auth status -o json2. Create and delete a staging server in CI/CD#
Tie --idempotency-key to the CI run ID so network retries never create duplicate servers, and add --wait to block until the server finishes provisioning.
KEY="ci-pr-${PR_NUMBER:-101}-staging"
# 1. Validate inputs and preview pricing without spending credit
xverctl server create "pr-${PR_NUMBER:-101}" \
--plan s-2vcpu-4gb \
--os ubuntu-24.04 \
--idempotency-key "$KEY" \
--dry-run -o json
# 2. Create the server and wait until it is ready
xverctl server create "pr-${PR_NUMBER:-101}" \
--plan s-2vcpu-4gb \
--os ubuntu-24.04 \
--idempotency-key "$KEY" \
--wait -o json
# 3. Delete immediately after tests finish so hourly billing stops
xverctl server delete "pr-${PR_NUMBER:-101}" --yes --wait -o json3. Deploy Container Apps and enable xverctl MCP#
If your app ships as a Docker image, deploy straight to Container Apps with automatic HTTPS and scale-to-zero, or connect AI coding agents safely via
xverctl mcp.
# Deploy an image and get a public HTTPS URL
xverctl container deploy preview-api \
--image ghcr.io/team/api:pr-101 \
--port 3000 \
--idempotency-key "ci-pr-101-deploy" \
--wait -o json
# Register XVer MCP server (read-only by default) in Claude Code
claude mcp add xver -- xverctl mcpTroubleshooting common CI/CD exit codes#
When a CI step fails, check the exit code returned by xverctl and expand the matching fix below.
CI/CD exit codes & deployment fixes
IssueExit code 4 · Missing XVER_TOKEN or unauthenticated
The runner has no active credentials. Inject XVER_TOKEN in your CI secrets before invoking xverctl.
IssueExit code 5 · Token lacks required scope
Reissue an API token in the console with the exact scope required by the command, such as servers:manage or servers:delete.
IssueExit code 6 · Destructive command run without --yes
xverctl blocks non-interactive destructive actions by default. Pass --yes after validation.
IssueExit code 7 · Insufficient credit or account quota reached
Top up prepaid credit in the console or contact support to request a quota increase.
IssueContainer deploy failed · Port mismatch
Verify --port matches the port your app listens on, and inspect logs via xverctl container logs <app> --tail 200.
Frequently asked questions#
Does xverctl use the same public REST API v2 documented on xver.cloud?
Yes. Every command maps directly to REST API v2 documented in the API Reference, which also publishes an OpenAPI spec for custom SDK generation.
Can xverctl mcp delete servers by default?
No. xverctl mcp starts in read-only mode by default. Write or delete tools are only exposed if you explicitly pass --allow-write or --allow-delete.
Can I mint scoped S3 Object Storage credentials from the CLI?
Yes. Run xverctl token create <name> --storage write --bucket <bucket> -o json to generate an Access Key ID and Secret Access Key restricted to that bucket.