This commit is contained in:
2025-05-25 19:39:11 +09:00
parent cd25af7bf0
commit 979e55cfce
10 changed files with 1775 additions and 75 deletions

View File

@ -3,7 +3,7 @@ mod cli;
mod config;
mod mcp;
use cli::{Args, Commands, ServerCommands};
use cli::{Args, Commands, ServerCommands, MemoryCommands};
use clap::Parser;
#[tokio::main]
@ -21,8 +21,38 @@ async fn main() {
}
}
}
Commands::Chat { message } => {
mcp::server::chat(&message).await;
Commands::Chat { message, with_memory } => {
if with_memory {
if let Err(e) = mcp::memory::handle_chat_with_memory(&message).await {
eprintln!("❌ 記憶チャットエラー: {}", e);
}
} else {
mcp::server::chat(&message).await;
}
}
Commands::Memory { command } => {
match command {
MemoryCommands::Import { file } => {
if let Err(e) = mcp::memory::handle_import(&file).await {
eprintln!("❌ インポートエラー: {}", e);
}
}
MemoryCommands::Search { query, limit } => {
if let Err(e) = mcp::memory::handle_search(&query, limit).await {
eprintln!("❌ 検索エラー: {}", e);
}
}
MemoryCommands::List => {
if let Err(e) = mcp::memory::handle_list().await {
eprintln!("❌ 一覧取得エラー: {}", e);
}
}
MemoryCommands::Detail { filepath } => {
if let Err(e) = mcp::memory::handle_detail(&filepath).await {
eprintln!("❌ 詳細取得エラー: {}", e);
}
}
}
}
}
}