CLI reference
The Revsnap CLI (revsnap-cli) lets you trigger regression runs from the command line and integrate with CI/CD pipelines.
CLI access requires an Enterprise plan and a generated API key.
Installation
npx revsnap-cli --help
Or add revsnap-cli as a dev dependency in your project.
Authentication
Set your API key as an environment variable:
export REVSNAP_API_KEY=your_key_here
For Salesforce access in CI, authenticate separately (JWT, SFDX, etc.): Revsnap uses your pipeline's token for the actual Salesforce API calls.
Common commands
Run a single snapshot
revsnap run --snap <snapshot-name-or-id> --target-org <org-alias>
--snap also accepts a multi-rule configurator snapshot (one snapshot that holds several rule scenarios). It is addressed by the same name as any snapshot, and running it executes all of its rules in sequence. See Configurator testing.
Run a tag (batch)
revsnap run --tag <tag-api-name>
Check run status
revsnap runs list
revsnap runs show <run-id>
Exit codes
| Code | Meaning |
|---|---|
0 | Run passed, no drift detected |
1 | Run failed: regression detected or error |
Use exit codes in CI to gate merges on regression results.
API reference
For the full headless API contract, see the Postman collection in the repository at postman/revsnap-cli-api.postman_collection.json.