CLI Usage
Complete guide to using the Runners command-line interface.
Installation
The CLI is included with the runners package:
Basic Usage
Run Specific Runners
Run All Discovered Runners
Use a Config File
Commands
run
Execute runners locally.
Syntax:
Options:
| Option | Description | Default |
|---|---|---|
--url <url> | URL to pass to all runners | None |
--config <path> | Path to config file | runners.config.ts |
--region <region> | Region identifier | None |
--timeout <ms> | Timeout in milliseconds | 30000 |
--help | Show help message | - |
--version | Show version | - |
Examples:
Configuration File
Create runners.config.ts in your project root:
Config Options:
| Option | Type | Description |
|---|---|---|
url | string | URL to pass to runners |
region | string | Region identifier |
runners | string[] | List of runner names to execute |
timeout | number | Timeout in milliseconds |
Example:
Runner Discovery
The CLI automatically discovers runners from:
src/**/*.tsrunners/**/*.ts
Runners must have the "use runner" directive to be discovered.
Module-Level Directive
Function-Level Directive
Output Format
Success
Failure
Error
Exit Codes
0- All runners passed1- One or more runners failed or errored2- Invalid command or configuration
Advanced Usage
Debug Mode
Enable debug logging:
Or:
Custom Input
Pass custom input to runners via config:
Multiple URLs
Run the same runners against multiple URLs:
CI Integration
Example GitHub Actions workflow:
Troubleshooting
Runners Not Found
If runners aren't being discovered:
- Check that files are in
src/orrunners/directories - Verify
"use runner"directive is present - Ensure runners are exported
- Check file extensions are
.ts(not.js)
Playwright Errors
If you see Playwright executable errors:
Timeout Issues
Increase timeout for slow runners:
Type Errors
Ensure TypeScript is properly configured:
Tips
- Use Config Files: Avoid long command lines with config files
- Debug Mode: Use
DEBUG=trueto see detailed logs - Exit Codes: Use exit codes in CI/CD pipelines
- Parallel Execution: Runners execute sequentially; use orchestrator for parallel execution
- Error Handling: Check exit codes and error messages for debugging
See Also
- Writing Runners - Guide to creating runners
- Getting Started - Quick start guide
- API Reference - Complete API documentation