subcog/cli/mod.rs
1//! CLI command implementations.
2//!
3//! This module provides the command-line interface for Subcog. Each submodule
4//! implements a specific CLI command.
5//!
6//! # Commands
7//!
8//! | Command | Description |
9//! |---------|-------------|
10//! | `capture` | Capture a memory to persistent storage |
11//! | `recall` | Search for memories using hybrid (vector + text) search |
12//! | `status` | Show memory system status and statistics |
13//! | `sync` | Synchronize memories with git remote |
14//! | `consolidate` | Consolidate related memories |
15//! | `serve` | Run as MCP server (stdio or HTTP) |
16//! | `hook` | Claude Code hook handlers |
17//! | `config` | Configuration management |
18//! | `prompt` | Prompt template management |
19//! | `namespaces` | List available namespaces |
20//!
21//! # Example Usage
22//!
23//! ```bash
24//! # Capture a decision
25//! subcog capture --namespace decisions "Use PostgreSQL for primary storage"
26//!
27//! # Search memories
28//! subcog recall "database storage"
29//!
30//! # Run as MCP server
31//! subcog serve
32//!
33//! # Save a prompt template
34//! subcog prompt save my-prompt --content "Review {{file}} for {{issue}}"
35//! ```
36//!
37//! # LLM Client Factory
38//!
39//! The `llm_factory` submodule provides builder functions for creating LLM clients
40//! from configuration. These are used by hooks and other components that need
41//! LLM capabilities.
42
43mod capture;
44mod config;
45mod consolidate;
46pub mod delete;
47pub mod gc;
48mod hook;
49mod llm_factory;
50mod migrate;
51mod namespaces;
52mod prompt;
53mod recall;
54mod serve;
55mod status;
56mod sync;
57pub mod webhook;
58
59pub use capture::CaptureCommand;
60pub use config::ConfigCommand;
61pub use consolidate::ConsolidateCommand;
62pub use hook::HookCommand;
63pub use llm_factory::{
64 build_anthropic_client, build_hook_llm_provider, build_http_config, build_llm_provider,
65 build_llm_provider_for_entity_extraction, build_lmstudio_client, build_ollama_client,
66 build_openai_client, build_resilience_config,
67};
68pub use migrate::MigrateCommand;
69pub use namespaces::{NamespaceInfo, NamespacesOutputFormat, cmd_namespaces, get_all_namespaces};
70pub use prompt::{
71 OutputFormat, PromptCommand, SavePromptArgs, cmd_prompt_delete, cmd_prompt_export,
72 cmd_prompt_get, cmd_prompt_import, cmd_prompt_list, cmd_prompt_run, cmd_prompt_save,
73 cmd_prompt_save_with_args, cmd_prompt_share,
74};
75pub use recall::RecallCommand;
76pub use serve::ServeCommand;
77pub use status::StatusCommand;
78pub use sync::SyncCommand;