xray-cli

Manages Xray Cloud tests, executions, plans, and backups via the bun xray CLI.

Updated Aug 31, 2026
One-click install
npx skills add https://github.com/ahuaracab/test-genesis --skill xray-cli-ahuaracab
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: xray-cli
Source: https://github.com/ahuaracab/test-genesis/tree/main/.agents/skills/xray-cli
Command: npx skills add https://github.com/ahuaracab/test-genesis --skill xray-cli-ahuaracab

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve? Managing Xray Cloud test artifacts through the UI or raw GraphQL is slow and error-prone. This Skill wraps the entire Xray Cloud API in a single bun xray CLI so agents and testers can create tests, run executions, import results, and migrate projects between Jira sites without hand-writing GraphQL mutations. ## Core Features & Use Cases - Full test lifecycle management: Create Manual, Cucumber, and Generic tests, add steps one call at a time, manage preconditions, test sets, plans, and executions with mandatory environment pinning. - Results import and run control: Import JUnit, Cucumber, or Xray JSON results, update run and step statuses, attach evidence files, and link defects to runs. - Backup, restore, and cross-site migration: Export a project's full Xray footprint (schema v2.0), preflight destination config gaps, and restore with idempotent --sync key matching for site-to-site migrations. - Use Case: After a Jira Cloud site migration leaves tests with empty Gherkin and flattened types, run backup export --all --include-runs on the source, then backup restore --sync on the destination to re-push the entire Xray payload with zero duplicates. ## Quick Start Ask the agent to log in to Xray and list the tests in your project, for example: "Log in to Xray with my .env credentials and list all tests in project DEMO."

Frequently Asked Questions about xray-cli

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I create a manual test with steps in Xray Cloud?

Create the test first with `bun xray test create --project DEMO --summary "..." --type Manual`, then add each step with a separate `bun xray test add-step` call. Xray Cloud silently drops steps passed inline to the create mutation, so the two-phase pattern is the reliable path.

How to import JUnit test results into Xray?

Run `bun xray import junit --file results.xml --project DEMO` to upload JUnit XML results. You can also target a specific plan or execution with `--plan` or `--execution` flags, and Cucumber JSON or Xray JSON formats are supported via the same import command.

Can I migrate Xray tests between Jira Cloud sites?

Yes, using `bun xray backup export --all --include-runs` on the source site and `bun xray backup restore --sync` on the destination. Sync mode matches issues by key and updates in place, but the destination project must be configured in Xray and re-indexed first or the restore falls back to creating duplicates.

Why does Xray test list show a total but zero rows?

This signature means Xray is installed but the project is not configured on that site, or the Test issues were never registered with Xray. Configure Miscellaneous, Test Coverage, Defect Mapping, and Test Environments in the project UI, then run an Xray re-index.

Does the Xray CLI support parametrized tests or datasets?

No. The Xray Cloud GraphQL schema exposes dataset queries but zero dataset mutations, so parameter values are UI-managed only. The documented convention is Cucumber Scenario Outlines with Examples tables, or encoding variations in Manual step data fields.

What credentials does the Xray CLI need to authenticate?

It needs XRAY_CLIENT_ID and XRAY_CLIENT_SECRET for the Xray GraphQL API, plus ATLASSIAN_EMAIL and ATLASSIAN_API_TOKEN for Jira-layer operations like issue links and key resolution. Credentials load from .env by default, and Xray API keys are per site instance.