agents init --yes does not exist. #522

Closed
opened 2026-03-03 00:29:18 +00:00 by brent.edwards · 1 comment
Member

Metadata

  • Commit Message: fix(cli): add --yes flag to agents init for non-interactive setup
  • Branch: feature/m3-fix-init-yes-flag

Background and Context

According to the specification (Workflow Examples, Example 1, Step 1), agents init --yes should perform a non-interactive initialization. Currently it raises NoSuchOption: --yes because the --yes flag is not implemented in the CLI init command at src/cleveragents/cli/commands/project.py.

$ agents init --yes
Wrapping unexpected exception: NoSuchOption: No such option: --yes
Error [500] INTERNAL: An unexpected error occurred

Expected Behavior

agents init --yes completes without error, skips interactive prompts, uses default values, and produces the expected output showing data dir, config file, database, and directories created.

Acceptance Criteria

  • agents init --yes completes without error.
  • --yes flag skips all interactive prompts and applies defaults.
  • Output includes initialization summary (data dir, config, database, directories).
  • agents init without --yes continues to work as before (interactive mode if applicable).
  • All failing tests from #536 now pass.

Definition of Done

This issue is complete when:

  • All subtasks below 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.

Subtasks

  • Code [freemo]: Add --yes / -y option to the init command in src/cleveragents/cli/commands/project.py. When --yes is passed, skip any interactive prompts and use default values for all configuration options.
  • Code [freemo]: Ensure the --yes flag produces the expected output format as documented in the specification.
  • Code [freemo]: Add the --yes flag to the CLI help text with a clear description.
  • Docs [freemo]: Update docs/reference/cli.md if it documents the init command, to include the --yes flag.
  • Tests (Behave) [freemo]: Verify that all Behave scenarios from #536 now pass with the fix applied.
  • Tests (Robot) [freemo]: Verify the Robot smoke test from #536 passes.
  • Tests (ASV) [freemo]: Verify the ASV benchmark from #536 runs correctly.
  • Quality [freemo]: Verify coverage >=97% via nox -s coverage_report. If coverage is <97% then review the current unit test coverage report at build/coverage.xml and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun nox -s coverage_report to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%.
  • Quality [freemo]: Run nox (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across entire code base, do not ignore any failure even if it seems unrelated to this commit, fix it.

Parent: #401
Blocked by: #536

## Metadata - **Commit Message**: `fix(cli): add --yes flag to agents init for non-interactive setup` - **Branch**: `feature/m3-fix-init-yes-flag` ## Background and Context According to the specification (Workflow Examples, Example 1, Step 1), `agents init --yes` should perform a non-interactive initialization. Currently it raises `NoSuchOption: --yes` because the `--yes` flag is not implemented in the CLI init command at `src/cleveragents/cli/commands/project.py`. ``` $ agents init --yes Wrapping unexpected exception: NoSuchOption: No such option: --yes Error [500] INTERNAL: An unexpected error occurred ``` ## Expected Behavior `agents init --yes` completes without error, skips interactive prompts, uses default values, and produces the expected output showing data dir, config file, database, and directories created. ## Acceptance Criteria - [ ] `agents init --yes` completes without error. - [ ] `--yes` flag skips all interactive prompts and applies defaults. - [ ] Output includes initialization summary (data dir, config, database, directories). - [ ] `agents init` without `--yes` continues to work as before (interactive mode if applicable). - [ ] All failing tests from #536 now pass. ## Definition of Done This issue is complete when: - All subtasks below 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. ## Subtasks - [ ] Code [freemo]: Add `--yes` / `-y` option to the `init` command in `src/cleveragents/cli/commands/project.py`. When `--yes` is passed, skip any interactive prompts and use default values for all configuration options. - [ ] Code [freemo]: Ensure the `--yes` flag produces the expected output format as documented in the specification. - [ ] Code [freemo]: Add the `--yes` flag to the CLI help text with a clear description. - [ ] Docs [freemo]: Update `docs/reference/cli.md` if it documents the `init` command, to include the `--yes` flag. - [ ] Tests (Behave) [freemo]: Verify that all Behave scenarios from #536 now pass with the fix applied. - [ ] Tests (Robot) [freemo]: Verify the Robot smoke test from #536 passes. - [ ] Tests (ASV) [freemo]: Verify the ASV benchmark from #536 runs correctly. - [ ] Quality [freemo]: Verify coverage >=97% via `nox -s coverage_report`. If coverage is <97% then review the current unit test coverage report at `build/coverage.xml` and use it to write new Behave based unit tests to improve code coverage. Specifically, write Behave style unit tests that are descriptively named and specifically improve coverage on whichever file has the most uncovered lines by writing tests that will target the uncovered lines in the report. Once that is done rerun `nox -s coverage_report` to verify all tests pass and coverage is above >=97%. Only mark this as complete once coverage is >=97%, if not repeat this task as many times as is needed until coverage reaches >=97%. - [ ] Quality [freemo]: Run `nox` (all default sessions, including benchmark), fix any errors if needed ensuring nox passes across **entire** code base, do not ignore any failure even if it seems unrelated to this commit, fix it. Parent: #401 Blocked by: #536
freemo added this to the v3.2.0 milestone 2026-03-04 00:42:05 +00:00
freemo self-assigned this 2026-03-04 01:41:11 +00:00
Owner

Implementation Summary

Design Decisions & Rationale

The --yes/-y flag was added to both the top-level agents init command and the agents project init subcommand. Both delegate to a shared init_command() function in project.py, which now accepts a yes boolean parameter.

When yes=True, the command:

  1. Skips all interactive prompts (no confirmation dialogs)
  2. Uses default values for all configuration options
  3. Produces spec-aligned output format matching docs/specification.md lines 1381-1389

The spec output format includes:

  • Data Dir: path to the .cleveragents directory
  • Config: path to config.toml
  • Database: initialization status with schema version
  • Directories: logs, cache, sessions, contexts
  • Status message: Initialized (non-interactive)

When yes=False (default), the existing interactive behavior is preserved unchanged.

Key Code Locations

File Function Change
src/cleveragents/cli/commands/project.py init_command() (line 176) Added yes: bool = False parameter; when True, produces spec-aligned output panel with Data Dir, Config, Database, Directories fields
src/cleveragents/cli/commands/project.py init() (line 371) Added --yes/-y Typer option, passed to init_command()
src/cleveragents/cli/main.py init() (line 352) Added --yes/-y Typer option to top-level init command, passed to project_init_command()

Test Results

  • Unit Tests (Behave): 8937 scenarios passed, 0 failed, 4 skipped
  • Integration Tests (Robot): 1282 tests passed, 0 failed
  • Benchmarks (ASV): 1568 benchmarks run successfully
  • Coverage: 97.07% (meets >=97% requirement)
  • Lint: All checks passed (ruff)
  • Type Check: 0 errors, 0 warnings (pyright)
  • Security Scan: Passed (bandit + semgrep + vulture)
  • Dead Code: No unreferenced code detected
  • Docs Build: Successful
  • Format: All 1132 files properly formatted
## Implementation Summary ### Design Decisions & Rationale The `--yes`/`-y` flag was added to both the top-level `agents init` command and the `agents project init` subcommand. Both delegate to a shared `init_command()` function in `project.py`, which now accepts a `yes` boolean parameter. When `yes=True`, the command: 1. Skips all interactive prompts (no confirmation dialogs) 2. Uses default values for all configuration options 3. Produces spec-aligned output format matching `docs/specification.md` lines 1381-1389 The spec output format includes: - **Data Dir**: path to the `.cleveragents` directory - **Config**: path to `config.toml` - **Database**: initialization status with schema version - **Directories**: `logs, cache, sessions, contexts` - Status message: `Initialized (non-interactive)` When `yes=False` (default), the existing interactive behavior is preserved unchanged. ### Key Code Locations | File | Function | Change | |------|----------|--------| | `src/cleveragents/cli/commands/project.py` | `init_command()` (line 176) | Added `yes: bool = False` parameter; when True, produces spec-aligned output panel with Data Dir, Config, Database, Directories fields | | `src/cleveragents/cli/commands/project.py` | `init()` (line 371) | Added `--yes`/`-y` Typer option, passed to `init_command()` | | `src/cleveragents/cli/main.py` | `init()` (line 352) | Added `--yes`/`-y` Typer option to top-level init command, passed to `project_init_command()` | ### Test Results - **Unit Tests (Behave)**: 8937 scenarios passed, 0 failed, 4 skipped - **Integration Tests (Robot)**: 1282 tests passed, 0 failed - **Benchmarks (ASV)**: 1568 benchmarks run successfully - **Coverage**: 97.07% (meets >=97% requirement) - **Lint**: All checks passed (ruff) - **Type Check**: 0 errors, 0 warnings (pyright) - **Security Scan**: Passed (bandit + semgrep + vulture) - **Dead Code**: No unreferenced code detected - **Docs Build**: Successful - **Format**: All 1132 files properly formatted
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#522
No description provided.