id = "openfga"
name = "OpenFGA CLI"
homepage = "https://github.com/openfga/cli"
description = "Cross-platform CLI for interacting with an OpenFGA server."
executables = ["fga"]
platforms = ["macos", "linux"]
[dotfiles]
paths = ["~/.fga.yaml"]
exclude = []
secret = []
[[dotfiles.secret_paths]]
file = "~/.fga.yaml"
format = "yaml"
match = { key_path = ["api-token", "client-secret"] }
[commands]
format = 1
label = "OpenFGA CLI"
description = "Check relationships and validate authorization models. Server credentials come from ~/.fga.yaml or FGA_* environment variables and are not part of these forms."
quality = "ai-draft"
parser = { end_of_options = "--", interleave = "permute", long_equals = true, short_attached = false, short_bundles = false }
[[commands.subcommand]]
path = ["query", "check"]
label = "Check a relationship"
description = "Ask whether a user has a relation to an object. Contextual tuples and condition context are left out."
[[commands.subcommand.source]]
id = "readme"
kind = "manual"
url = "https://github.com/openfga/cli"
evidence = """
fga query **check** <user> <relation> <object> [--condition] [--contextual-tuple "\\<user\\> \\<relation\\> \\<object\\>"]* --store-id=<store-id> [--model-id=<model-id>]
* `--store-id`: Specifies the store id
* `--model-id`: Specifies the model id to target (optional)
"""
[[commands.subcommand.field]]
id = "store_id"
label = "Store ID"
type = "string"
option = ["--store-id"]
sources = ["readme"]
[[commands.subcommand.field]]
id = "model_id"
label = "Authorization model ID"
type = "string"
option = ["--model-id"]
sources = ["readme"]
[[commands.subcommand.field]]
id = "user"
label = "User"
description = "For example user:anne."
type = "string"
position = 0
sources = ["readme"]
[[commands.subcommand.field]]
id = "relation"
label = "Relation"
type = "string"
position = 1
sources = ["readme"]
[[commands.subcommand.field]]
id = "object"
label = "Object"
description = "For example document:roadmap."
type = "string"
position = 2
sources = ["readme"]
[[commands.subcommand.task]]
id = "check"
label = "Check"
fields = ["store_id", "model_id", "user", "relation", "object"]
required = ["store_id", "user", "relation", "object"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["store_id", "user", "relation", "object", "model_id"]
[[commands.subcommand]]
path = ["model", "validate"]
label = "Validate a model"
description = "Validate an authorization model file without a server."
[[commands.subcommand.source]]
id = "readme"
kind = "manual"
url = "https://github.com/openfga/cli"
evidence = """
* `--file`: File containing the authorization model.
* `--format`: Authorization model input format. Can be "fga", "json", or "modular". Defaults to the file extension if provided (optional)
"""
[[commands.subcommand.field]]
id = "file"
label = "Model file"
type = "path"
option = ["--file"]
path = { kind = "file", role = "input", must_exist = true }
sources = ["readme"]
[[commands.subcommand.field]]
id = "format"
label = "Input format"
type = "enum"
option = ["--format"]
choices = [{ value = "fga", label = "fga" }, { value = "json", label = "json" }, { value = "modular", label = "modular" }]
sources = ["readme"]
[[commands.subcommand.task]]
id = "validate"
label = "Validate"
fields = ["file", "format"]
required = ["file"]
[[commands.subcommand.group]]
id = "basic"
label = "Basic"
fields = ["file", "format"]