~ knotless Search/
↑↓ move↵ open⇧↵ all results

johnandersen777.bsky.social/knotless

git that lives in your Atmosphere account

Forked from chadtmiller.com/knotless

0
0
23 lines · 888 B Raw History
fn main() -> std::process::ExitCode {
    let args: Vec<String> = std::env::args().skip(1).collect();
    let read_only = match args.as_slice() {
        [] => false,
        [flag] if flag == "--read-only" => true,
        _ => {
            eprintln!("usage: knotless-mcp [--read-only]");
            return std::process::ExitCode::from(2);
        }
    };
    let mut env = knotless::env::Env::from_process();
    // On a person's own machine, it commits as git does here.
    env.signer = knotless::env::Signer::Git;
    let ctx = knotless::env::Ctx::new(env);
    let rt = tokio::runtime::Runtime::new().expect("a runtime builds");
    match rt.block_on(knotless_mcp::serve_stdio(ctx, read_only)) {
        Ok(()) => std::process::ExitCode::SUCCESS,
        Err(err) => {
            eprintln!("knotless-mcp: {err:#}");
            std::process::ExitCode::FAILURE
        }
    }
}