run_cli

Function run_cli 

Source
pub async fn run_cli(agent: Agent) -> Result<(), CliError>
Expand description

Run an interactive REPL for the agent

This provides a command-line interface with:

  • Up/down arrow history
  • Ctrl+R reverse search
  • Multi-line input support
  • Special commands (!shell, /help, etc)
  • Automatic session management
  • Rich tool presentation with CLIPresenter formatting
  • Tool approval prompts (when using Registry approval mode)

§Errors

Returns CliError which can be:

  • Agent - Agent execution errors
  • Session - Session storage errors
  • Readline - Input/readline errors
  • Io - Filesystem errors (history loading/saving)

§Example

use mixtape_core::{Agent, ClaudeSonnet4_5};
use mixtape_cli::run_cli;

let agent = Agent::builder()
    .bedrock(ClaudeSonnet4_5)
    .build()
    .await?;

run_cli(agent).await?;