Back to Documentation
CLI Guide
Installation
Install the Qualigate CLI globally using npm:
bash
npm install -g qualigateAuthentication
Set your API key as an environment variable or pass it via the --api-key flag:
bash
export QUALIGATE_API_KEY=your-api-key-hereYou can generate API keys from the Settings → API Keys page in your dashboard.
Commands
qualigate run
Trigger tests and wait for results. Exits with code 0 if all tests pass, 1 if any fail.
Options:
--project <id>- Run CI-configured tests for a project--suite <id>- Run a test suite--case <id>- Run a single test case--api-key <key>- API key (or set QUALIGATE_API_KEY)--api-url <url>- API base URL (default: https://qualigate.app)--timeout <seconds>- Max wait time in seconds (default: 600)--poll-interval <seconds>- Poll interval in seconds (default: 15)--json- Output raw JSON instead of formatted results
Examples
Run a single test case
bash
qualigate run --case abc123Run all CI tests for a project
bash
qualigate run --project def456Run a suite with JSON output
bash
qualigate run --suite ghi789 --jsonCustom timeout and poll interval
bash
qualigate run --project def456 --timeout 900 --poll-interval 10Exit Codes
0- All tests passed1- One or more tests failed or encountered errors
CI/CD Usage
Use the CLI in your CI/CD pipeline to automatically run tests and fail builds on test failures:
bash
#!/bin/bash
set -e
echo "Running E2E tests..."
qualigate run --project $QUALIGATE_PROJECT_ID --json > results.json
if [ $? -eq 0 ]; then
echo "✓ All tests passed"
exit 0
else
echo "✗ Tests failed"
cat results.json
exit 1
fiSee the GitHub Actions Integration guide for more examples.