1mod ai;
3mod mcp;
4mod project;
5
6pub use ai::configure_ai;
7pub use mcp::doctor;
8pub use project::{new_project, project_files};
9
10pub const CLI_VERSION: &str = env!("CARGO_PKG_VERSION");
12pub const VERSION: &str = ravenrs_project::RAVENRS_VERSION;
15pub const SKILL: &str = include_str!("../../../plugins/ravenrs/skills/ravenrs/SKILL.md");
17pub const TOOLCHAIN: &str = include_str!("../../../rust-toolchain.toml");
19
20fn read(path: &std::path::Path) -> Result<String, String> {
21 std::fs::read_to_string(path).map_err(|e| format!("{}: {e}", path.display()))
22}
23
24fn write(root: &std::path::Path, path: &str, contents: &str) -> Result<(), String> {
25 let path = root.join(path);
26 if let Some(parent) = path.parent() {
27 std::fs::create_dir_all(parent).map_err(|e| e.to_string())?;
28 }
29 std::fs::write(&path, contents).map_err(|e| format!("{}: {e}", path.display()))
30}
31
32fn run(root: &std::path::Path, command: &str, args: &[&str]) -> Result<(), String> {
33 let status = std::process::Command::new(command)
34 .args(args)
35 .current_dir(root)
36 .status()
37 .map_err(|e| format!("{command}: {e}"))?;
38 if status.success() { Ok(()) } else { Err(format!("{command} {}: {status}", args.join(" "))) }
39}