Skip to content

feat(cli): migrate flow-run command to cyclopts (wave 3b)#20673

Draft
zzstoatzz wants to merge 1 commit intomainfrom
cli-cyclopts/wave-3b
Draft

feat(cli): migrate flow-run command to cyclopts (wave 3b)#20673
zzstoatzz wants to merge 1 commit intomainfrom
cli-cyclopts/wave-3b

Conversation

@zzstoatzz
Copy link
Collaborator

Native cyclopts implementation of all flow-run subcommands, replacing the delegation stub that forwarded to typer.

flow-run is an atomic unit — once registered as a native app, all subcommands must exist — so this includes all 7 commands in one PR (635 LOC, above the usual 500 target).

What changed

  • New: src/prefect/cli/_cyclopts/flow_run.py — inspect, ls, delete, cancel, retry, logs, execute + _get_flow_run_by_id_or_name helper
  • Wiring: replaced delegated stub with native import, removed "flow-run" from _DELEGATED_COMMANDS, added to _CYCLOPTS_COMMANDS
  • Tests: mock_webbrowser fixture patches webbrowser.open_new_tab on the module directly (works for both import paths); delete uses prefect.cli._prompts.confirm instead of typer.confirm
  • Gotcha: flow_run_app uses version_flags=[], help_flags=["--help"] to prevent flag interception

Test plan

  • uv run pytest tests/cli/test_flow_run.py — 73 passed, 1 skipped (typer)
  • PREFECT_CLI_FAST=1 uv run pytest tests/cli/test_flow_run.py — 73 passed, 1 skipped (cyclopts)
  • uv run pytest tests/cli/test_cyclopts_parity.py — 18 passed
  • ruff clean

🤖 Generated with Claude Code

@codspeed-hq
Copy link

codspeed-hq bot commented Feb 13, 2026

Merging this PR will not alter performance

✅ 2 untouched benchmarks


Comparing cli-cyclopts/wave-3b (4219809) with main (5b81df1)

Open in CodSpeed

@zzstoatzz zzstoatzz force-pushed the cli-cyclopts/wave-3b branch 2 times, most recently from cc1b16f to 920a790 Compare February 13, 2026 23:17
Native cyclopts implementation of all flow-run subcommands: inspect,
ls, delete, cancel, retry, logs, execute. Includes the
_get_flow_run_by_id_or_name helper for retry-by-name support.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@zzstoatzz zzstoatzz force-pushed the cli-cyclopts/wave-3b branch from 920a790 to 4219809 Compare February 13, 2026 23:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant