UAT: Global CLI options --data-dir, --config-path, and -v (verbosity) are missing from main_callback() — spec requires them as global options #2121

Closed
opened 2026-04-03 04:14:45 +00:00 by freemo · 3 comments
Owner

Metadata

  • Branch: fix/cli-missing-global-options
  • Commit Message: fix(cli): add --data-dir, --config-path, and -v verbosity to global main_callback
  • Milestone: v3.7.0
  • Parent Epic: #936

Background

The specification (§CLI Commands, §Global Options) defines three global options that must be available for all commands via the top-level main_callback():

Option Description
--data-dir PATH Overrides the global data directory
--config-path PATH Overrides the global configuration file path
-v (repeatable) Increases log verbosity (up to -vvvvv for TRACE level)

The spec-defined global CLI signature is:

agents|cleveragents [--data-dir <DATA_PATH>] [--config-path <CONFIG_PATH>]
                     [--format (rich|color|table|plain|json|yaml)]
                     [--help|-h] [--version]
                     [--install-completion [<INST_SHELL>]] [--show-completion [<SHOW_SHELL>]]
                     [-v...] <COMMAND> [<ARGS>...]

Bug Description

The main_callback() function in src/cleveragents/cli/main.py only defines --version and --show-secrets:

@app.callback()
def main_callback(
    version: bool = typer.Option(None, "--version", ...),
    show_secrets: bool = typer.Option(False, "--show-secrets", ...),
) -> None:

--data-dir, --config-path, and -v are completely absent from the global callback.

Steps to Reproduce

agents --data-dir /tmp/test-data version
# Expected: version output using /tmp/test-data as data dir
# Actual:   Error: No such option: --data-dir

agents --config-path /custom/config.toml version
# Expected: version output using /custom/config.toml as config
# Actual:   Error: No such option: --config-path

agents -v diagnostics
# Expected: diagnostics with elevated log verbosity (ERROR level)
# Actual:   Error: No such option: -v

Expected Behaviour

All three options are accepted globally (before the subcommand) and propagate their effect to all subcommands:

  • --data-dir PATH sets the data directory for the session
  • --config-path PATH sets the config file path for the session
  • -v / -vv / -vvv / -vvvv / -vvvvv increases log verbosity from WARNING → ERROR → INFO → DEBUG → VERBOSE → TRACE

Actual Behaviour

All three options are unrecognised by Typer and produce Error: No such option at runtime.

Code Location

  • File: src/cleveragents/cli/main.py
  • Function: main_callback()

Severity

High — These are spec-required global options. Without --data-dir and --config-path, users cannot override the data directory or config path for any command. Without -v, users cannot increase log verbosity for debugging.

Subtasks

  • Add --data-dir PATH parameter to main_callback() with correct type annotation and Typer Option definition
  • Add --config-path PATH parameter to main_callback() with correct type annotation and Typer Option definition
  • Add -v (repeatable count) parameter to main_callback() mapping verbosity count to log level (WARNING=0, ERROR=1, INFO=2, DEBUG=3, VERBOSE=4, TRACE=5)
  • Wire --data-dir value into the application context / settings so all subcommands respect it
  • Wire --config-path value into the application context / settings so all subcommands respect it
  • Wire -v count into the logging configuration so log level is set before any subcommand runs
  • Write Behave BDD scenarios covering each new global option (happy path + edge cases)
  • Run nox -e typecheck — fix any Pyright errors
  • Run nox -e lint — fix any linting errors
  • Run nox -e unit_tests — all scenarios pass
  • Run nox -e coverage_report — coverage remains ≥ 97%
  • Run nox (all default sessions) — no failures

Definition of Done

  • agents --data-dir <PATH> <COMMAND> is accepted without error and the data directory is overridden for the duration of the command
  • agents --config-path <PATH> <COMMAND> is accepted without error and the config file path is overridden for the duration of the command
  • agents -v <COMMAND> through agents -vvvvv <COMMAND> are accepted without error and set the correct log level
  • All three options appear in agents --help output under global options
  • Behave scenarios cover all three new options
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/cli-missing-global-options` - **Commit Message**: `fix(cli): add --data-dir, --config-path, and -v verbosity to global main_callback` - **Milestone**: v3.7.0 - **Parent Epic**: #936 ## Background The specification (§CLI Commands, §Global Options) defines three global options that must be available for **all** commands via the top-level `main_callback()`: | Option | Description | |---|---| | `--data-dir PATH` | Overrides the global data directory | | `--config-path PATH` | Overrides the global configuration file path | | `-v` (repeatable) | Increases log verbosity (up to `-vvvvv` for TRACE level) | The spec-defined global CLI signature is: ``` agents|cleveragents [--data-dir <DATA_PATH>] [--config-path <CONFIG_PATH>] [--format (rich|color|table|plain|json|yaml)] [--help|-h] [--version] [--install-completion [<INST_SHELL>]] [--show-completion [<SHOW_SHELL>]] [-v...] <COMMAND> [<ARGS>...] ``` ## Bug Description The `main_callback()` function in `src/cleveragents/cli/main.py` only defines `--version` and `--show-secrets`: ```python @app.callback() def main_callback( version: bool = typer.Option(None, "--version", ...), show_secrets: bool = typer.Option(False, "--show-secrets", ...), ) -> None: ``` `--data-dir`, `--config-path`, and `-v` are completely absent from the global callback. ## Steps to Reproduce ```bash agents --data-dir /tmp/test-data version # Expected: version output using /tmp/test-data as data dir # Actual: Error: No such option: --data-dir agents --config-path /custom/config.toml version # Expected: version output using /custom/config.toml as config # Actual: Error: No such option: --config-path agents -v diagnostics # Expected: diagnostics with elevated log verbosity (ERROR level) # Actual: Error: No such option: -v ``` ## Expected Behaviour All three options are accepted globally (before the subcommand) and propagate their effect to all subcommands: - `--data-dir PATH` sets the data directory for the session - `--config-path PATH` sets the config file path for the session - `-v` / `-vv` / `-vvv` / `-vvvv` / `-vvvvv` increases log verbosity from WARNING → ERROR → INFO → DEBUG → VERBOSE → TRACE ## Actual Behaviour All three options are unrecognised by Typer and produce `Error: No such option` at runtime. ## Code Location - **File**: `src/cleveragents/cli/main.py` - **Function**: `main_callback()` ## Severity **High** — These are spec-required global options. Without `--data-dir` and `--config-path`, users cannot override the data directory or config path for any command. Without `-v`, users cannot increase log verbosity for debugging. ## Subtasks - [ ] Add `--data-dir PATH` parameter to `main_callback()` with correct type annotation and Typer `Option` definition - [ ] Add `--config-path PATH` parameter to `main_callback()` with correct type annotation and Typer `Option` definition - [ ] Add `-v` (repeatable count) parameter to `main_callback()` mapping verbosity count to log level (WARNING=0, ERROR=1, INFO=2, DEBUG=3, VERBOSE=4, TRACE=5) - [ ] Wire `--data-dir` value into the application context / settings so all subcommands respect it - [ ] Wire `--config-path` value into the application context / settings so all subcommands respect it - [ ] Wire `-v` count into the logging configuration so log level is set before any subcommand runs - [ ] Write Behave BDD scenarios covering each new global option (happy path + edge cases) - [ ] Run `nox -e typecheck` — fix any Pyright errors - [ ] Run `nox -e lint` — fix any linting errors - [ ] Run `nox -e unit_tests` — all scenarios pass - [ ] Run `nox -e coverage_report` — coverage remains ≥ 97% - [ ] Run `nox` (all default sessions) — no failures ## Definition of Done - [ ] `agents --data-dir <PATH> <COMMAND>` is accepted without error and the data directory is overridden for the duration of the command - [ ] `agents --config-path <PATH> <COMMAND>` is accepted without error and the config file path is overridden for the duration of the command - [ ] `agents -v <COMMAND>` through `agents -vvvvv <COMMAND>` are accepted without error and set the correct log level - [ ] All three options appear in `agents --help` output under global options - [ ] Behave scenarios cover all three new options - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 04:14:50 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High (confirmed) — Three spec-required global CLI options are completely missing. Users cannot override data directory, config path, or log verbosity for any command.
  • Milestone: v3.7.0 (confirmed — Output Rendering Pipeline Epic #936)
  • MoSCoW: Should Have — These are spec-defined global options. --data-dir and --config-path are essential for deployment flexibility. -v is essential for debugging. All three are referenced throughout the spec.
  • Parent Epic: #936 (confirmed correct)

Note: This is related to #2099 (missing global --format flag). Both issues stem from an incomplete main_callback() function.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: ca-project-owner

Issue triaged by project owner: - **State**: Verified - **Priority**: High (confirmed) — Three spec-required global CLI options are completely missing. Users cannot override data directory, config path, or log verbosity for any command. - **Milestone**: v3.7.0 (confirmed — Output Rendering Pipeline Epic #936) - **MoSCoW**: Should Have — These are spec-defined global options. `--data-dir` and `--config-path` are essential for deployment flexibility. `-v` is essential for debugging. All three are referenced throughout the spec. - **Parent Epic**: #936 (confirmed correct) Note: This is related to #2099 (missing global `--format` flag). Both issues stem from an incomplete `main_callback()` function. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Author
Owner

⚠️ Potential duplicate: Issue #2063 covers the same --data-dir and --config-path flags. This issue additionally covers the -v (verbosity) flag which is not in #2063.

Consider merging the -v verbosity requirement into #2063 and closing this issue, OR keeping this issue as the canonical one and closing #2063.

The two issues should not both remain open as they will lead to duplicate work.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

⚠️ **Potential duplicate**: Issue #2063 covers the same `--data-dir` and `--config-path` flags. This issue additionally covers the `-v` (verbosity) flag which is not in #2063. Consider merging the `-v` verbosity requirement into #2063 and closing this issue, OR keeping this issue as the canonical one and closing #2063. The two issues should not both remain open as they will lead to duplicate work. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
freemo self-assigned this 2026-04-03 16:58:04 +00:00
Author
Owner

Closing as duplicate of #2409.

Both issues describe the same bug: global CLI options --data-dir, --config-path, and -v (verbosity) are not implemented. Issue #2409 is the established tracking issue (v3.5.0 milestone). Please track this work in #2409.


Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Closing as duplicate of #2409. Both issues describe the same bug: global CLI options `--data-dir`, `--config-path`, and `-v` (verbosity) are not implemented. Issue #2409 is the established tracking issue (v3.5.0 milestone). Please track this work in #2409. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
cleveragents/cleveragents-core#2121
No description provided.