UAT: --data-dir and --config-path global CLI flags are missing from agents command — spec requires them as top-level options #2063

Closed
opened 2026-04-03 03:47:02 +00:00 by freemo · 1 comment
Owner

Metadata

  • Branch: fix/cli-add-data-dir-config-path-global-flags
  • Commit Message: fix(cli): add --data-dir and --config-path global flags to agents top-level command
  • Milestone: v3.7.0
  • Parent Epic: #936

Bug Report

Feature Area: CLI — top-level agents/cleveragents command global options

Severity: High

Parent Epic: #936 (Output Rendering Pipeline Integration)

Summary

The specification defines --data-dir and --config-path as global flags on the top-level agents/cleveragents command. These flags are entirely absent from the current implementation. The main_callback function in src/cleveragents/cli/main.py only accepts --version and --show-secrets as global options, with no mechanism to override the data directory or config file path via the CLI.

Spec Reference

From docs/specification.md:

agents|cleveragents [--data-dir <DATA_PATH>] [--config-path <CONFIG_PATH>]

With descriptions:

  • --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

Steps to Reproduce

  1. Run agents --data-dir /tmp/test-data info
  2. Expected: Uses /tmp/test-data as the data directory for all subcommands
  3. Actual: Error — --data-dir is not a recognized option

Actual Behavior

The main_callback function in src/cleveragents/cli/main.py (lines 292–311) only accepts --version and --show-secrets as global flags:

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

There is no --data-dir or --config-path option. While ConfigService in src/cleveragents/application/services/config_service.py does register core.data-dir (line 132), there is no mechanism to override it via a global CLI flag.

Expected Behavior

The agents command should accept --data-dir and --config-path as global options that override the default data directory and config file path for all subcommands, matching the spec-defined interface:

agents [--data-dir PATH] [--config-path PATH] <subcommand> [options]

Code Location

src/cleveragents/cli/main.pymain_callback function (lines 292–311)

Impact

High — this is a spec-required feature that affects all users who need to run multiple CleverAgents instances with different data directories (e.g., CI/CD environments, server mode, isolated test runs).

Subtasks

  • Add --data-dir optional Path parameter to main_callback in src/cleveragents/cli/main.py
  • Add --config-path optional Path parameter to main_callback in src/cleveragents/cli/main.py
  • Wire --data-dir override into ConfigService so all subcommands use the overridden data directory
  • Wire --config-path override into ConfigService so all subcommands load from the overridden config file path
  • Ensure both flags are propagated via Typer context so all subcommands inherit the overrides
  • Add/update Behave BDD scenarios verifying --data-dir and --config-path override behaviour
  • Add/update Robot Framework integration tests verifying end-to-end override behaviour
  • Verify coverage ≥ 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • agents --data-dir <PATH> correctly overrides the global data directory for all subcommands
  • agents --config-path <PATH> correctly overrides the global config file path for all subcommands
  • Both flags are visible in agents --help output with descriptions matching the spec
  • The example agents --data-dir /srv/cleveragents --config-path /srv/cleveragents/config.toml info works as specified
  • All subtasks above are completed and checked off
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done
  • All nox stages pass
  • Coverage ≥ 97%

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

## Metadata - **Branch**: `fix/cli-add-data-dir-config-path-global-flags` - **Commit Message**: `fix(cli): add --data-dir and --config-path global flags to agents top-level command` - **Milestone**: v3.7.0 - **Parent Epic**: #936 ## Bug Report **Feature Area:** CLI — top-level `agents`/`cleveragents` command global options **Severity:** High **Parent Epic:** #936 (Output Rendering Pipeline Integration) ### Summary The specification defines `--data-dir` and `--config-path` as global flags on the top-level `agents`/`cleveragents` command. These flags are entirely absent from the current implementation. The `main_callback` function in `src/cleveragents/cli/main.py` only accepts `--version` and `--show-secrets` as global options, with no mechanism to override the data directory or config file path via the CLI. ### Spec Reference From `docs/specification.md`: ``` agents|cleveragents [--data-dir <DATA_PATH>] [--config-path <CONFIG_PATH>] ``` With descriptions: - `--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 ``` ### Steps to Reproduce 1. Run `agents --data-dir /tmp/test-data info` 2. **Expected**: Uses `/tmp/test-data` as the data directory for all subcommands 3. **Actual**: Error — `--data-dir` is not a recognized option ### Actual Behavior The `main_callback` function in `src/cleveragents/cli/main.py` (lines 292–311) only accepts `--version` and `--show-secrets` as global flags: ```python @app.callback() def main_callback( ctx: typer.Context, version: bool = typer.Option(False, "--version", ...), show_secrets: bool = typer.Option(False, "--show-secrets", ...), ) -> None: ... ``` There is no `--data-dir` or `--config-path` option. While `ConfigService` in `src/cleveragents/application/services/config_service.py` does register `core.data-dir` (line 132), there is no mechanism to override it via a global CLI flag. ### Expected Behavior The `agents` command should accept `--data-dir` and `--config-path` as global options that override the default data directory and config file path for all subcommands, matching the spec-defined interface: ``` agents [--data-dir PATH] [--config-path PATH] <subcommand> [options] ``` ### Code Location `src/cleveragents/cli/main.py` — `main_callback` function (lines 292–311) ### Impact High — this is a spec-required feature that affects all users who need to run multiple CleverAgents instances with different data directories (e.g., CI/CD environments, server mode, isolated test runs). ## Subtasks - [ ] Add `--data-dir` optional `Path` parameter to `main_callback` in `src/cleveragents/cli/main.py` - [ ] Add `--config-path` optional `Path` parameter to `main_callback` in `src/cleveragents/cli/main.py` - [ ] Wire `--data-dir` override into `ConfigService` so all subcommands use the overridden data directory - [ ] Wire `--config-path` override into `ConfigService` so all subcommands load from the overridden config file path - [ ] Ensure both flags are propagated via Typer context so all subcommands inherit the overrides - [ ] Add/update Behave BDD scenarios verifying `--data-dir` and `--config-path` override behaviour - [ ] Add/update Robot Framework integration tests verifying end-to-end override behaviour - [ ] Verify coverage ≥ 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - `agents --data-dir <PATH>` correctly overrides the global data directory for all subcommands - `agents --config-path <PATH>` correctly overrides the global config file path for all subcommands - Both flags are visible in `agents --help` output with descriptions matching the spec - The example `agents --data-dir /srv/cleveragents --config-path /srv/cleveragents/config.toml info` works as specified - All subtasks above are completed and checked off - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done - 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 03:47:08 +00:00
freemo self-assigned this 2026-04-03 16:58:11 +00:00
Author
Owner

Closing as duplicate of #2409.

Both issues describe the same bug: --data-dir and --config-path global CLI flags are missing from the agents command. 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: `--data-dir` and `--config-path` global CLI flags are missing from the `agents` command. 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#2063
No description provided.