Skip to main content

apm/cmd/
agents.rs

1use anyhow::Result;
2use apm_core::config::Config;
3use std::path::Path;
4
5pub fn run(root: &Path) -> Result<()> {
6    let config = Config::load(root)?;
7    match config.agents.instructions {
8        None => println!("No instructions file configured in [agents] instructions."),
9        Some(rel_path) => {
10            let path = root.join(&rel_path);
11            match std::fs::read_to_string(&path) {
12                Ok(contents) => print!("{}", contents),
13                Err(e) => anyhow::bail!("cannot read {}: {}", path.display(), e),
14            }
15        }
16    }
17    Ok(())
18}