Expand description
vantage-cmd — a Vantage persistence backend that gets its data by
running a local command (the aws CLI, kubectl, gh, …).
The design pins down a strict security boundary and hands everything else to a Rhai script:
- The command is locked on the
Cmddatasource — a script can never change which binary runs. - Environment variables are locked — the child process gets a
cleared environment plus only the vars declared on the datasource
/ table (and
PATH/HOMEso the binary is locatable, toggleable viaCmd::with_pass_path). - The arguments and the output parsing are scripted in Rhai. When
a table is read, the script runs with the table’s
conditions,columns,limit,offsetandid_columnin scope; it builds an argv, calls the registeredrun(args)callback (which executes the locked command), then parses the captured output into rows.
const LOG_GROUPS: &str = r#"
let args = ["logs", "describe-log-groups", "--output", "json"];
for c in conditions {
if c.field == "logGroupNamePrefix" {
args += ["--log-group-name-prefix", c.value];
}
}
let out = run(args);
if out.exit_code != 0 { throw out.stderr; }
parse_json(out.stdout).logGroups
"#;
let cmd = Cmd::new("aws")
.with_env("AWS_REGION", "us-east-1")
.with_script("log.groups", LOG_GROUPS);
let groups = Table::<Cmd, EmptyEntity>::new("log.groups", cmd)
.with_id_column("logGroupName")
.with_column_of::<i64>("creationTime");Modules§
- models
CmdModelFactory— maps dotted model names (iam.users,log.groups,log.group, …) to YAML-backedVistas, mirroringvantage_aws::models::Factory.- vista
- Vista integration for
vantage-cmd: the YAML-facing spec types, the factory (typed-table and YAML construction), and theTableShell.
Structs§
- Cmd
- A command-execution datasource.
- CmdOutput
- Captured result of a single command invocation.
- CmdSpec
- Per-table configuration registered on a
Cmd: the Rhai script that builds the argv and parses the output, plus optional command / env overrides that win over the datasource-level defaults.
Enums§
- AnyCmd
Type - One value in a command-backed record, at the rendering boundary.
- CmdCondition
- A filter on a command-backed table.
Traits§
- CmdOperation
- Build conditions from a typed column without going through the expression machinery (command backends filter via CLI flags, not SQL).
Functions§
- eq
field == value. Shorthand forCmdCondition::eq.