CLI
Commandsv0.6.0
Commands, arguments and options.Synopsis
maelys-datalog COMMAND [OPERANDS] [options]Commands
check
maelys-datalog check [POLICY] --domain FILE... [--manifest FILE] [--policy-id ID] [--allow-test-only] [--allow-undeclared-policy-atoms]Validate a policy or manifest; exit 2 means semantic rejection.
POLICY: Datalog source file; omit only with --manifest. Example paths are relative to the maelys-datalog-cli source checkout. Optional.--domain FILE (repeatable): JSON file declaring the domain, predicates and atoms. Required.--manifest FILE: Load a policy set instead of POLICY. Repeat --domain for each domain used by the manifest.--policy-id ID: Identifier for the source policy (default: cli).--allow-test-only: Allow manifest entries marked test-only. Requires --manifest.--allow-undeclared-policy-atoms: Allow manifest policies to use atoms absent from the domain declaration. Requires --manifest.
inspect
maelys-datalog inspect [POLICY] --domain FILE... [--manifest FILE] [--policy-id ID] [--allow-test-only] [--allow-undeclared-policy-atoms]Show compiled policy statistics, limits and authorized queries without solving.
POLICY: Datalog source file; omit only with --manifest. Example paths are relative to the maelys-datalog-cli source checkout. Optional.--domain FILE (repeatable): JSON file declaring the domain, predicates and atoms. Required.--manifest FILE: Load a policy set instead of POLICY. Repeat --domain for each domain used by the manifest.--policy-id ID: Identifier for the source policy (default: cli).--allow-test-only: Allow manifest entries marked test-only. Requires --manifest.--allow-undeclared-policy-atoms: Allow manifest policies to use atoms absent from the domain declaration. Requires --manifest.
queries
maelys-datalog queries [POLICY] --domain FILE... [--manifest FILE] [--policy-id ID] [--allow-test-only] [--allow-undeclared-policy-atoms]List the predicates each policy allows you to query.
POLICY: Datalog source file; omit only with --manifest. Example paths are relative to the maelys-datalog-cli source checkout. Optional.--domain FILE (repeatable): JSON file declaring the domain, predicates and atoms. Required.--manifest FILE: Load a policy set instead of POLICY. Repeat --domain for each domain used by the manifest.--policy-id ID: Identifier for the source policy (default: cli).--allow-test-only: Allow manifest entries marked test-only. Requires --manifest.--allow-undeclared-policy-atoms: Allow manifest policies to use atoms absent from the domain declaration. Requires --manifest.
fingerprint
maelys-datalog fingerprint POLICY --domain FILE [--policy-id ID] [--work-limit N]Show the policy fingerprint and its configured execution fingerprint.
POLICY: Datalog source file. Example paths are relative to the maelys-datalog-cli source checkout.--domain FILE: JSON file declaring the domain, predicates and atoms. Required.--policy-id ID: Identifier for the source policy (default: cli).--work-limit N: Positive cooperative work budget; unsupported by the reference backend. Omit for no limit.
solve
maelys-datalog solve POLICY --domain FILE --facts FILE [--policy-id ID] [--query PRED[/ARITY]...] [--work-limit N]Evaluate a policy with input facts and print query results.
POLICY: Datalog source file. Example paths are relative to the maelys-datalog-cli source checkout.--domain FILE: JSON file declaring the domain, predicates and atoms. Required.--facts FILE: Datalog file containing input facts (EDB); rules are not accepted. Required.--policy-id ID: Identifier for the source policy (default: cli).--query PRED[/ARITY] (repeatable): Select results by predicate name or name/arity. Repeat to select several; defaults to all authorized queries.--work-limit N: Positive cooperative work budget; unsupported by the reference backend. Omit for no limit.
explain
maelys-datalog explain POLICY PREDICATE [TERMS...] --domain FILE --facts FILE --why true|false [--raw] [--policy-id ID] [--work-limit N]Evaluate a policy and explain why a fact is present or absent.
POLICY: Datalog source file. Example paths are relative to the maelys-datalog-cli source checkout.PREDICATE: Authorized predicate name, optionally followed by /ARITY.TERMS: One argument per term: an int64, true, false or a double-quoted symbol. Preserve the symbol quotes with shell quoting, e.g. '"Leela"'. Omit terms only for a predicate of arity zero. Optional.--raw: Print the SDK explanation document verbatim in text format; JSON always includes it.--domain FILE: JSON file declaring the domain, predicates and atoms. Required.--facts FILE: Datalog file containing input facts (EDB); rules are not accepted. Required.--why true|false: true: explain a derivation; false: explain an absent fact. Text is readable prose; JSON retains the SDK document and typed structure. Required.--policy-id ID: Identifier for the source policy (default: cli).--work-limit N: Positive cooperative work budget; unsupported by the reference backend. Omit for no limit.
help
maelys-datalog help [COMMAND_ID] | --helpShow the help of the program, of one command or of one family.
COMMAND_ID: Stable command identifier whose help is shown, or the family of commands under an identifier. Optional.
version
maelys-datalog version | --versionShow the product, program, version and contract.
describe
maelys-datalog describe [COMMAND_ID] [--summary] [--prefix PREFIX]Show the machine-readable catalog, its summary or one descriptor.
COMMAND_ID: Stable command identifier returned by the catalog. Optional.--summary: Return the compact command inventory without output schemas.--prefix PREFIX: Restrict the summary to one command namespace: the command named PREFIX and every command whose identifier starts with PREFIX followed by a dot. Requires --summary. Conflicts with COMMAND_ID.
completion
maelys-datalog completion SHELLPrint the shell completion script generated from the catalog.
SHELL: Shell whose completion script is printed.
Global options
--format text|json|jsonl: Select text for humans, json for one envelope or jsonl for records. Default: text.--json: Exact alias of --format json.--compact: Render JSON on a single line.--pretty: --pretty=false selects compact JSON.--non-interactive: Never prompt; fail instead of asking a question.--color auto|always|never: Control ANSI colors on terminals. Default: auto.--progress auto|always|never: Show the progress of a long run on stderr in text mode: auto only when stderr is a terminal. Default: auto.--verbose: Add the details of the run on stderr in text mode; silent in JSON.--pager auto|always|never: Page the text rendering when stdout is a terminal; never in a pipe, in JSON or under --non-interactive. Default: auto.--field NAME: Render one top-level member of data instead of the whole result, by the text or jsonl rendering rules.--lang TAG: Language of the human text.--help: Show the help of the selected command.
Examples
Validate the RBAC policy and its domain.
maelys-datalog check --domain cli/tests/fixtures/rbac.domain.json cli/tests/fixtures/rbac.dlValidate a manifest with two domains.
maelys-datalog check --domain cli/tests/fixtures/rbac.domain.json --domain cli/tests/fixtures/typed.domain.json --manifest cli/tests/fixtures/examples.manifest.jsonInspect the RBAC compiled policy and its authorized queries.
maelys-datalog inspect --domain cli/tests/fixtures/rbac.domain.json cli/tests/fixtures/rbac.dlInspect the enabled policies of a multi-domain manifest.
maelys-datalog inspect --domain cli/tests/fixtures/rbac.domain.json --domain cli/tests/fixtures/typed.domain.json --manifest cli/tests/fixtures/examples.manifest.jsonList the RBAC policy authorized queries.
maelys-datalog queries --domain cli/tests/fixtures/rbac.domain.json cli/tests/fixtures/rbac.dlShow the RBAC policy and execution fingerprints.
maelys-datalog fingerprint --domain cli/tests/fixtures/rbac.domain.json cli/tests/fixtures/rbac.dlEvaluate the RBAC policy and list all authorized query results.
maelys-datalog solve --domain cli/tests/fixtures/rbac.domain.json --facts cli/tests/fixtures/rbac.facts.dl cli/tests/fixtures/rbac.dlShow only can_deliver/1 results.
maelys-datalog solve --domain cli/tests/fixtures/rbac.domain.json --facts cli/tests/fixtures/rbac.facts.dl --query can_deliver/1 cli/tests/fixtures/rbac.dlExplain why can_deliver("Leela") is derived.
maelys-datalog explain --domain cli/tests/fixtures/rbac.domain.json --facts cli/tests/fixtures/rbac.facts.dl --why true cli/tests/fixtures/rbac.dl can_deliver '"Leela"'Explain why can_deliver("Mallory") is absent, as JSON with text and typed structure.
maelys-datalog explain --domain cli/tests/fixtures/rbac.domain.json --facts cli/tests/fixtures/rbac.facts.dl --why false cli/tests/fixtures/rbac.dl can_deliver '"Mallory"' --format jsonQuery the symbol "Leela"; keep its double quotes inside one shell argument.
maelys-datalog explain --domain cli/tests/fixtures/typed.domain.json --facts cli/tests/fixtures/typed.facts.dl --why true cli/tests/fixtures/typed.dl seen '"Leela"'Explain an integer query.
maelys-datalog explain --domain cli/tests/fixtures/typed.domain.json --facts cli/tests/fixtures/typed.facts.dl --why true cli/tests/fixtures/typed.dl seen 3Explain a boolean query.
maelys-datalog explain --domain cli/tests/fixtures/typed.domain.json --facts cli/tests/fixtures/typed.facts.dl --why true cli/tests/fixtures/typed.dl seen trueExit status
0: Command completed.1: Execution failed.2: Valid report with violations.
Environment
MAELYS_CLI_FORMAT: The format when no option names one: text, json or jsonl.MAELYS_CLI_LANG: The language of the human text when no --lang names one; then LC_ALL, LC_MESSAGES, LANG.NO_COLOR: Set and not empty: no color, unless --color always or CLICOLOR_FORCE.CLICOLOR_FORCE: Set and neither empty nor 0: color even into a pipe, unless --color never.TERM: Unset, empty or dumb: no color, unless --color always or CLICOLOR_FORCE.PAGER: The pager of a long text on a terminal; empty disables it.COLUMNS: The width of the help on a terminal, read before the terminal's own.
See also
maelys-datalog help, maelys-datalog help COMMAND, maelys-datalog describe --format json