CLI Reference
Complete reference for TestFlowKit command line interface (CLI) commands and options.
Basic Usage
tkit [command] [options]
Commands
run
Execute test scenarios.
tkit run [options]
Options
| Option | Short | Description | Default |
|---|---|---|---|
--location | -l | Path to Gherkin feature files | — |
--config | -c | Path to configuration file | config.yml |
--tags | -t | Tags filter (e.g. @smoke and not @wip) | all |
--headless | Run browser in headless mode | true | |
--timeout | Timeout duration (Go duration: 10s, 1m, 2h) | — | |
--env-file | Path to environment variables YAML file | — |
Examples
# Run all tests
tkit run
# Run with specific config
tkit run --config staging.yml
# Run tagged tests
tkit run --tags @smoke
tkit run --tags "@login and not @slow"
# Run against a different environment
tkit run --env-file .env.staging.yml
tkit run --env-file .env.production.yml
# Run with specific location
tkit run --location e2e/features
# Increase timeout
tkit run --timeout 2m
init
Initialize a new TestFlowKit project.
tkit init [options]
Options
| Option | Description |
|---|---|
--name | Project name |
--template | Template to use (basic, full) |
Examples
# Interactive initialization
tkit init
# With options
tkit init --name my-tests --template full
validate
Validate configuration and feature files.
tkit validate [options]
Options
| Option | Short | Description |
|---|---|---|
--location | -l | Path to Gherkin feature files |
--config | -c | Path to configuration file |
--tags | -t | Tags filter |
Examples
# Validate default configuration
tkit validate
# Validate specific config
tkit validate --config production.yml
# Validate specific features
tkit validate --features tests/e2e
version
Display version information.
tkit version
Output:
TestFlowKit version 2.0.0
Build: abc123
Go version: go1.21
Global Options
| Option | Short | Description |
|---|---|---|
--version | -v | Show version information |
--help | -h | Display help and exit |
help
Display help information.
tkit help [command]
Examples
# General help
tkit help
# Command-specific help
tkit help run
tkit help validate
Tag Expressions
Tags allow you to filter which scenarios to run. TestFlowKit supports boolean expressions.
Basic Tags
# Run scenarios tagged @smoke
tkit run --tags @smoke
# Run scenarios tagged @login
tkit run --tags @login
Boolean Expressions
# AND - both tags required
tkit run --tags "@smoke and @login"
# OR - either tag
tkit run --tags "@smoke or @regression"
# NOT - exclude tag
tkit run --tags "not @slow"
# Combined
tkit run --tags "@smoke and not @wip"
tkit run --tags "(@login or @signup) and not @slow"
Environment Variables
Environment variable overrides are not currently provided by the CLI. Use command-line flags (--config, --location, --tags, --env, --timeout, --headless) or set values in your config.yml instead.
Exit Codes
| Code | Meaning |
|---|---|
0 | All tests passed |
1 | One or more tests failed |
2 | Configuration error |
3 | Invalid arguments |
CI/CD Integration
GitHub Actions
- name: Run Tests
run: |
chmod +x ./tkit
./tkit run --headless --tags "@smoke"
GitLab CI
test:
script:
- chmod +x ./tkit
- ./tkit run --headless
artifacts:
paths:
- reports/
Jenkins
sh './tkit run --headless --config ci.yml'
Best Practices
1. Use Configuration Files for Environments
# Development
tkit run --config config.dev.yml
# Staging
tkit run --config config.staging.yml
# Production (read-only tests)
tkit run --config config.prod.yml --tags "@readonly"
2. Organize Tags Strategically
@smoke @critical
Scenario: Critical user flow
@regression @slow
Scenario: Full data validation
# Quick validation
tkit run --tags @smoke
# Full regression
tkit run --tags @regression
3. Use Verbose Mode for Debugging
tkit run --verbose --slow-motion 200
Next Steps
- Configuration — Configuration file reference
- Step Definitions — Available test steps
- Troubleshooting — Common issues