1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
//! # `TurboMCP` CLI - Comprehensive Edition
//!
//! Complete MCP (Model Context Protocol) command-line interface with comprehensive features.
//!
//! ## Features
//!
//! - **Complete MCP Coverage**: All protocol operations (tools, resources, prompts, completions, sampling, etc.)
//! - **Multiple Transports**: STDIO, HTTP SSE, WebSocket, TCP, Unix sockets with auto-detection
//! - **Rich Output**: Human-readable, JSON, YAML, and table formats with colored output
//! - **Robust Error Handling**: Detailed errors with actionable suggestions
//! - **Production Ready**: Built on turbomcp-client and turbomcp-transport
//! - **Enterprise Features**: Connection presets, configuration files, verbose logging
//!
//! ## Quick Start
//!
//! ```bash
//! # List tools from a server
//! turbomcp-cli tools list --url http://localhost:8080/mcp
//!
//! # Call a tool with arguments
//! turbomcp-cli tools call calculate --arguments '{"a": 5, "b": 3}'
//!
//! # Get server info in table format
//! turbomcp-cli server info --format table
//!
//! # List resources from STDIO server
//! turbomcp-cli resources list --command "./my-server"
//! ```
//!
//! ## Architecture
//!
//! The CLI uses a layered architecture:
//! - **Command Layer** (`cli_new`): Clap-based argument parsing
//! - **Execution Layer** (`executor`): Command execution using turbomcp-client
//! - **Transport Layer** (`transport`): Auto-detection and factory pattern
//! - **Output Layer** (`formatter`): Rich, multi-format output
//!
//! All MCP operations are delegated to `turbomcp-client` for reliability.
// Core modules
use Parser;
// Clean re-exports (no more "New" suffixes!)
pub use ;
pub use ;
pub use CommandExecutor;
pub use Formatter;
/// Run the CLI application
///
/// This is the main entry point for the TurboMCP CLI library. It provides complete
/// MCP protocol coverage with rich output formatting and comprehensive error handling.
///
/// Returns a `CliResult` that the caller can handle appropriately. This allows
/// the caller to control error formatting, exit codes, and runtime configuration.
///
/// # Example
///
/// ```rust,no_run
/// use turbomcp_cli::prelude::*;
///
/// #[tokio::main]
/// async fn main() {
/// if let Err(e) = turbomcp_cli::run().await {
/// eprintln!("Error: {}", e);
/// std::process::exit(1);
/// }
/// }
/// ```
pub async