Skip to main content

behave-runner

A unified CLI entry point for the Behave BDD ecosystem.

CI Coverage PyPI Python Docs License

behave-runner is a single, extensible command-line interface for the Behave BDD ecosystem. It wraps common Behave workflows into focused subcommands and degrades gracefully when optional plugins are not installed.

Why behave-runner?

  • One CLI for everything — run, list, filter, lint, format, watch, report, trace, generate and analyze scenarios from one tool.
  • Plugin-friendly — optional extras add parallel execution, retries, priority ordering, trace viewers, report formatters, step libraries and more without breaking core behavior.
  • Fast feedback — watch mode, impact analysis and rich terminal output keep the test loop tight.
  • Project scaffolding — initialize a new Behave project, generate steps or features, and validate project health with doctor.

Features

  • Run, list, select, lint, format, watch, report, trace, steps, impact, generate, init, config, open and record commands.
  • Optional parallel execution, sharding, retries and priority ordering.
  • Configuration profiles via pyproject.toml or behave.ini.
  • Watch mode that re-runs tests when files change.
  • Reports in console, HTML, Markdown, JSON, XLSX and DOCX formats.
  • Trace viewer and web dashboard support.
  • Step library management and feature/step generation.
  • Impact analysis to detect scenarios affected by code changes.
  • Graceful degradation when optional extras are missing.

Requirements

  • Python 3.11 or higher
  • Core dependencies (behave, behave-kit, behave-model) are installed automatically

Installation

pip install behave-runner

To install all optional extensions:

pip install "behave-runner[all]"

For development:

git clone https://github.com/MathiasPaulenko/behave-runner.git
cd behave-runner
pip install -e ".[dev]"
pre-commit install

Getting Started

1. Initialize a project

behave-runner init --name my-project

This creates a standard Behave layout: features/, features/steps/ and environment.py inside the named project directory.

2. List scenarios

behave-runner list

Shows every scenario in the project without running anything.

3. Run the suite

behave-runner run

Runs every feature. You can also target a specific feature or tag:

behave-runner run --tags @smoke
behave-runner run features/login.feature

4. Filter with select

behave-runner select --tags @smoke
behave-runner select --pattern "login"

5. Watch files

behave-runner watch

Re-runs behave-runner run whenever a .feature, .py or config file changes. Press Ctrl+C to stop.

6. Lint and format

behave-runner lint
behave-runner format

7. Reports and traces

behave-runner report generate --format html
behave-runner report show

With behave-trace installed:

behave-runner trace show

Configuration

You can store profiles in pyproject.toml:

[tool.behave-runner]
parallel = 4

[tool.behave-runner.profiles.smoke]
tags = ["@smoke"]

[tool.behave-runner.profiles.ci]
parallel = 8
format = "json"

Or use a classic behave.ini file. Run behave-runner config show to inspect configuration.

Commands

Command Description
run Execute Behave tests.
watch Re-run tests when files change.
list List scenarios without executing them.
select Filter scenarios by tags, regex or name.
lint Lint .feature files.
format Format .feature files.
doctor Check project health.
init Initialize a new Behave project.
generate Generate steps or features.
record Record a browser session and generate steps.
report Generate and open reports.
trace View traces or serve a trace dashboard.
steps Manage step libraries.
impact Detect scenarios affected by code changes.
open Open the latest report or trace in the default browser.
config Manage configuration profiles.

Ecosystem

behave-runner is the entry point for the BehaveLib ecosystem. The libraries below can be installed individually or through behave-runner extras.

Library Category Purpose Extra
behave Core BDD framework. included
behave-kit Core Testing utilities: timeouts, fixtures, hooks. included
behave-model Core Feature and scenario parsing. included
behave-pool Execution Parallel and sharded runs. parallel
behave-priority Execution Priority ordering and smoke flags. priority
behave-retry Execution Retry and flaky report support. retry
behave-trace Debug Trace viewer and UI. trace
behave-doctor Quality Project health and impact analysis. doctor
behave-lint Quality Feature file linting. lint
behave-format Quality Feature file formatting. format
behave-gen Scaffolding Project and feature generation. gen
behave-steplib Steps Step library management. steplib
behave-comments Utility Comment metadata extraction. comments
behave-tables Utility Table helpers. —
wavexis Recording Browser session recording. record
behave-modern-console-report Reporting Console report. report-console
behave-modern-html-report Reporting HTML report. report-html
behave-modern-md-report Reporting Markdown report. report-md
behave-modern-json-report Reporting JSON report. report-json
behave-modern-sheets-report Reporting XLSX/CSV report. report-sheets
behave-modern-file-report Reporting DOCX report. report-file

Install groups:

# Execution extras
pip install "behave-runner[parallel,priority,retry]"

# Reporting extras
pip install "behave-runner[report-html,report-json]"

# Everything
pip install "behave-runner[all]"

Documentation

Full documentation is available at:

https://mathiaspaulenko.github.io/behave-runner/

Contributing

Contributions are welcome. Please read CONTRIBUTING.md for guidelines.

Acknowledgements

behave-runner is built on top of the Behave BDD framework and the BehaveLib ecosystem of plugins. It uses Typer for the CLI and Rich for terminal output.

License

MIT

Metadata

Release files for behave-runner 1.4.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for behave-runner 1.4.0
File Size Uploaded
behave_runner-1.4.0.tar.gz 101.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for behave-runner 1.4.0
File Interpreter ABI Platform
behave_runner-1.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 141.2 kB

Release files / behave_runner-1.4.0.tar.gz

Download URL behave_runner-1.4.0.tar.gz
Size 101.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b6ab213e53aca270d4348980a44ec1e1f464f5426ca148fe0af91e315171883b
BLAKE2b-256 checksum
How to use checksums
c4e42503fc4bb233497f6a09122414ecfc00a785e809c3ce165f2f8c74378e54
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / behave_runner-1.4.0-py3-none-any.whl

Download URL behave_runner-1.4.0-py3-none-any.whl
Size 39.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9bf4aa10ea2de5e1f9444717afb724a681e189652d6570bfb2af4cdb79805d86
BLAKE2b-256 checksum
How to use checksums
208ea86447aeda50cbb1744c465907457457816cd3a47d96a90cf88177f7884c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

1.4.0 This release

2 release files

1.3.0

2 release files

1.1.0

2 release files

1.0.1

2 release files

1.0.0

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page