Skip to main content

walrus_cli/cmd/
chat.rs

1//! Interactive chat REPL command.
2
3use crate::repl::ChatRepl;
4use crate::runner::Runner;
5use anyhow::Result;
6use clap::Args;
7use compact_str::CompactString;
8
9/// Start an interactive chat REPL.
10#[derive(Args, Debug)]
11pub struct Chat;
12
13impl Chat {
14    /// Enter the interactive REPL with the given runner and agent.
15    pub async fn run<R: Runner>(self, runner: R, agent: CompactString) -> Result<()> {
16        let mut repl = ChatRepl::new(runner, agent)?;
17        repl.run().await
18    }
19}