Expand description
CLI command implementations.
This module provides the command-line interface for Subcog. Each submodule implements a specific CLI command.
ยงCommands
| Command | Description |
|---|---|
capture | Capture a memory to persistent storage |
recall | Search for memories using hybrid (vector + text) search |
status | Show memory system status and statistics |
sync | Synchronize memories with git remote |
consolidate | Consolidate related memories |
serve | Run as MCP server (stdio or HTTP) |
hook | Claude Code hook handlers |
config | Configuration management |
prompt | Prompt template management |
namespaces | List available namespaces |
ยงExample Usage
# Capture a decision
subcog capture --namespace decisions "Use PostgreSQL for primary storage"
# Search memories
subcog recall "database storage"
# Run as MCP server
subcog serve
# Save a prompt template
subcog prompt save my-prompt --content "Review {{file}} for {{issue}}"ยงLLM Client Factory
The llm_factory submodule provides builder functions for creating LLM clients
from configuration. These are used by hooks and other components that need
LLM capabilities.
Modulesยง
- capture ๐
- Capture CLI command.
- config ๐
- Config CLI command.
- consolidate ๐
- Consolidate CLI command.
- delete
- Delete CLI command for removing memories.
- gc
- Garbage collection CLI command.
- hook ๐
- Hook CLI command.
- llm_
factory ๐ - LLM client factory functions for CLI commands.
- migrate ๐
- Migration CLI command.
- namespaces ๐
- CLI command for listing memory namespaces.
- prompt ๐
- Prompt CLI command.
- recall ๐
- Recall CLI command.
- serve ๐
- Serve CLI command (MCP server).
- status ๐
- Status CLI command.
- sync ๐
- Sync CLI command.
- webhook
- Webhook CLI command.
Structsยง
- Capture
Command - Capture command handler.
- Config
Command - Config command handler.
- Consolidate
Command - Consolidate command handler.
- Hook
Command - Hook command handler (DOC-H1).
- Migrate
Command - Migration command handler.
- Namespace
Info - Information about a namespace.
- Prompt
Command - Prompt command handler.
- Recall
Command - Recall command handler.
- Save
Prompt Args - Arguments for the
prompt savecommand. - Serve
Command - Serve command handler.
- Status
Command - Status command handler.
- Sync
Command - Sync command handler.
Enumsยง
- Namespaces
Output Format - Output format for namespaces command.
- Output
Format - Output format for prompt commands.
Functionsยง
- build_
anthropic_ client - Builds an Anthropic client from configuration.
- build_
hook_ llm_ provider - Builds an LLM provider for hooks from configuration.
- build_
http_ config - Builds HTTP configuration from LLM config with environment overrides.
- build_
lmstudio_ client - Builds an LM Studio client from configuration.
- build_
ollama_ client - Builds an Ollama client from configuration.
- build_
openai_ client - Builds an
OpenAIclient from configuration. - build_
resilience_ config - Builds resilience configuration from LLM config with environment overrides.
- cmd_
namespaces - Executes the namespaces command.
- cmd_
prompt_ delete - Executes the
prompt deletesubcommand. - cmd_
prompt_ export - Executes the
prompt exportsubcommand. - cmd_
prompt_ get - Executes the
prompt getsubcommand. - cmd_
prompt_ import - Executes the
prompt importsubcommand. - cmd_
prompt_ list - Executes the
prompt listsubcommand. - cmd_
prompt_ run - Executes the
prompt runsubcommand. - cmd_
prompt_ save - Executes the
prompt savesubcommand (legacy interface). - cmd_
prompt_ save_ with_ args - Executes the
prompt savesubcommand. - cmd_
prompt_ share - Executes the
prompt sharesubcommand. - get_
all_ namespaces - Returns all namespace information.