UAT: Global CLI options --data-dir and --config-path are not implemented — spec requires both #2409

Closed
opened 2026-04-03 17:36:29 +00:00 by freemo · 2 comments
Owner

Background and Context

The specification (docs/specification.md) defines two global options that must be available on all agents commands:

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

These flags allow users to override the global data directory and configuration file path for any command invocation. They are essential for multi-environment workflows (dev/staging/prod) and CI/CD pipelines where the default paths are not appropriate.

This issue was discovered during UAT testing of the CLI Commands feature area by instance uat-tester-cli-worker (pool supervisor session uat-pool-1, tracking issue #2360).


Current Behavior

The main_callback() function in src/cleveragents/cli/main.py (lines ~175–200) only defines --version and --show-secrets as global options. Neither --data-dir nor --config-path are defined anywhere in the CLI callback chain. The valid_cmds list in main() does not include these flags either.

Steps to reproduce:

agents --data-dir /tmp/mydata project list
# Expected: uses /tmp/mydata as data directory
# Actual:   Error: No such option: --data-dir

agents --config-path /tmp/myconfig.toml version
# Expected: uses /tmp/myconfig.toml as config
# Actual:   Error: No such option: --config-path

Code location: src/cleveragents/cli/main.py, main_callback() function


Expected Behavior

Both --data-dir <DATA_PATH> and --config-path <CONFIG_PATH> should be accepted as global options on the main app Typer callback, allowing users to override the data directory and config file path for any command invocation. The resolved paths must be propagated to all downstream services (config loader, data directory resolver) before any subcommand executes.


Acceptance Criteria

  • agents --data-dir <PATH> <any-subcommand> is accepted without error and uses <PATH> as the data directory
  • agents --config-path <PATH> <any-subcommand> is accepted without error and uses <PATH> as the config file
  • Both flags can be combined: agents --data-dir /d --config-path /c.toml <subcommand>
  • Invalid/non-existent paths produce a clear, actionable error message
  • All existing CLI tests continue to pass
  • New Behave scenarios cover both flags individually and in combination
  • New Robot integration test verifies path override propagation end-to-end

Metadata

  • Branch: tdd/m6-global-cli-options
  • Commit Message: fix(cli): add --data-dir and --config-path global options to main callback
  • Milestone: v3.5.0
  • Parent Epic: #397

Subtasks

  • Write failing Behave scenario: agents --data-dir is accepted and propagated
  • Write failing Behave scenario: agents --config-path is accepted and propagated
  • Write failing Robot integration test for path override propagation
  • Add --data-dir Typer option to main_callback() in src/cleveragents/cli/main.py
  • Add --config-path Typer option to main_callback() in src/cleveragents/cli/main.py
  • Wire resolved paths into config loader and data directory resolver before subcommand dispatch
  • Add validation: emit clear error for invalid/non-existent paths
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • 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

## Background and Context The specification (`docs/specification.md`) defines two global options that must be available on **all** `agents` commands: ``` agents|cleveragents [--data-dir <DATA_PATH>] [--config-path <CONFIG_PATH>] ... ``` These flags allow users to override the global data directory and configuration file path for any command invocation. They are essential for multi-environment workflows (dev/staging/prod) and CI/CD pipelines where the default paths are not appropriate. This issue was discovered during UAT testing of the **CLI Commands** feature area by instance `uat-tester-cli-worker` (pool supervisor session `uat-pool-1`, tracking issue #2360). --- ## Current Behavior The `main_callback()` function in `src/cleveragents/cli/main.py` (lines ~175–200) only defines `--version` and `--show-secrets` as global options. Neither `--data-dir` nor `--config-path` are defined anywhere in the CLI callback chain. The `valid_cmds` list in `main()` does not include these flags either. **Steps to reproduce:** ```bash agents --data-dir /tmp/mydata project list # Expected: uses /tmp/mydata as data directory # Actual: Error: No such option: --data-dir agents --config-path /tmp/myconfig.toml version # Expected: uses /tmp/myconfig.toml as config # Actual: Error: No such option: --config-path ``` **Code location:** `src/cleveragents/cli/main.py`, `main_callback()` function --- ## Expected Behavior Both `--data-dir <DATA_PATH>` and `--config-path <CONFIG_PATH>` should be accepted as global options on the main `app` Typer callback, allowing users to override the data directory and config file path for any command invocation. The resolved paths must be propagated to all downstream services (config loader, data directory resolver) before any subcommand executes. --- ## Acceptance Criteria - [ ] `agents --data-dir <PATH> <any-subcommand>` is accepted without error and uses `<PATH>` as the data directory - [ ] `agents --config-path <PATH> <any-subcommand>` is accepted without error and uses `<PATH>` as the config file - [ ] Both flags can be combined: `agents --data-dir /d --config-path /c.toml <subcommand>` - [ ] Invalid/non-existent paths produce a clear, actionable error message - [ ] All existing CLI tests continue to pass - [ ] New Behave scenarios cover both flags individually and in combination - [ ] New Robot integration test verifies path override propagation end-to-end --- ## Metadata - **Branch**: `tdd/m6-global-cli-options` - **Commit Message**: `fix(cli): add --data-dir and --config-path global options to main callback` - **Milestone**: v3.5.0 - **Parent Epic**: #397 --- ## Subtasks - [ ] Write failing Behave scenario: `agents --data-dir` is accepted and propagated - [ ] Write failing Behave scenario: `agents --config-path` is accepted and propagated - [ ] Write failing Robot integration test for path override propagation - [ ] Add `--data-dir` Typer option to `main_callback()` in `src/cleveragents/cli/main.py` - [ ] Add `--config-path` Typer option to `main_callback()` in `src/cleveragents/cli/main.py` - [ ] Wire resolved paths into config loader and data directory resolver before subcommand dispatch - [ ] Add validation: emit clear error for invalid/non-existent paths - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors --- ## Definition of Done This issue is complete when: - 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.5.0 milestone 2026-04-03 17:36:36 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — The specification explicitly requires --data-dir and --config-path as global CLI options. These are essential for multi-environment workflows and CI/CD pipelines.
  • Milestone: v3.5.0 (as specified in issue metadata)
  • MoSCoW: Should Have — These global options are spec-required and important for production use cases, but the application functions with default paths for development.
  • Parent Epic: Needs assignment (issue metadata does not specify one — will link to Epic #397 Server & Autonomy Infrastructure as the closest match for CLI infrastructure)

The issue is well-described with clear spec references and definition of done. Valid and actionable.


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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — The specification explicitly requires `--data-dir` and `--config-path` as global CLI options. These are essential for multi-environment workflows and CI/CD pipelines. - **Milestone**: v3.5.0 (as specified in issue metadata) - **MoSCoW**: Should Have — These global options are spec-required and important for production use cases, but the application functions with default paths for development. - **Parent Epic**: Needs assignment (issue metadata does not specify one — will link to Epic #397 Server & Autonomy Infrastructure as the closest match for CLI infrastructure) The issue is well-described with clear spec references and definition of done. Valid and actionable. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: ca-project-owner
Member

Duplicate — consolidated into #6785.

This ticket describes the same issue as #1367, #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 #1367, #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.
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.

Blocks
#397 Epic: Server & Autonomy Infrastructure
cleveragents/cleveragents-core
Reference
cleveragents/cleveragents-core#2409
No description provided.