| name | xray-cli |
| description | Xray Cloud test management CLI for creating tests, managing executions, importing results, and backup/restore operations. Use when the user needs to interact with Xray Cloud API for test case management. |
| allowed-tools | Bash(bun xray:*) |
Xray CLI - Test Management
Quick start
bun xray auth status
bun xray auth login --client-id ABC123 --client-secret xyz789
bun xray test list --project DEMO
bun xray exec create --project DEMO --summary "Sprint 1 Tests"
bun xray import junit --file results.xml --project DEMO
Commands
Authentication
bun xray auth login --client-id <id> --client-secret <secret>
bun xray auth login --client-id <id> --client-secret <secret> --project DEMO
bun xray auth login --jira-url https://your-instance.atlassian.net --jira-email user@email.com --jira-token <token>
bun xray auth logout
bun xray auth status
Test Management
bun xray test create --project DEMO --summary "Verify login"
bun xray test create --project DEMO --summary "Verify login" --type Manual
bun xray test create --project DEMO --summary "API check" --type Generic --definition "curl http://api.test"
bun xray test create --project DEMO --summary "Login flow" --type Cucumber --gherkin "Feature: Login..."
bun xray test create --project DEMO --summary "Verify login" \
--step "Open app|Login form is displayed" \
--step "Enter credentials|user@test.com|Success message"
bun xray test get DEMO-123
bun xray test get --id <issueId>
bun xray test list --project DEMO
bun xray test list --project DEMO --limit 50
bun xray test list --jql "project = DEMO AND labels = critical"
bun xray test add-step --test <issueId> --action "Click button" --result "Form submits"
Test Executions
bun xray exec create --project DEMO --summary "Sprint 1 Regression"
bun xray exec create --project DEMO --summary "Sprint 1" --tests <id1>,<id2>,<id3>
bun xray exec get <issueId>
bun xray exec list --project DEMO
bun xray exec add-tests --execution <id> --tests <id1>,<id2>
bun xray exec remove-tests --execution <id> --tests <id1>,<id2>
Test Runs
bun xray run get <runId>
bun xray run list --execution <issueId>
bun xray run status --id <runId> --status PASSED
bun xray run status --id <runId> --status FAILED
bun xray run status --id <runId> --status TODO
bun xray run status --id <runId> --status EXECUTING
bun xray run status --id <runId> --status ABORTED
bun xray run status --id <runId> --status BLOCKED
bun xray run step-status --run <runId> --step <stepId> --status PASSED
bun xray run comment --id <runId> --comment "Test completed successfully"
bun xray run defect --id <runId> --issues DEMO-456,DEMO-789
Test Plans
bun xray plan create --project DEMO --summary "Q1 2025 Test Plan"
bun xray plan create --project DEMO --summary "Release 2.0" --tests <id1>,<id2>
bun xray plan list --project DEMO
Test Sets
bun xray set create --project DEMO --summary "Smoke Tests"
bun xray set create --project DEMO --summary "Regression" --tests <id1>,<id2>
bun xray set get <issueId>
bun xray set list --project DEMO
bun xray set add-tests --set <id> --tests <id1>,<id2>
bun xray set remove-tests --set <id> --tests <id1>,<id2>
Import Results
bun xray import junit --file results.xml
bun xray import junit --file results.xml --project DEMO
bun xray import junit --file results.xml --plan DEMO-100
bun xray import junit --file results.xml --execution DEMO-200
bun xray import cucumber --file cucumber-report.json
bun xray import cucumber --file cucumber-report.json --project DEMO
bun xray import xray --file xray-results.json
Backup & Restore
bun xray backup export --project DEMO --output demo-backup.json
bun xray backup export --project DEMO --output demo-backup.json --include-runs
bun xray backup export --project DEMO --output demo-backup.json --only-with-data
bun xray backup restore --file demo-backup.json --project NEW_PROJ --dry-run
bun xray backup restore --file demo-backup.json --project NEW_PROJ
bun xray backup restore --file demo-backup.json --project PROJ --sync
bun xray backup restore --file demo-backup.json --project PROJ --map-keys mappings.csv
Environment Variables
XRAY_CLIENT_ID
XRAY_CLIENT_SECRET
JIRA_BASE_URL
JIRA_EMAIL
JIRA_API_TOKEN
Config Files
~/.xray-cli/config.json - Stored credentials and default project
~/.xray-cli/token.json - Cached auth token (24h validity)
Example: Complete Test Workflow
bun xray auth login --client-id $XRAY_CLIENT_ID --client-secret $XRAY_CLIENT_SECRET --project DEMO
bun xray test create --project DEMO --summary "Verify user registration" \
--step "Navigate to signup page|Signup form displayed" \
--step "Fill required fields|Fields accept input" \
--step "Submit form|Success message shown"
bun xray exec create --project DEMO --summary "Registration Tests - Sprint 5"
bun xray import junit --file test-results/junit.xml --project DEMO
bun xray exec list --project DEMO --limit 5
Example: Project Migration
bun xray backup export --project OLD_PROJ --output backup.json --include-runs --only-with-data
bun xray backup restore --file backup.json --project NEW_PROJ --dry-run
bun xray backup restore --file backup.json --project NEW_PROJ
bun xray backup restore --file backup.json --project NEW_PROJ --sync
Specific tasks