walrus_cli/cmd/send.rs
1//! One-shot message command.
2
3use crate::runner::Runner;
4use anyhow::Result;
5use clap::Args;
6
7/// Send a one-shot message to an agent.
8#[derive(Args, Debug)]
9pub struct Send {
10 /// Message content.
11 pub content: String,
12}
13
14impl Send {
15 /// Send a message and print the response.
16 pub async fn run(self, runner: &mut impl Runner, agent: &str) -> Result<()> {
17 let response = runner.send(agent, &self.content).await?;
18 println!("{response}");
19 Ok(())
20 }
21}