genroc

docs / Reference / CLI

Definitions

The genctl commands for definitions: `apply`, `generate`, `schema`, `compat`, `definitions`.

apply

register definitions; --check-only checks them and stores nothing

genctl apply [-f <path|glob> ...] [--channel latest] [--check-only] [--json]

Validates every definition before registering any. An unchanged definition creates no new version. Each line says what happened on --channel: new version, existing version, or current (nothing moved). Resolvers ($<resolver>:) run first, with --check-only too.

Files: -f takes several values and repeats; without -f, the definitions: list in the nearest .genroc is used. Paths are globbed (** matches any depth); a directory is refused.

Flags

  --channel     channel to apply definitions to (default latest)
  --check-only  report whether the definitions are valid, registering nothing
  -f            definition file or glob; takes several, and repeats
  --json        print the server's answer: the inferred schemas under
                --check-only, what was registered otherwise
  --server      genroc server base URL ($GENROC_SERVER) (default
                http://localhost:8448)

generate

write the type declarations a resolver's scripts import

genctl generate [-f <path|glob> ...]

Writes the declarations each resolver generates, so an editor has them before the first apply. Needs no server.

Files: -f takes several values and repeats; without -f, the definitions: list in the nearest .genroc is used. Paths are globbed (** matches any depth); a directory is refused.

Flags

  -f  definition file or glob; takes several, and repeats

schema

what a slot's type is, and what an expression there can read

genctl schema type    <process> [address] [-e <expression>] [-f <path|glob> ...] [--json]
genctl schema context <process> [address] [-e <expression>] [-f <path|glob> ...] [--json]

type prints a slot's schema; context prints what an expression there can read. Addresses: input, output, tasks.<id>.output, tasks.<id>.action.input, raises["code"], optionally continuing into the schema (tasks["step one"].output.items). With no address, lists every slot. -e types one expression at that address. Needs no server.

Files: -f takes several values and repeats; without -f, the definitions: list in the nearest .genroc is used. Paths are globbed (** matches any depth); a directory is refused.

compat

compare two versions and report what a move would break

genctl compat --from <sel> [-f <path|glob> ...]
genctl compat --from <sel> --to <sel> [--process <name>] [--ignore contract] [--json]
genctl compat <instance-id> --to <version|channel>

A side is a channel or name@version pins, not both. With -f, the local files are the target. compat <id> --to N checks one instance; upgrade is the same with the move.

Exits 1 on a break. --ignore contract still prints contract breaks but does not fail.

Files: -f takes several values and repeats; without -f, the definitions: list in the nearest .genroc is used. Paths are globbed (** matches any depth); a directory is refused.

Flags

  -f         definition file or glob to compare against --from; takes
             several, and repeats
  --from     the current side: a channel, or name@version (repeatable)
  --ignore   do not fail on this check; only `contract` is accepted
  --json     print the raw report
  --process  narrow the report to one process
  --server   genroc server base URL ($GENROC_SERVER) (default
             http://localhost:8448)
  --to       the target side: a channel, or name@version (repeatable);
             after an instance id, a version or channel

definitions

list registered definitions

genctl definitions [--sort created|name] [--since <when>] [--until <when>] [--json]

With --sort name, shows the first 20 alphabetically rather than the newest.

Shows the newest 20 rows (logs: 200), oldest first, and says on stderr when rows were left out. --since and --until take a duration (2h, 45m) or a timestamp (2006-01-02 15:04), read in the local zone ($TZ).

Flags

  --json    print the raw items as a JSON array
  --server  genroc server base URL ($GENROC_SERVER) (default
            http://localhost:8448)
  --since   show rows from this point on: a duration ago (2h) or a
            timestamp
  --sort    sort key: created (newest registered first) or name (default
            created)
  --until   show rows before this point; same forms as --since