Skip to content

CLI Reference ​

Complete reference for TestBeats command-line interface and programmatic usage.

Commands ​

testbeats publish ​

Publish test results to configured targets.

testbeats init ​

Initialize a new TestBeats configuration file.

testbeats manual sync ​

Sync manual test cases from Gherkin feature files to TestBeats Portal.

Installation Methods ​

bash
npx testbeats@latest [command]

Download Executable ​

bash
curl https://raw.githubusercontent.com/test-results-reporter/testbeats/main/scripts/download-latest.sh | bash
./testbeats-[os] [command]

NPM Package ​

bash
npm install testbeats -g
testbeats [command]

Programmatic Usage ​

bash
npm install testbeats
javascript
const { publish, defineConfig } = require('testbeats');

const config = defineConfig({
  // configuration
});

publish(config);

Root-level options ​

These options apply to every command (publish, init, manual sync):

OptionDescriptionDefault
-h, --helpDisplay help information-
-v, --versionDisplay CLI version-
-l, --logLevelLog level (TRACE, DEBUG, VERBOSE, INFO, WARN, ERROR, SILENT)INFO

publish command options ​

Flags such as --config, --api-key, --slack, --junit, --ci-info, and --chart-test-summary apply only to testbeats publish. They are not global. See the full publish command reference for tables and examples.

Environment Variables ​

VariableDescriptionExample
TEST_BEATS_API_KEYTestBeats API keyapi-key
TEST_BEATS_PROJECTTestBeats project namemy-project
TEST_BEATS_RUNTestBeats run namemy-run

Quick Reference ​

Publish to Slack ​

bash
testbeats publish --slack "webhook-url" --junit "results/*.xml"

Publish with Configuration ​

bash
testbeats publish -c testbeats.config.json

Multiple Targets ​

bash
testbeats publish --slack "url1" --teams "url2" --junit "results/*.xml"

With Extensions ​

bash
testbeats publish --ci-info --chart-test-summary --slack "url" --junit "results/*.xml"

See Also ​

Released under the MIT License.