Parent
#26
What to build
The first vertical slice of the read-only query CLI. Adds a single subcommand fafycat cat list that returns all categories as JSON. Establishes the patterns every later slice will reuse:
- Nested argparse subparsers (
cat namespace).
- JSON-only stdout output with
indent=2.
- Error contract:
{"error": "..."} to stdout with non-zero exit; argparse usage to stderr with exit 2.
- Logging suppressed below ERROR for query handlers.
- Subprocess-based integration tests against a temporary database.
- Reuse of
CategoryService.get_categories from the existing service kernel — no new business logic.
- Reuse of
--data-dir and FAFYCAT_DATA_DIR resolution via the existing _apply_data_dir_override helper.
A small shared output helper module is introduced here so later slices share the same JSON / exit-code framing.
Acceptance criteria
Blocked by
None - can start immediately.
Parent
#26
What to build
The first vertical slice of the read-only query CLI. Adds a single subcommand
fafycat cat listthat returns all categories as JSON. Establishes the patterns every later slice will reuse:catnamespace).indent=2.{"error": "..."}to stdout with non-zero exit; argparse usage to stderr with exit 2.CategoryService.get_categoriesfrom the existing service kernel — no new business logic.--data-dirandFAFYCAT_DATA_DIRresolution via the existing_apply_data_dir_overridehelper.A small shared output helper module is introduced here so later slices share the same JSON / exit-code framing.
Acceptance criteria
fafycat cat listreturns a JSON array of category objects on stdout, exit 0.fafycat cat list --include-inactiveincludes inactive categories in the result.fafycat cat list --helpexits 0 and prints usage including at least one example invocation.fafycat cat --helplists thelistsubcommand.json.loads.indent=2formatted.{"error": "..."}to stdout and exit 1.fafycat serve,fafycat import,fafycat initcommands continue to work unchanged.--include-inactive, missing-DB error path.Blocked by
None - can start immediately.