Fix: Handle init command before config loading

The init command was being processed after attempting to load config,
causing it to fail when no config existed. Now init is handled first
so users can create the initial configuration.

Co-authored-by: Qwen-Coder <qwen-coder@alibabacloud.com>
This commit is contained in:
SVibe Developer
2026-03-19 13:30:26 +01:00
parent c723e5fc40
commit 72107f85d8

View File

@@ -31,6 +31,12 @@ async fn main() -> anyhow::Result<()> {
let cli = Cli::parse();
// Handle init command first (before config loading)
if matches!(cli.command, Some(Commands::Init)) {
cmd_init()?;
return Ok(());
}
// Load or create configuration
let config = load_config(cli.config.as_deref())?;