How do I create shell commands for a new entity?
Command class layout, registration pattern, and file locations are in Shell entity patterns. The codegen-add-shell-entity skill drives this process.
Question
How do I add shell REPL commands for a new entity in ores.shell?
Answer
Phase 1 — list and add (PR: [shell] Add {entity} list and add commands):
- Create
{entity}_commands.hppininclude/ores.shell/app/commands/with the static class shape from Shell entity patterns. - Implement
{entity}_commands.cppinsrc/app/commands/: create the submenu, register list and add operations. - Call
{entity}_commands::register_commands(menu, session)fromsrc/app/application.cpp. - Build and smoke-test: start
ores.shelland exercise{entities} listand{entities} add.
Phase 2 — history (PR: [shell] Add {entity} history command):
- Add
process_get_{entity}_historyhandler. - Register
historysubcommand inregister_commands. - Build and smoke-test.
Phase 3 — recipe docs (PR: [doc] Add {entity} shell command recipes):
- Add
how_do_i_*.orgrecipes underdoc/recipes/shell/(one per operation).
Tested by
Start ores.shell, connect, and exercise each subcommand interactively
against a local database.
See also
- Shell entity patterns — class layout, registration, file locations.
- codegen-add-shell-entity — skill that drives this workflow.
- Entity lifecycle — layer ordering overview.