npx archal init locally first, then commit .archal.json, your harness,
and the archal devDependency. CI should use the project-pinned CLI with
npx archal.
Secrets
The only required secret is your Archal token. For CI, use a workspace API key (archal_ws_...). Workspace keys are bound to one workspace, do not
expire when a team member leaves, and are the recommended auth method for any
non-interactive environment:
Creating a workspace API key
Create one from the CLI (requires owner or admin role):sessions:read, sessions:write, workspaces:read.
Because workspace keys are already bound to a workspace, you do not need
ARCHAL_WORKSPACE_ID. Setting it to a different workspace returns
workspace_key_scope_mismatch.
Workspace keys are runtime and CI credentials, not governance credentials.
They can run clones, upload and read traces, and read usage for their bound
workspace. They cannot list, create, or revoke workspace API keys, and they
cannot read audit events. Use an owner/admin user credential, either
archal login or a dashboard-issued user API key, for those workspace
administration actions.
Personal tokens (local dev only)
For local development you can usearchal login (browser OAuth) or set a
personal token. Personal tokens start with arc_ and are tied to your
individual account:
GitHub Actions
GitLab CI
Useful flags
| Flag | What it does |
|---|---|
--pass-threshold <score> | Exit 1 if satisfaction is below this (0-100) |
-o json | Machine-readable JSON output |
-q | Suppress non-error output |
-n, --runs <count> | Run the scenario multiple times for a real satisfaction score |
--tag <tag> | Only run scenarios with a matching tag (exits 0 if no match) |
Exit codes
| Code | Meaning |
|---|---|
0 | Score met the threshold (or scenario skipped by --tag) |
1 | Score below threshold or runtime error |
2 | Validation error (bad flags, missing scenario, invalid config) |
Go deeper
- Writing scenarios covers repeatable checks.
- Security covers tokens, telemetry, and trace upload.
- CLI output covers JSON output and CI-friendly flags.
Run multiple scenarios
List scenario paths in thescenarios array of .archal.json. archal run executes each one:
