arcature-cli 2026.1.0

Developer lifecycle CLI for Arcature applications.
Documentation
//! Shell out to the app's `arcature-metadata` binary and deserialize the JSON.
//!
//! Mirrors the `contracts::execute` pattern: run
//! `cargo run --quiet --package <backend_package> --bin arcature-metadata`,
//! capture stdout, deserialize as JSON. This is side-effect-free from the
//! CLI's perspective — the app binary itself must not boot infrastructure
//! (PROGRAM.md §"Side-effect-free inspection").

use crate::process::{ProcessSpec, run_capture};
use crate::project::ProjectConfig;

use super::artifact::MetadataArtifact;

/// Load the application metadata artifact by shelling out to the app's
/// `arcature-metadata` binary. The binary emits a JSON artifact with
/// modules, routes, and services — never booted infrastructure.
pub(crate) fn load(project: &ProjectConfig) -> Result<MetadataArtifact, String> {
    let output = run_capture(&ProcessSpec::new("cargo", project.root()).args([
        "run",
        "--quiet",
        "--package",
        &project.backend_package,
        "--bin",
        "arcature-metadata",
    ]))
    .map_err(|error| format!("cannot inspect the application metadata: {error}"))?;
    serde_json::from_slice(&output)
        .map_err(|error| format!("arcature-metadata did not emit valid JSON: {error}"))
}