Skip to content

Commit 3ffbb7f

Browse files
committed
cli cleanups
1 parent 02e7741 commit 3ffbb7f

File tree

6 files changed

+590
-647
lines changed

6 files changed

+590
-647
lines changed

crates/chat-cli/src/cli/chat/cli.rs

Lines changed: 0 additions & 148 deletions
This file was deleted.

crates/chat-cli/src/cli/chat/mcp.rs

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -13,14 +13,6 @@ use eyre::{
1313
};
1414
use tracing::warn;
1515

16-
use crate::cli::chat::cli::{
17-
Mcp,
18-
McpAdd,
19-
McpImport,
20-
McpList,
21-
McpRemove,
22-
Scope,
23-
};
2416
use crate::cli::chat::tool_manager::{
2517
McpServerConfig,
2618
global_mcp_config_path,
@@ -31,18 +23,26 @@ use crate::cli::chat::tools::custom_tool::{
3123
default_timeout,
3224
};
3325
use crate::cli::chat::util::shared_writer::SharedWriter;
26+
use crate::cli::chat::{
27+
McpAdd,
28+
McpImport,
29+
McpList,
30+
McpRemove,
31+
McpSubcommand,
32+
Scope,
33+
};
3434
use crate::platform::Context;
3535

36-
pub async fn execute_mcp(args: Mcp) -> Result<ExitCode> {
36+
pub async fn execute_mcp(subcommand: McpSubcommand) -> Result<ExitCode> {
3737
let ctx = Context::new();
3838
let mut output = SharedWriter::stdout();
3939

40-
match args {
41-
Mcp::Add(args) => add_mcp_server(&ctx, &mut output, args).await?,
42-
Mcp::Remove(args) => remove_mcp_server(&ctx, &mut output, args).await?,
43-
Mcp::List(args) => list_mcp_server(&ctx, &mut output, args).await?,
44-
Mcp::Import(args) => import_mcp_server(&ctx, &mut output, args).await?,
45-
Mcp::Status { name } => get_mcp_server_status(&ctx, &mut output, name).await?,
40+
match subcommand {
41+
McpSubcommand::Add(args) => add_mcp_server(&ctx, &mut output, args).await?,
42+
McpSubcommand::Remove(args) => remove_mcp_server(&ctx, &mut output, args).await?,
43+
McpSubcommand::List(args) => list_mcp_server(&ctx, &mut output, args).await?,
44+
McpSubcommand::Import(args) => import_mcp_server(&ctx, &mut output, args).await?,
45+
McpSubcommand::Status { name } => get_mcp_server_status(&ctx, &mut output, name).await?,
4646
}
4747

4848
output.flush()?;
@@ -324,7 +324,7 @@ mod tests {
324324

325325
#[tokio::test]
326326
async fn add_then_remove_cycle() {
327-
use crate::cli::chat::cli::{
327+
use crate::cli::chat::{
328328
McpAdd,
329329
McpRemove,
330330
};

0 commit comments

Comments
 (0)