beam-cli 0.11.1

CLI entrypoint for beam, a Rust runtime that connects Feishu/Lark threads to local AI coding CLIs
use crate::*;
use anyhow::Result;

pub(crate) fn cmd_autostart(paths: &BeamPaths, args: Vec<String>) -> Result<()> {
    let action = autostart::parse_action(&args);
    let opts = autostart::AutostartOpts {
        exe: std::env::current_exe()?,
        paths: paths.clone(),
    };
    match action {
        autostart::AutostartAction::Enable => autostart::enable_autostart(&opts),
        autostart::AutostartAction::Disable => autostart::disable_autostart(),
        autostart::AutostartAction::Status => autostart::autostart_status(),
        autostart::AutostartAction::Refresh => {
            if autostart::refresh_autostart(&opts)? {
                println!("✅ autostart 已刷新");
            } else {
                println!("ℹ️  autostart 无需更新");
            }
            Ok(())
        }
    }
}