UAT: Global CLI options --data-dir, --config-path, --format, and -v not implemented on main app #1367

Closed
opened 2026-04-02 16:59:22 +00:00 by freemo · 1 comment
Owner

Bug Report

Feature Area: CLI integration — global options

Severity: High

Summary

The specification defines four global options that should be available on every cleveragents invocation, but none of them are implemented on the main Typer app callback. Attempting to use them results in an error.

Steps to Reproduce

uv run cleveragents --data-dir /tmp/mydata info
uv run cleveragents --config-path /tmp/myconfig.toml info
uv run cleveragents --format json plan list
uv run cleveragents -v version

Actual Behavior

Wrapping unexpected exception: NoSuchOption: No such option: --data-dir
Error [500] INTERNAL: An unexpected error occurred

Wrapping unexpected exception: NoSuchOption: No such option: --config-path
Error [500] INTERNAL: An unexpected error occurred

Wrapping unexpected exception: NoSuchOption: No such option: --format
Error [500] INTERNAL: An unexpected error occurred

Wrapping unexpected exception: NoSuchOption: No such option: -v
Error [500] INTERNAL: An unexpected error occurred

Expected Behavior

Per the specification (Command Synopsis and Global Options section):

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>...]
  • --data-dir PATH: Override the global data directory for this invocation
  • --config-path PATH: Override the global configuration file path for this invocation
  • --format rich|color|table|plain|json|yaml: Set output format for all subcommands (reads from core.format config if omitted, defaults to rich)
  • -v (repeatable): Increase log verbosity (-v=ERROR, -vv=WARN, -vvv=INFO, -vvvv=DEBUG, -vvvvv=TRACE)

Root Cause

In src/cleveragents/cli/main.py, the main_callback() function (lines 278–296) only defines --version and --show-secrets options. The four spec-required global options are absent.

File: src/cleveragents/cli/main.py, lines 278–296

@app.callback()
def main_callback(
    version: bool = typer.Option(...),
    show_secrets: bool = typer.Option(...),
    # ← MISSING: --data-dir, --config-path, --format, -v
) -> None:

Impact

  • Scripts and CI pipelines that rely on --format json at the global level fail
  • Users cannot override data/config paths per-invocation (required for multi-environment setups)
  • Verbosity control (-v) is unavailable globally (some subcommands have their own -v but it's not consistent)
  • The spec example agents --data-dir /srv/cleveragents --config-path /srv/cleveragents/config.toml info fails entirely

Note

--install-completion and --show-completion work because they are handled by Typer's built-in completion mechanism, not by the app callback.

## Bug Report **Feature Area:** CLI integration — global options **Severity:** High ### Summary The specification defines four global options that should be available on every `cleveragents` invocation, but none of them are implemented on the main Typer app callback. Attempting to use them results in an error. ### Steps to Reproduce ```bash uv run cleveragents --data-dir /tmp/mydata info uv run cleveragents --config-path /tmp/myconfig.toml info uv run cleveragents --format json plan list uv run cleveragents -v version ``` ### Actual Behavior ``` Wrapping unexpected exception: NoSuchOption: No such option: --data-dir Error [500] INTERNAL: An unexpected error occurred Wrapping unexpected exception: NoSuchOption: No such option: --config-path Error [500] INTERNAL: An unexpected error occurred Wrapping unexpected exception: NoSuchOption: No such option: --format Error [500] INTERNAL: An unexpected error occurred Wrapping unexpected exception: NoSuchOption: No such option: -v Error [500] INTERNAL: An unexpected error occurred ``` ### Expected Behavior Per the specification (Command Synopsis and Global Options section): ``` 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>...] ``` - `--data-dir PATH`: Override the global data directory for this invocation - `--config-path PATH`: Override the global configuration file path for this invocation - `--format rich|color|table|plain|json|yaml`: Set output format for all subcommands (reads from `core.format` config if omitted, defaults to `rich`) - `-v` (repeatable): Increase log verbosity (`-v`=ERROR, `-vv`=WARN, `-vvv`=INFO, `-vvvv`=DEBUG, `-vvvvv`=TRACE) ### Root Cause In `src/cleveragents/cli/main.py`, the `main_callback()` function (lines 278–296) only defines `--version` and `--show-secrets` options. The four spec-required global options are absent. **File:** `src/cleveragents/cli/main.py`, lines 278–296 ```python @app.callback() def main_callback( version: bool = typer.Option(...), show_secrets: bool = typer.Option(...), # ← MISSING: --data-dir, --config-path, --format, -v ) -> None: ``` ### Impact - Scripts and CI pipelines that rely on `--format json` at the global level fail - Users cannot override data/config paths per-invocation (required for multi-environment setups) - Verbosity control (`-v`) is unavailable globally (some subcommands have their own `-v` but it's not consistent) - The spec example `agents --data-dir /srv/cleveragents --config-path /srv/cleveragents/config.toml info` fails entirely ### Note `--install-completion` and `--show-completion` work because they are handled by Typer's built-in completion mechanism, not by the app callback.
freemo self-assigned this 2026-04-02 18:45:18 +00:00
Member

Duplicate — consolidated into #6785.

This ticket describes the same issue as #2409, #3615, #3747, #5192, #5497, #5712, and #6878: the global CLI options --data-dir, --config-path, and -v are missing from main_callback() in src/cleveragents/cli/main.py.

All content from this ticket has been aggregated into #6785, which is now the canonical tracking issue. This ticket is being closed as a duplicate. Please follow and comment on #6785 going forward.

**Duplicate — consolidated into #6785.** This ticket describes the same issue as #2409, #3615, #3747, #5192, #5497, #5712, and #6878: the global CLI options `--data-dir`, `--config-path`, and `-v` are missing from `main_callback()` in `src/cleveragents/cli/main.py`. All content from this ticket has been aggregated into **#6785**, which is now the canonical tracking issue. This ticket is being closed as a duplicate. Please follow and comment on #6785 going forward.
hurui200320 2026-05-11 06:14:30 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

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