mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-19 23:24:23 +01:00
feat(cli): Improve default behavior when no command is provided (#1438)
This commit is contained in:
@@ -1,7 +1,6 @@
|
|||||||
use anyhow::Result;
|
use anyhow::Result;
|
||||||
use clap::{Args, CommandFactory, Parser, Subcommand};
|
use clap::{Args, Parser, Subcommand};
|
||||||
|
|
||||||
use console::style;
|
|
||||||
use goose::config::Config;
|
use goose::config::Config;
|
||||||
use goose_cli::commands::configure::handle_configure;
|
use goose_cli::commands::configure::handle_configure;
|
||||||
use goose_cli::commands::info::handle_info;
|
use goose_cli::commands::info::handle_info;
|
||||||
@@ -292,14 +291,15 @@ async fn main() -> Result<()> {
|
|||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
None => {
|
None => {
|
||||||
Cli::command().print_help()?;
|
|
||||||
println!();
|
|
||||||
if !Config::global().exists() {
|
if !Config::global().exists() {
|
||||||
println!(
|
let _ = handle_configure().await;
|
||||||
"\n {}: Run '{}' to setup goose for the first time",
|
return Ok(());
|
||||||
style("Tip").green().italic(),
|
} else {
|
||||||
style("goose configure").cyan()
|
// Run session command by default
|
||||||
);
|
let mut session = build_session(None, false, vec![], vec![]).await;
|
||||||
|
setup_logging(session.session_file().file_stem().and_then(|s| s.to_str()))?;
|
||||||
|
let _ = session.interactive(None).await;
|
||||||
|
return Ok(());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user