Start

Examples

These sequences run against the local catalog and mocks. Prefix with cargo run -p cxas-cli -- or put target/debug on PATH.

1. Scaffold and lint

cxas init --app-dir ./pilot
cxas lint --app-dir ./pilot
cxas --format human lint --app-dir ./pilot

Expected: exit 0, JSON ok: true, command lint.

2. Create an app and list it later

cxas create --name demo --location us --project-id my-project
cxas apps list --location us --project-id my-project
cxas apps get --app demo --location us --project-id my-project

The second process must see the app because it is stored in .cxas/catalog.json. To isolate a run:

# PowerShell
$env:CXAS_CATALOG = "$PWD\tmp-catalog.json"
# Unix
export CXAS_CATALOG="$PWD/tmp-catalog.json"

3. State and diff

cxas state --app-dir ./pilot --location us --project-id my-project
cxas diff --app-dir ./pilot --location us --app demo
cxas diff --app-dir ./pilot --location us --app demo --allow-drift

Without --allow-drift, a changed tree exits 1 with a drift error code.

4. Pull a versioned export

cxas pull \
  --app projects/p/locations/us/apps/a \
  --location us \
  --target-dir ./out \
  --version-id v3

Uses the mock transport. --version-id is recorded on the export request (#252). Large payloads stream through ExportHandle (#298).

5. Deploy locally

cxas deploy --app-dir ./pilot --project-id my-project --location us \
  --channel-type web --noise-cancellation
cxas deployments list --location us --project-id my-project --app-name demo

6. Evals and traces

cxas run --app-dir ./pilot --location us --project-id my-project
cxas evals report --output-dir ./report
cxas trace --raw --app-name demo --location us

7. GitHub Actions from environment.json

cxas actions init --app-dir ./pilot \
  --workload-identity-provider projects/123/locations/global/workloadIdentityPools/pool/providers/gh \
  --service-account cxas-ci@my-project.iam.gserviceaccount.com

8. Migration

cxas migrate dfcx --source ./dfcx --zip ./agent.zip \
  --project-id my-project --location us --target-name migrated --yes

9. Fail closed on location

cxas apps list --project-id my-project
# exit 2, error.code = LOCATION_REQUIRED