zaccess CLI
Generate policies, validate manifests, run policy tests, migrate, sync the catalog and bootstrap the first admin.
go install github.com/zynactra/access/go/cmd/zaccess@latest| Command | Does |
|---|---|
zaccess gen [-config zaccess.yaml] | Generate policies, schemas, the compiled manifest, TS and Go constants, and policy test scaffolds for new kinds. |
zaccess check [-config zaccess.yaml] [-verify] | Validate the manifests. -verify also fails if generated files are missing, stale or edited. Run it in CI. |
zaccess test [-config zaccess.yaml] [-cerbos path] | Fail if any action with a condition has no policy test, then run the Cerbos policy tests. |
zaccess migrate [-database-url url] | Apply the access schema migrations. |
zaccess sync [-config zaccess.yaml] [-database-url url] [-org id ...] | Sync the permission catalog and system roles; -org (repeatable) also seeds the system roles into those orgs. |
zaccess bootstrap-admin -org id -user id [-config zaccess.yaml] [-database-url url] | Give the first access_admin to an org that has none. |
zaccess version | Print the version. |
Environment
| Variable | |
|---|---|
DATABASE_URL | Used when -database-url isn't given. |
CERBOS_BIN | The cerbos binary for zaccess test, when it isn't on PATH and -cerbos isn't given. |
In CI
zaccess check -verify
zaccess testUse the CLI from the same release as the SDK the product depends on: the generated files and the SDK read the same compiled manifest format.