systemprompt-cli 0.2.2

Unified CLI for systemprompt.io AI governance: agent orchestration, MCP governance, analytics, profiles, cloud deploy, and self-hosted operations.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use anyhow::{Context, Result, anyhow};
use std::path::PathBuf;
use std::process::Command;

pub fn run_command_in_dir(command: &str, args: &[&str], directory: &PathBuf) -> Result<()> {
    let status = Command::new(command)
        .args(args)
        .current_dir(directory)
        .status()
        .with_context(|| format!("Failed to run: {} {}", command, args.join(" ")))?;

    if !status.success() {
        return Err(anyhow!("Command failed: {} {}", command, args.join(" ")));
    }

    Ok(())
}