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 errorsSession- Session storage errorsReadline- Input/readline errorsIo- 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?;