Skip to content

CLI: authz

Read the CLI overview for session/CWD resolution, exit conventions, role boundaries, synthetic IDs and execution authorization. This page documents leaf-specific exceptions; the commands are not a script to run in order.

Prerequisites and permissions. Platform login, selected project, and effective project Owner/Admin/Developer. Operator cannot use this command, including its read-only form. Use the synthetic names below only in your isolated demo project; replace identifiers with values returned by its list/create commands.

Usage: viat authz rule list [OPTIONS]

Command aliases: none.

Argument ID / all spellingsType, value count, actionRequired / defaultAllowed valuesConflicts, aliases, parsing and original Clap help
help: --help / -hString, 0, Helpno; conditional requirements below; no explicit Clap default—help: Print help
json: --jsonbool, 0, SetTrueno; conditional requirements below; false——
origin: --originString, 1, Setno; conditional requirements below; no explicit Clap default—help: Only platform or only delegated rules
ty: --typeString, 1, Setno; conditional requirements below; no explicit Clap default—help: Only rules on this type

Clap argument groups (literal metadata): {"arguments":["json","origin","ty"],"id":"List","multiple":true,"required":false}

Inputs, behavior and side effects. Reads server authorization rules; optional —origin must be platform/delegated and —type filters a model type. Not project roles or endpoint authentication settings.

Actual output and exit. Text: rule ID, origin, effect, type.action and expression; —json emits filtered rule array. No matches is successful. Unless this section states otherwise, normal completion is 0; argument/file/HTTP/runtime errors are nonzero (typically 2 for parsing, 1 for runtime errors).

Synthetic invocation (syntax validation only; not executed).

终端窗口
viat authz rule list --origin platform --json

Failure handling, verification and cleanup. Invalid origin fails locally. Use IDs here for handover; no policy mutation/cleanup. A read’s model version is not a guarantee for a later push.

Prerequisites and permissions. Platform login, selected project, and effective project Owner/Admin/Developer. Operator cannot use this command, including its read-only form. Use the synthetic names below only in your isolated demo project; replace identifiers with values returned by its list/create commands.

Usage: viat authz rule set-origin [OPTIONS] --origin <ORIGIN> [IDS]...

Command aliases: none.

Argument ID / all spellingsType, value count, actionRequired / defaultAllowed valuesConflicts, aliases, parsing and original Clap help
dry_run: --dry-runbool, 0, SetTrueno; conditional requirements below; false—help: List what would change, change nothing
help: --help / -hString, 0, Helpno; conditional requirements below; no explicit Clap default—help: Print help
ids: <IDS> (#1)String, 1..∞, Appendno; conditional requirements below; no explicit Clap default——
not_in_file: --not-in-filebool, 0, SetTrueno; conditional requirements below; false——
origin: --originString, 1, Setyes; no explicit Clap default—help: delegated (a business screen owns it; push leaves it alone) or platform (the repo owns it; push mirrors it)

Clap argument groups (literal metadata): {"arguments":["dry_run","ids","not_in_file","origin"],"id":"SetOrigin","multiple":true,"required":false}

Inputs, behavior and side effects. Choose explicit rule IDs OR —not-in-file, never both/neither. —not-in-file requires CWD viat.yaml with authz section and —origin delegated; selects platform rules absent by content. —dry-run lists changes. Real run PUTs rules one by one; already-matching rows skipped.

Actual output and exit. Text lists would-set/set/nothing-to-change. Failure reports previously changed rows and remainder; partial writes persist. A current checkout’s recorded model version is advanced after successful handover; stale checkouts stay stale. Unless this section states otherwise, normal completion is 0; argument/file/HTTP/runtime errors are nonzero (typically 2 for parsing, 1 for runtime errors).

Synthetic invocation (syntax validation only; not executed).

终端窗口
viat authz rule set-origin 00000000-0000-4000-8000-000000000001 --origin delegated --dry-run

Failure handling, verification and cleanup. Inspect dry-run before handing ownership away: future push mirrors only platform-owned rules. To undo, explicitly set the same IDs back to previous origin. After partial failure list/reconcile, then rerun remaining work; no all-rules transaction.

Grammar comes from the pinned Clap contract and main.rs; behavior/permissions were checked against these files. Paths are relative to the product repository root.

  • crates/viat-cli/src/commands/authz.rs
  • crates/viat-cli/src/repo/model_guard.rs
  • crates/viat-api/src/handlers/authz_console.rs