» cat ~/.claude/projects/-Users-nate-github-com-prefecthq-prefect/memory/MEMORY.md | pbcopy
claude memory!?
1# prefect cli migration: typer → cyclopts
2
3## status (2026-02-04)
4- PR #20549: `fast-cli-cyclopts` branch
5- toggle: `PREFECT_CLI_FAST=1` env var
6- native commands: `config` (view, set, unset, validate)
7- everything else delegates to typer
8
9## baseline benchmarks (CI)
10all commands ~1.7s - cyclopts and typer at parity because:
111. `_get_version()` imports prefect eagerly
122. delegated commands still run through typer
133. native `config` still has heavy imports at runtime
14
15## cyclopts patterns
16- `@app.meta.default` for root callback (global options)
17- `app.meta()` to invoke (not `app()`) for global option handling
18- `Parameter("--flag", alias="-f")` for short flags
19- `Parameter("--prompt", negative="--no-prompt")` for boolean toggles
20- `app.meta.group_parameters = Group("Session Parameters")` for option grouping
21
22## next steps for perf gains
231. lazy version lookup (only when --version invoked)
242. migrate more commands to native cyclopts
253. defer heavy imports until command execution
264. profile to find import hotspots
27
28## key files
29- `src/prefect/cli/_cyclopts/__init__.py` - main app, global options
30- `src/prefect/cli/_cyclopts/config.py` - native config command
31- `src/prefect/cli/__init__.py` - toggle logic
32- `tests/cli/test_cyclopts_parity.py` - parity tests
33- `benches/cli-bench.toml` - benchmark config