browseruse_bench.utils.cli_utils
Command-line argument parsing and error handling utilities.Import
handle_cli_errors
CLI error handling decorator for unified exception and exit code handling.Usage Example
Behavior
| Condition | Exit Code |
|---|---|
| Normal return | Function return value |
| KeyboardInterrupt | 130 |
| Other exceptions | 1 |
create_run_parser
Create argument parser for the main run script.Included Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
--mode | choice | all | Test mode: single, first_n, specific, sample_n, by_id, all |
--count | int | 1 | Number of tasks for first_n or sample_n mode |
--task-ids | list | - | Task ID list for specific mode |
--id | str | - | Single task ID for by_id mode |
--timeout | int | - | Timeout per task (seconds) |
--skip-completed | flag | False | Skip completed tasks |
--debug | flag | False | Enable debug mode |
--dry-run | flag | False | Show command only, do not execute |
create_eval_parser
Create argument parser for the evaluation script.Included Arguments
| Argument | Type | Default | Description |
|---|---|---|---|
--mode | str | - | Evaluation mode |
--model | str | - | Evaluation model |
--score-threshold | int | - | Score threshold (LexBench-Browser=60, others=3) |
--num-worker | int | 1 | Number of worker processes |
--api-key | str | - | API Key |
--base-url | str | - | API Base URL |
--dry-run | flag | False | Show command only, do not execute |
create_base_agent_parser
Create base argument parser for Agent run.py.Parser description
Default tasks JSON file path
Default output directory