pub struct Cli { /* private fields */ }Expand description
An app’s CLI: standard verbs plus its own.
Implementations§
Source§impl Cli
impl Cli
Sourcepub fn new(
name: impl Into<String>,
version: impl Into<String>,
session: impl FnMut() -> Box<dyn Dispatch> + 'static,
) -> Self
pub fn new( name: impl Into<String>, version: impl Into<String>, session: impl FnMut() -> Box<dyn Dispatch> + 'static, ) -> Self
session makes a fresh headless session (one per invocation).
Sourcepub fn key_dir(self, dir: impl Into<PathBuf>) -> Self
pub fn key_dir(self, dir: impl Into<PathBuf>) -> Self
Where the running app writes its control key (its settings folder); enables --connect.
Sourcepub fn instructions(self, text: impl Into<String>) -> Self
pub fn instructions(self, text: impl Into<String>) -> Self
The MCP server’s instructions (what the app is, how to drive it).
Sourcepub fn docs(self, library: Library) -> Self
pub fn docs(self, library: Library) -> Self
The documentation library (docs, and the MCP server’s tools and resources), usually
the app’s built-in pages.
Sourcepub fn user_docs(self, dir: impl Into<PathBuf>) -> Self
pub fn user_docs(self, dir: impl Into<PathBuf>) -> Self
The user’s own documentation folder, read on top of Self::docs whenever they are
used (same path: the user’s page wins). docs --where prints it; it is never created.
Sourcepub fn prompts(self, category: impl Into<String>) -> Self
pub fn prompts(self, category: impl Into<String>) -> Self
The documentation category mcp serves as prompts (McpServer::prompts).
Auto Trait Implementations§
impl !RefUnwindSafe for Cli
impl !Send for Cli
impl !Sync for Cli
impl !UnwindSafe for Cli
impl Freeze for Cli
impl Unpin for Cli
impl UnsafeUnpin for Cli
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more