feat: goose web for local terminal alternative (#2718)

This commit is contained in:
Michael Neale
2025-06-05 13:32:57 +10:00
committed by GitHub
parent fec5bfe9cd
commit 49c4038d38
10 changed files with 1906 additions and 2 deletions
+29
View File
@@ -504,6 +504,31 @@ enum Command {
#[command(subcommand)]
cmd: BenchCommand,
},
/// Start a web server with a chat interface
#[command(about = "Start a web server with a chat interface", hide = true)]
Web {
/// Port to run the web server on
#[arg(
short,
long,
default_value = "3000",
help = "Port to run the web server on"
)]
port: u16,
/// Host to bind the web server to
#[arg(
long,
default_value = "127.0.0.1",
help = "Host to bind the web server to"
)]
host: String,
/// Open browser automatically
#[arg(long, help = "Open browser automatically when server starts")]
open: bool,
},
}
#[derive(clap::ValueEnum, Clone, Debug)]
@@ -785,6 +810,10 @@ pub async fn cli() -> Result<()> {
}
return Ok(());
}
Some(Command::Web { port, host, open }) => {
crate::commands::web::handle_web(port, host, open).await?;
return Ok(());
}
None => {
return if !Config::global().exists() {
let _ = handle_configure().await;