agent-manager v0.2.0 : gestionnaire d'agents IA locaux
- CLI Rust (am) : list/install/uninstall/update/start/stop/restart/run/status/search/info/config/doctor/completion/export/import/self-update + shell interactif (Tab, historique) - 9 methodes d'installation (npm, pip, uv, cargo, go, bun, curl, binary, git) - catalogue de 72 agents, dependances, processus, securite (dry-run, checksums) - sondes de version paralleles + cache (am list ~25 ms a chaud) - installateurs one-liner : install.sh, install.ps1
This commit is contained in:
+62
@@ -0,0 +1,62 @@
|
||||
//! agent-manager — a CLI to manage local AI coding agents.
|
||||
//!
|
||||
//! The crate is organised around a few core concepts:
|
||||
//!
|
||||
//! * cli — clap definitions for the am command line interface.
|
||||
//! * config — YAML schema, loading, validation, includes, path expansion.
|
||||
//! * catalog — the merged agent catalog (embedded defaults + user config).
|
||||
//! * state — the local installation database (JSON file).
|
||||
//! * process — background/foreground process management (PID bookkeeping).
|
||||
//! * installers — one installer per method (npm, pip, cargo, go, bun, curl,
|
||||
//! binary, git).
|
||||
//! * commands — one module per CLI command.
|
||||
|
||||
pub mod app;
|
||||
pub mod catalog;
|
||||
pub mod cli;
|
||||
pub mod commands;
|
||||
pub mod config;
|
||||
pub mod deps;
|
||||
pub mod doctor;
|
||||
pub mod download;
|
||||
pub mod installers;
|
||||
pub mod output;
|
||||
pub mod probe;
|
||||
pub mod process;
|
||||
pub mod repl;
|
||||
pub mod runner;
|
||||
pub mod state;
|
||||
pub mod version;
|
||||
|
||||
use clap::Parser;
|
||||
|
||||
/// CLI entry point used by the am binary. Returns the process exit code.
|
||||
pub fn main_entry() -> i32 {
|
||||
let cli = cli::Cli::parse();
|
||||
match app::App::from_cli(cli) {
|
||||
Ok(app) => match commands::execute(&app) {
|
||||
Ok(code) => code,
|
||||
Err(err) => {
|
||||
if app.json() {
|
||||
let payload = serde_json::json!({
|
||||
"error": format!("{:#}", err),
|
||||
});
|
||||
let _ = serde_json::to_writer_pretty(std::io::stdout(), &payload);
|
||||
let _ = writeln!(std::io::stdout());
|
||||
} else {
|
||||
eprintln!("{} {}", "error:".red().bold(), format!("{:#}", err));
|
||||
}
|
||||
1
|
||||
}
|
||||
},
|
||||
Err(err) => {
|
||||
// Config could not even be loaded: fall back to plain stderr output.
|
||||
eprintln!("{} {}", "error:".red().bold(), format!("{:#}", err));
|
||||
1
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[allow(unused_imports)]
|
||||
use colored::Colorize;
|
||||
use std::io::Write;
|
||||
Reference in New Issue
Block a user