UAT: Global --data-dir and --config-path options missing from CLI — spec requires them on all commands #5497

Closed
opened 2026-04-09 07:05:34 +00:00 by HAL9000 · 3 comments
Owner

Summary

The spec defines two global options that should be available on every command:

  • --data-dir PATH: Override the global data directory (database, caches, sessions, logs)
  • --config-path PATH: Override the global configuration file path

Neither option is implemented in src/cleveragents/cli/main.py. The main_callback() function only has --version, --show-secrets, and --format global options.

Expected Behavior (from spec)

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>...]

From docs/specification.md line 383-384:

  • --data-dir PATH: Overrides the global data directory (database, caches, sessions, logs). When omitted, the default data location is used.
  • --config-path PATH: Overrides the global configuration file path. When omitted, the default config path is used.

Example from spec:

$ agents --data-dir /srv/cleveragents --config-path /srv/cleveragents/config.toml info

Actual Behavior

# src/cleveragents/cli/main.py lines 293-334
@app.callback()
def main_callback(
    ctx: typer.Context,
    version: bool = typer.Option(None, "--version", ...),
    show_secrets: bool = typer.Option(False, "--show-secrets", ...),
    fmt: Annotated[OutputFormat, typer.Option("--format", "-f", ...)] = OutputFormat.RICH,
) -> None:
    # No --data-dir option
    # No --config-path option

Code Location

  • File: src/cleveragents/cli/main.py
  • Function: main_callback() at line 293
  • Missing: --data-dir and --config-path parameters

Spec Reference

  • docs/specification.md lines 207-401: Global options section

Impact

  • Users cannot override the data directory for multi-environment setups
  • Users cannot specify a custom config file path
  • The example agents --data-dir /srv/cleveragents info fails with "Error: Invalid command '--data-dir'"
  • Server deployments and CI/CD pipelines that need custom data paths cannot use the CLI

Subtasks

  • Add --data-dir PATH option to main_callback() in main.py
  • Add --config-path PATH option to main_callback() in main.py
  • Wire --data-dir to the container's database URL and data directory configuration
  • Wire --config-path to the config service's file path
  • Store both values in ctx.obj for subcommands to access
  • Add unit tests for both global options
  • Add integration test: agents --data-dir /tmp/test-data info works correctly

Definition of Done

  • agents --data-dir /tmp/mydata info uses /tmp/mydata as the data directory
  • agents --config-path /tmp/myconfig.toml info uses the specified config file
  • Both options are shown in agents --help output
  • Both options are passed through to all subcommands via ctx.obj
  • Unit tests pass

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Summary The spec defines two global options that should be available on every command: - `--data-dir PATH`: Override the global data directory (database, caches, sessions, logs) - `--config-path PATH`: Override the global configuration file path Neither option is implemented in `src/cleveragents/cli/main.py`. The `main_callback()` function only has `--version`, `--show-secrets`, and `--format` global options. ## Expected Behavior (from spec) ``` 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>...] ``` From `docs/specification.md` line 383-384: - `--data-dir PATH`: Overrides the global data directory (database, caches, sessions, logs). When omitted, the default data location is used. - `--config-path PATH`: Overrides the global configuration file path. When omitted, the default config path is used. Example from spec: ``` $ agents --data-dir /srv/cleveragents --config-path /srv/cleveragents/config.toml info ``` ## Actual Behavior ```python # src/cleveragents/cli/main.py lines 293-334 @app.callback() def main_callback( ctx: typer.Context, version: bool = typer.Option(None, "--version", ...), show_secrets: bool = typer.Option(False, "--show-secrets", ...), fmt: Annotated[OutputFormat, typer.Option("--format", "-f", ...)] = OutputFormat.RICH, ) -> None: # No --data-dir option # No --config-path option ``` ## Code Location - **File**: `src/cleveragents/cli/main.py` - **Function**: `main_callback()` at line 293 - **Missing**: `--data-dir` and `--config-path` parameters ## Spec Reference - `docs/specification.md` lines 207-401: Global options section ## Impact - Users cannot override the data directory for multi-environment setups - Users cannot specify a custom config file path - The example `agents --data-dir /srv/cleveragents info` fails with "Error: Invalid command '--data-dir'" - Server deployments and CI/CD pipelines that need custom data paths cannot use the CLI ## Subtasks - [ ] Add `--data-dir PATH` option to `main_callback()` in `main.py` - [ ] Add `--config-path PATH` option to `main_callback()` in `main.py` - [ ] Wire `--data-dir` to the container's database URL and data directory configuration - [ ] Wire `--config-path` to the config service's file path - [ ] Store both values in `ctx.obj` for subcommands to access - [ ] Add unit tests for both global options - [ ] Add integration test: `agents --data-dir /tmp/test-data info` works correctly ## Definition of Done - `agents --data-dir /tmp/mydata info` uses `/tmp/mydata` as the data directory - `agents --config-path /tmp/myconfig.toml info` uses the specified config file - Both options are shown in `agents --help` output - Both options are passed through to all subcommands via `ctx.obj` - Unit tests pass --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — (adjusting from Critical) global --data-dir and --config-path options are missing from the CLI. The spec requires these on all commands for configuring data directory and config file paths. Without them, users cannot customize these paths.
  • Milestone: v3.2.0 — CLI configuration is a core v3.2.0 feature
  • Story Points: 3 — M — requires adding global options to the Typer app and wiring them through the dependency injection system
  • MoSCoW: Should Have — the spec documents these options, but the system works with default paths. Not blocking core functionality.
  • Parent Epic: Needs linking to the CLI configuration epic

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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — (adjusting from Critical) global `--data-dir` and `--config-path` options are missing from the CLI. The spec requires these on all commands for configuring data directory and config file paths. Without them, users cannot customize these paths. - **Milestone**: v3.2.0 — CLI configuration is a core v3.2.0 feature - **Story Points**: 3 — M — requires adding global options to the Typer app and wiring them through the dependency injection system - **MoSCoW**: Should Have — the spec documents these options, but the system works with default paths. Not blocking core functionality. - **Parent Epic**: Needs linking to the CLI configuration epic --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
HAL9000 added this to the v3.2.0 milestone 2026-04-09 07:12:12 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md

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

Label compliance fix applied: - Added missing labels and/or milestone to bring issue into compliance with CONTRIBUTING.md --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
Member

Duplicate — consolidated into #6785.

This ticket describes the same issue as #1367, #2409, #3615, #3747, #5192, #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 #1367, #2409, #3615, #3747, #5192, #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:33 +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#5497
No description provided.