Shell facet
Table of Contents
Shell entity commands live in ores.shell under
src/app/commands/{entity}_commands.cpp. Each entity gets a
commands class with a static register_commands method that creates
a submenu and registers operations; all handlers are static methods
that communicate with the server via a client_session. Phase 1
delivers list + add; Phase 2 delivers history; Phase 3 adds recipe
docs. Return to Knowledge.
Codegen gap
⚠ No codegen profile exists for this layer. Before creating shell commands for any new entity:
- Create mustache templates in
projects/ores.codegen/library/templates/. - Add a
shellprofile entry to facet_catalogue.org. - Validate against an existing entity (e.g.
currency). - Only then use codegen to generate the layer.
Until the profile exists, see the recipes for the manual path — but treat this as a workaround, not the target state.
Command class layout
The commands class is all-static. It carries an
inline static std::string_view logger_name with the fully-qualified
logger path and a static lg() accessor. register_commands takes
a cli::Menu& root and a client_session&; it inserts a submenu and
registers one lambda per operation. Each operation is a separate
static process_* method.
Registration in register_commands
Create a named submenu via root_menu.Insert("{entities}"). Insert
each operation by name with a capturing lambda that calls the
corresponding process_* method. Call register_commands once from
src/app/application.cpp during startup.
Operation shapes
| Operation | Menu path | Notes |
|---|---|---|
| List | {entities} list |
Displays table via table I/O streaming |
| Add | {entities} add <params> |
Sends create request; displays confirmation |
| History | {entities} history <id> |
Shows all versions of a single entity |
| Delete | {entities} delete <key> |
Soft-delete; displays confirmation |
File locations
| File | Path |
|---|---|
| Header | include/ores.shell/app/commands/{entity}_commands.hpp |
| Implementation | src/app/commands/{entity}_commands.cpp |
| Application | src/app/application.cpp (call register_commands) |
See also
- shell-entity-creator — skill that drives this workflow.
- How do I create shell commands for a new entity? — recipe walkthrough.
- Entity lifecycle — layer ordering overview.