Skip to main content

sekee-cli

The command-line interface for pushing XML test reports into Sekee from CI or a developer machine.

@sekee/sekee-cli

Installing

npm install -g @sekee/sekee-cli

Or run it without installing anything:

npx @sekee/sekee-cli upload-reports --help

Authentication

Every command reads a token from the SEKEE_API_TOKEN environment variable. Create one at Administration → API Tokens; it is shown once.

# Linux / macOS
export SEKEE_API_TOKEN="your-api-token-here"

# Windows PowerShell
$env:SEKEE_API_TOKEN = "your-api-token-here"

To persist it locally, add the export to your shell profile:

echo 'export SEKEE_API_TOKEN="your-api-token-here"' >> ~/.zshrc

In CI, set it as a secret. Never commit it.

The token carries the organization, so it is also what scopes the upload. There is no separate organization argument.

Choosing a workflow

SituationUse
One test job, one report (or a directory of them), finishing at onceupload-reports
Parallel shards or suites finishing at different timesinitthreadcomplete

upload-reports

Uploads one or more XML reports and creates a completed run in one step.

sekee-cli upload-reports \
--url <api-url> \
--name <run-name> \
--projectID <project-id> \
--source <source-name> \
--reports <reports-path> \
[--tags <comma-separated-tags>]
OptionAliasDescriptionRequired
--url-uBase URL of your Sekee APIYes
--name-nName for the automation runYes
--projectID-pProject ID (org-scoped)Yes
--source-sSource name for the runYes
--reports-rReports directory or glob patternYes
--tags-tComma-separated tagsNo

--reports accepts either a directory — in which case every **/*.xml underneath it is collected — or a glob pattern. If it matches nothing, the command fails rather than creating an empty run.

sekee-cli upload-reports \
--url https://api.sekee.io \
--name "Nightly Regression Tests" \
--projectID 1 \
--source "GitHub Actions" \
--tags "regression,nightly" \
--reports "./cypress/reports"

init

Creates a run with status running and prints its Run ID. Use this when several jobs will report into the same run.

sekee-cli init \
--url <api-url> \
--name <run-name> \
--projectID <project-id> \
--source <source-name> \
[--tags <comma-separated-tags>]
OptionAliasDescriptionRequired
--url-uBase URL of your APIYes
--name-nName for the runYes
--projectID-pProject ID (org-scoped)Yes
--source-sSource nameYes
--tags-tComma-separated tagsNo
sekee-cli init \
--url https://api.sekee.io \
--name "PR #42 Tests" \
--projectID 1 \
--source "CI" \
--tags "pr,automated"

# Output: Run ID: 5

Capture that id — every later call needs it.


thread

Appends a single XML report to a running run. The run's counts are incremented automatically. Call it once per worker or suite.

sekee-cli thread \
--url <api-url> \
--runId <run-id> \
--name <thread-name> \
--report <xml-file-path>
OptionAliasDescriptionRequired
--url-uBase URL of your APIYes
--runId-iRun ID returned by initYes
--name-nName of this thread/workerYes
--report-rPath to one XML reportYes

Note the singular: thread takes --report, one file. upload-reports takes --reports, a directory or glob.

sekee-cli thread \
--url https://api.sekee.io \
--runId 5 \
--name "Worker 1 - Login Tests" \
--report "./reports/worker1-results.xml"

complete

Marks a running run as completed. Call it after every thread has finished.

sekee-cli complete --url <api-url> --runId <run-id>
OptionAliasDescriptionRequired
--url-uBase URL of your APIYes
--runId-iRun ID returned by initYes

A run left un-completed stays running forever and reads as a job that never came back — which is sometimes exactly the signal you want, so Sekee does not time it out for you.


The multi-step workflow end to end

# 1. Open a run
sekee-cli init \
--url https://api.sekee.io \
--name "PR #42 Tests" \
--projectID 1 --source "CI" --tags "pr,automated"
# → Run ID: 5

# 2. Each worker reports into it
sekee-cli thread --url https://api.sekee.io --runId 5 --name "Worker 1" --report "./reports/w1.xml"
sekee-cli thread --url https://api.sekee.io --runId 5 --name "Worker 2" --report "./reports/w2.xml"
sekee-cli thread --url https://api.sekee.io --runId 5 --name "Worker 3" --report "./reports/w3.xml"

# 3. Close it
sekee-cli complete --url https://api.sekee.io --runId 5

Environment variables

VariableDescriptionRequired
SEKEE_API_TOKENAPI token, from Administration → API TokensYes

Errors

ErrorCause
SEKEE_API_TOKEN not foundThe environment variable is not set
403 ForbiddenInvalid, expired, or missing API token
400 Bad RequestMissing required fields, or the project was not found
404 Not FoundThe run id does not exist (thread / complete)
No XML files found using pattern: …--reports matched nothing

What it talks to

For the endpoints behind these commands, see the ingestion API reference.