memstead-cli 0.18.1

Command-line interface for Memstead — query and mutate typed entity graphs from the shell. Default build produces the full `memstead` binary (multi-mem, git-backed); `--no-default-features` builds the lean folder-only surface.
Documentation
//! `memstead gates` — render the gates brief: the standing of every
//! schema-declared `transition_requires_checks` gate across the
//! workspace's mounted mems. The renderer is the shared engine entry
//! point `Engine::render_gates_brief`, so every consuming surface
//! serves byte-identical content — the due-brief precedent. There is
//! deliberately no MCP tool (briefs are the CLI family).

use clap::Args as ClapArgs;
use serde_json::json;

use crate::output::{print_json, print_markdown};
use crate::setup::CliContext;

#[derive(ClapArgs, Debug)]
pub struct Args {
    /// Restrict the brief to one mem (default: every mounted mem whose
    /// schema declares a gated transition).
    #[arg(long)]
    pub mem: Option<String>,
}

pub fn run(ctx: &CliContext, args: Args) -> anyhow::Result<()> {
    let engine = ctx.cli_engine()?;
    let brief = engine.base().render_gates_brief(args.mem.as_deref());
    if ctx.json {
        print_json(&json!({
            "mem": args.mem,
            "brief": brief,
        }))?;
    } else {
        print_markdown(&brief);
    }
    Ok(())
}