mirror of
https://github.com/aljazceru/goose.git
synced 2025-12-19 15:14:21 +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 clap::{Args, CommandFactory, Parser, Subcommand};
|
||||
use clap::{Args, Parser, Subcommand};
|
||||
|
||||
use console::style;
|
||||
use goose::config::Config;
|
||||
use goose_cli::commands::configure::handle_configure;
|
||||
use goose_cli::commands::info::handle_info;
|
||||
@@ -292,14 +291,15 @@ async fn main() -> Result<()> {
|
||||
return Ok(());
|
||||
}
|
||||
None => {
|
||||
Cli::command().print_help()?;
|
||||
println!();
|
||||
if !Config::global().exists() {
|
||||
println!(
|
||||
"\n {}: Run '{}' to setup goose for the first time",
|
||||
style("Tip").green().italic(),
|
||||
style("goose configure").cyan()
|
||||
);
|
||||
let _ = handle_configure().await;
|
||||
return Ok(());
|
||||
} else {
|
||||
// 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