From 80aa7621c8f8a5c345644d415d70b9c2f2b0bf85 Mon Sep 17 00:00:00 2001 From: Varun Nuthalapati Date: Thu, 28 May 2026 23:22:09 -0700 Subject: [PATCH] feat: add list-configs subcommand to CLI New users have no way to discover which config files are available without browsing the source tree. Add `python -m webwright.run.cli list-configs` that prints all .yaml filenames from the built-in config directory. Update the README flags table to document the new command. --- README.md | 5 +++-- src/webwright/run/cli.py | 13 ++++++++++++- 2 files changed, 15 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 22bd91e..adbbbfc 100644 --- a/README.md +++ b/README.md @@ -198,13 +198,14 @@ python -m webwright.run.cli \ ### 🚩 Flags -| Flag | Description | -|------|-------------| +| Flag / Command | Description | +|----------------|-------------| | `-c` | Config file(s) from `src/webwright/config/` (stackable). | | `-t` | Task instruction. | | `--start-url` | Initial page. | | `--task-id` | Output subfolder name. | | `-o` | Output directory. | +| `list-configs` | Print all available built-in config file names (`python -m webwright.run.cli list-configs`). | --- diff --git a/src/webwright/run/cli.py b/src/webwright/run/cli.py index cc27632..bf1ba18 100644 --- a/src/webwright/run/cli.py +++ b/src/webwright/run/cli.py @@ -8,7 +8,7 @@ from rich.console import Console from webwright.agents import get_agent -from webwright.config import get_config_from_spec, snapshot_config_specs +from webwright.config import builtin_config_dir, get_config_from_spec, snapshot_config_specs from webwright.environments import get_environment from webwright.models import get_model from webwright.utils.serialize import UNSET, recursive_merge @@ -131,6 +131,17 @@ def run_one( return result +@app.command("list-configs") +def list_configs() -> None: + """List all available built-in config files.""" + configs = sorted(builtin_config_dir.glob("*.yaml")) + if not configs: + console.print("No config files found.") + return + for path in configs: + console.print(path.name) + + @app.command() def main( task: str = typer.Option(..., "-t", "--task", help="Natural language task description."),