arcature-cli 2026.1.1

Developer lifecycle CLI for Arcature applications.
Documentation
//! `arc run` — run a compiled application command by name.
//!
//! Distinct from `arc s` (which runs application-owned project scripts): `arc
//! run` executes a compiled Rust command registered via `#[command(...)]`
//! and the application's `CommandRegistry`. The CLI shells out to the app
//! binary with `--run-command <name>` and forwards any trailing arguments;
//! the application decides how to interpret them (PROGRAM.md §"Typed Rust
//! application commands").

use crate::error::CommandError;
use crate::process::{ProcessSpec, run};
use crate::project;

pub(crate) fn execute(name: &str, arguments: &[String]) -> Result<(), CommandError> {
    let project = project::discover()?;
    let mut spec = ProcessSpec::new("cargo", project.root()).args([
        "run",
        "--quiet",
        "--package",
        &project.backend_package,
        "--bin",
        &project.backend_binary,
        "--",
        "--run-command",
        name,
    ]);
    if !arguments.is_empty() {
        spec = spec.args(arguments.iter());
    }
    run(&spec)?;
    Ok(())
}