Repository navigation
Description
Task
T-008· Milestone M1 — Foundation · Size S · Priority P0 · Epic #1Implements FR-CLI-001
Branch
feat/t-008-cli-skeleton-typer-app-global— one task = one branch = one PR (doc 32 §6)
Summary
Create the roboprobe console entry point with Typer/Rich, global --config/--log-level options, sub-app registration and the exit-code contract of doc 05 §11.
Context / motivation
Many tasks add CLI commands (config, db, space, campaign, worker, …). A skeleton with one module per command group lets them be added in parallel with only a one-line registration each.
Scope
In scope
backend/src/roboprobe/cli/main.py: Typer root app,--version, global options,COMMAND_GROUPSregistration list.[project.scripts] roboprobe = "roboprobe.cli.main:app".- Error handling:
ConfigError/ValidationError→ exit 2, otherRoboProbeError→ exit 1, success 0; exit 3 reserved for--fail-on-failure(doc 05 §11). - Rich-based presentation helpers in
cli/_output.py(tables, JSON output flag--json).
Out of scope
- Actual commands (T-003b, T-045a–c, T-013b, T-026, …)
Implementation guidance
- Each command group lives in its own module
cli/<group>.pyexposingapp = typer.Typer();main.pyonly imports and registers them — keeps merge conflicts to one line. printis allowed only in CLI presentation code (doc 16 §3).- The CLI must build services through
roboprobe.bootstrap.cli(T-046) once that exists; until then commands receive settings viaload_settings. - Standards: respect the layering contracts (doc 16 §2) and conventions in doc 34; no hard-coded tunables — thresholds/defaults come from typed settings (doc 27); no magic numbers (ruff
PLR2004); public APIs typed (mypy strict) and documented.
Acceptance criteria
-
uv run roboprobe --helpand--versionwork. - Exit codes verified for success, validation error, runtime error.
- Adding a command group requires one import + one list entry (documented in module docstring).
- Tests listed below added and green in CI; coverage of new code meets the gate in doc 18 §3.
- Docs, config reference and CHANGELOG
Unreleasedupdated where behaviour, keys or interfaces changed. - Definition of Done (doc 32 §3) satisfied.
Tests required
tests/unit/cli/test_main.pyusingtyper.testing.CliRunner.
Dependencies
Blocked by: #12 (T-001), #16 (T-002b)
Blocks: #21 (T-003b), #67 (T-013b), #125 (T-014), #93 (T-039b), #89 (T-045a)
Parallelization notes
Files / paths owned by this task — avoid editing other paths; shared files (pyproject.toml entry points, cli/main.py, api/routers/__init__.py, router.tsx, docker/compose.yaml, ci.yml) are append-only:
backend/src/roboprobe/cli/main.pybackend/src/roboprobe/cli/_output.py- backend/pyproject.toml ([project.scripts])
backend/tests/unit/cli/test_main.py
After merge, cli/main.py becomes an append-only registration list; conflicts are trivial.
Definition of Done
Per doc 32 §3 and AGENTS.md §5: lint, format, mypy strict and import-linter green; tests added and passing; docs updated; PR template completed with Closes #<this issue>; Conventional Commit messages referencing T-008 (doc 16 §6); commits authored only by the repository owner identity (AGENTS.md §4); CI green; reviewer checklist (doc 32 §5.1) satisfied.
References
Design docs: doc 05 §11 · doc 34 §5 · doc 16 §3
Requirements: FR-CLI-001 (traceability: doc 28)
External:
Metadata
Metadata
Assignees
Labels
Projects
- StatusShow more project fieldsDone
Activity
roboprobe config show [--sources]command with masked secrets #21roboprobe gc [--dry-run],artifacts verify, retention policy #67db upgradeandspace validate|register|list#89roboprobe oracle reevaluate <run_id>: offline re-judgement from stored traces #93.tar.zst, JSON Lines + artefacts) with safe extraction #125