Codegen Add CLI Entity

Table of Contents

When to use this skill

When you need to add CLI commands for a new entity in ores.cli. Prerequisites: the domain type must exist (domain-type-creator), the repository and table I/O must be implemented. See Entity lifecycle for the full layer ordering.

How to use this skill

  1. Gather requirements: entity name, command name (plural, hyphenated), operations needed (list, export, import, add, delete), key field, required and optional add parameters.
  2. Phase 1 — list + export (PR: [cli] Add {entity} list and export commands): add entity enum, create parser class with list/export, register in main_parser.cpp.
  3. Phase 2 — add + delete (PR: [cli] Add {entity} add and delete commands): create add_{entity}_options.hpp, extend parser with add/delete.
  4. Phase 3 — recipe docs (PR: [doc] Add {entity} CLI command recipes): add how_do_i_*.org recipes under doc/recipes/cli/.

Use feature-branch-manager between phases and pr-manager to open each PR. Build after every step: cmake --build --preset linux-clang-debug-ninja --target ores.cli.

Recipes

Reference

Codegen gap

❌ No codegen profile exists for ores.cli. Do not hand-code this layer. When entity-creator reaches this layer:

  1. Raise a sprint story: "Implement codegen profile for CLI commands."
  2. Reference Entity lifecycle§"Codegen gaps" for what the profile must cover.
  3. Link the story to the entity task before marking this layer done.
  4. Once the profile is merged, regenerate and discard any hand-written code.

Until the gap is resolved, this layer is incomplete.

Emacs 29.1 (Org mode 9.6.6)