Any other CI
Anything that can run Node 20 or newer and reach https://api.moatgator.com works.
export MOATGATOR_API_KEY=mg_live_... # from your CI's secret store; scopes: builds:write, builds:read
npx moatgator doctor # Node, network, credential, permissions, moatgator.yml
npx moatgator validate
npx moatgator scan path/to/app.aab --min-grade C
npx moatgator protect path/to/app.aab --app-version "$VERSION" --commit "$COMMIT_SHA"
doctor is the fastest way to find out why a new pipeline fails: it checks each prerequisite and says which one is missing.
Machine-readable output
npx moatgator protect app.aab --app-version 1.0.0 --json > result.json
With --json, stdout contains only the result; messages for people go to stderr. Use the exit code for pass/fail and the JSON for details.
Calling the API directly
If you cannot run Node, use the public API with Authorization: Bearer mg_live_…. The CLI is only a client of that API.
Environment variables
| Variable | Use |
|---|---|
MOATGATOR_API_KEY | API key (mg_live_…) |
MOATGATOR_APP_ID | With OIDC (GitHub Actions only), the app that trusts the repository |
MOATGATOR_API_URL | Override the API address (default https://api.moatgator.com) |
MOATGATOR_APP_VERSION | Default for --app-version |