Class: ClaudeMemory::Commands::Registry
- Inherits:
-
Object
- Object
- ClaudeMemory::Commands::Registry
- Defined in:
- lib/claude_memory/commands/registry.rb
Overview
Registry for CLI command lookup and dispatch Maps command names to command classes and short descriptions. Descriptions are authoritative for shell completion and help output; keep them current when adding commands.
Constant Summary collapse
- COMMANDS =
Map of command names to description: entries. As more commands are extracted, add them here.
{ "help" => {class: HelpCommand, description: "Show help message"}, "version" => {class: VersionCommand, description: "Show version"}, "doctor" => {class: DoctorCommand, description: "Check system health"}, "stats" => {class: StatsCommand, description: "Show statistics"}, "promote" => {class: PromoteCommand, description: "Promote fact to global"}, "search" => {class: SearchCommand, description: "Search indexed content"}, "explain" => {class: ExplainCommand, description: "Explain a fact with receipts"}, "conflicts" => {class: ConflictsCommand, description: "Show open conflicts"}, "changes" => {class: ChangesCommand, description: "Show recent fact changes"}, "recall" => {class: RecallCommand, description: "Recall facts matching query"}, "sweep" => {class: SweepCommand, description: "Run maintenance"}, "ingest" => {class: IngestCommand, description: "Ingest transcript delta"}, "publish" => {class: PublishCommand, description: "Publish snapshot"}, "db:init" => {class: DbInitCommand, description: "Initialize database"}, "init" => {class: InitCommand, description: "Initialize ClaudeMemory"}, "uninstall" => {class: UninstallCommand, description: "Remove configuration"}, "serve-mcp" => {class: ServeMcpCommand, description: "Start MCP server"}, "hook" => {class: HookCommand, description: "Run hook entrypoints"}, "index" => {class: IndexCommand, description: "Index content"}, "recover" => {class: RecoverCommand, description: "Recover database"}, "compact" => {class: CompactCommand, description: "Compact databases"}, "export" => {class: ExportCommand, description: "Export facts to JSON"}, "git-lfs" => {class: GitLfsCommand, description: "Git LFS integration"}, "install-skill" => {class: InstallSkillCommand, description: "Install agent skills"}, "completion" => {class: CompletionCommand, description: "Generate shell completions"}, "embeddings" => {class: EmbeddingsCommand, description: "Inspect embedding backend"}, "reject" => {class: RejectCommand, description: "Mark a fact as rejected"}, "restore" => {class: RestoreCommand, description: "Restore superseded facts from obsolete single-value classification"} }.freeze
Class Method Summary collapse
-
.all_commands ⇒ Array<String>
Get all registered command names.
-
.description(command_name) ⇒ String?
Get the short description for a command.
-
.descriptions ⇒ Hash{String => String}
Get all command descriptions as a hash.
-
.find(command_name) ⇒ Class?
Find a command class by name.
-
.registered?(command_name) ⇒ Boolean
Check if a command is registered.
Class Method Details
.all_commands ⇒ Array<String>
Get all registered command names
52 53 54 |
# File 'lib/claude_memory/commands/registry.rb', line 52 def self.all_commands COMMANDS.keys end |
.description(command_name) ⇒ String?
Get the short description for a command
66 67 68 |
# File 'lib/claude_memory/commands/registry.rb', line 66 def self.description(command_name) COMMANDS.dig(command_name, :description) end |
.descriptions ⇒ Hash{String => String}
Get all command descriptions as a hash
72 73 74 |
# File 'lib/claude_memory/commands/registry.rb', line 72 def self.descriptions COMMANDS.transform_values { |entry| entry[:description] } end |
.find(command_name) ⇒ Class?
Find a command class by name
46 47 48 |
# File 'lib/claude_memory/commands/registry.rb', line 46 def self.find(command_name) COMMANDS.dig(command_name, :class) end |
.registered?(command_name) ⇒ Boolean
Check if a command is registered
59 60 61 |
# File 'lib/claude_memory/commands/registry.rb', line 59 def self.registered?(command_name) COMMANDS.key?(command_name) end |