fix(cli): add missing --format flag to action create command #959

Closed
opened 2026-03-15 22:13:34 +00:00 by freemo · 0 comments
Owner

Metadata

  • Commit Message: fix(cli): add missing --format flag to action create command
  • Branch: bugfix/m2-action-format-plan-executor

Background

The action create CLI command is the only action subcommand missing the --format/-f parameter. All other action subcommands (list, show, archive) accept --format and pass it through to _print_action(). The M2 E2E acceptance test (PR #793) calls action create --config action.yaml --format plain, which Typer rejects as an unknown option, causing the test to fail at Step 4.

Current Behavior

Running agents action create --config action.yaml --format plain fails with a Typer error because --format is not a recognized option for the create subcommand. The _print_action() helper (line 134 of action.py) already accepts and handles the fmt parameter for all formats.

Expected Behavior

The action create command should accept --format/-f (defaulting to rich) and pass it to _print_action(), consistent with every other action subcommand.

Acceptance Criteria

  • agents action create --config action.yaml --format plain succeeds and produces plain-text output
  • agents action create --config action.yaml --format json succeeds and produces JSON output
  • agents action create --config action.yaml (no --format) defaults to rich (unchanged behavior)
  • All existing action CLI tests continue to pass
  • Coverage >= 97% maintained

Subtasks

  • Add fmt parameter to the create() function signature in action.py
  • Pass fmt=fmt to the _print_action() call on line 250
  • Tests (Behave): Add BDD scenario for action create --format plain
  • Tests (Robot): Verify existing Robot tests still pass
  • Update CHANGELOG.md
  • 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.
## Metadata - **Commit Message**: `fix(cli): add missing --format flag to action create command` - **Branch**: `bugfix/m2-action-format-plan-executor` ## Background The `action create` CLI command is the only action subcommand missing the `--format`/`-f` parameter. All other action subcommands (`list`, `show`, `archive`) accept `--format` and pass it through to `_print_action()`. The M2 E2E acceptance test (PR #793) calls `action create --config action.yaml --format plain`, which Typer rejects as an unknown option, causing the test to fail at Step 4. ## Current Behavior Running `agents action create --config action.yaml --format plain` fails with a Typer error because `--format` is not a recognized option for the `create` subcommand. The `_print_action()` helper (line 134 of `action.py`) already accepts and handles the `fmt` parameter for all formats. ## Expected Behavior The `action create` command should accept `--format`/`-f` (defaulting to `rich`) and pass it to `_print_action()`, consistent with every other action subcommand. ## Acceptance Criteria - [ ] `agents action create --config action.yaml --format plain` succeeds and produces plain-text output - [ ] `agents action create --config action.yaml --format json` succeeds and produces JSON output - [ ] `agents action create --config action.yaml` (no `--format`) defaults to `rich` (unchanged behavior) - [ ] All existing action CLI tests continue to pass - [ ] Coverage >= 97% maintained ## Subtasks - [ ] Add `fmt` parameter to the `create()` function signature in `action.py` - [ ] Pass `fmt=fmt` to the `_print_action()` call on line 250 - [ ] Tests (Behave): Add BDD scenario for `action create --format plain` - [ ] Tests (Robot): Verify existing Robot tests still pass - [ ] Update CHANGELOG.md - [ ] 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.
freemo added this to the v3.1.0 milestone 2026-03-15 22:13:58 +00:00
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.

Dependencies

No dependencies set.

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