hourctl: packages
Build, test, render and replay protocol and policy packages on this machine, offline, against a packages folder (pkg build, pkg test, pkg render, pkg replay); push the bundles to a running server (a policy package to its tenant), choose which revision runs, and set the vars and secrets packages read.
Every hourctl command also takes the connection options.
hourctl pkg
Packages: build, test, render and replay them on this machine; push bundles, activate a revision, and list and show packages on the server.
build, test, render and replay run on this machine, offline, against a packages folder: they reach no server. Each bundle pushed (hourctl pkg build makes them) is kept as a revision of its package line. Activating a revision makes every instance run it; rolling back is activating an earlier one.
hourctl pkg [OPTIONS] <COMMAND>Commands:
list: List the package lines: the revision active, and what this instance runs.show: Show one package: its revisions, what every instance runs, and its catalog.push: Push bundles to the gateway, and with —activate make each the active revision of its line.publish: Publish bundles: push each, its scenarios run on the server, then activate it.adopt: Adopt a shared package for the tenant, following a major version.pin: Pin a shared package for the tenant at one version.drop: Drop a shared package the tenant adopted.adopted: List the shared packages the tenant adopted.activate: Make a revision the one every instance runs.test: Run every package’s scenarios and report route and command coverage, on this machine, offline.render: Print the payload a package builds for one of its commands, on this machine, offline.replay: Replay a capture against a package as it is in the folder, on this machine, offline, and show where its replies differ from the recorded ones.build: Build one package, or every package in a folder, into bundles, on this machine, offline, forhourctl pkg push.
hourctl pkg list
List the package lines: the revision active, and what this instance runs.
Prints each line, its active revision and version, its revisions, and what the instance that answered runs of it.
With —policy, the tenant’s own policy packages (--tenant); with —shared, the shared packages, each version published a line.
hourctl pkg list [OPTIONS]Options:
--policy: The tenant’s own policy packages, not the install’s packages.--shared: The shared policy packages, not the install’s packages.
Examples:
hourctl pkg listhourctl -t acme pkg list --policyhourctl pkg list --sharedhourctl pkg show
Show one package: its revisions, what every instance runs, and its catalog.
Prints every revision (version, hash, host API, when and by whom it was pushed), for each line the revision active and what each instance runs or why it refused it, and the catalog: its standard and package actions, commands, settings and endpoint options, every parameter typed.
With —policy, one of the tenant’s own policy packages, and its hooks; with —shared, a shared package (a failed revision says what failed).
hourctl pkg show [OPTIONS] <NAME>Arguments:
<NAME>: The package’s name, e.g. zk-push.
Options:
--policy: One of the tenant’s own policy packages.--shared: A shared policy package.
Examples:
hourctl pkg show zk-pushhourctl -t acme pkg show clock-lifecycle --policyhourctl pkg show overtime --sharedhourctl pkg push
Push bundles to the gateway, and with —activate make each the active revision of its line.
Each bundle is checked (its Lua compiled, its declarations read, its scenarios run) and kept as a revision; pushing one that is there already says “pushed before”. With —activate, once every bundle is pushed, each is activated and (without —json) hourctl waits for every instance to run it, saying who it waits for. A bundle that fails does not stop the others; the command fails if any did. A policy package is pushed to the tenant (--tenant, the default tenant without it): it is the tenant’s own; with —shared, it is a shared package, for every tenant to adopt. A bundle whose scenarios fail is kept as a failed revision, never activated, and the command fails.
hourctl pkg push [OPTIONS] <BUNDLE>...Arguments:
<BUNDLE>...: The bundle files to push (hourctl pkg buildmakes them).
Options:
--activate: Make each bundle the active revision of its line once pushed.--shared: Push policy packages as shared packages, not the tenant’s own.
Examples:
hourctl pkg push zk-push-3.4.0.tar.gz --activatehourctl -t acme pkg push clock-lifecycle-1.0.0.tar.gz --activatehourctl pkg publish
Publish bundles: push each, its scenarios run on the server, then activate it.
As pkg push --activate. With —shared, each is a shared policy package: its version is published for the whole install, and every tenant following its major version runs it (each is sent package.updated); a tenant pinning a version keeps it. A published version never changes: a fix is a new version. A bundle whose scenarios fail is kept as a failed revision and changes no tenant.
hourctl pkg publish [OPTIONS] <BUNDLE>...Arguments:
<BUNDLE>...: The bundle files to publish (hourctl pkg buildmakes them).
Options:
--shared: Publish policy packages as shared packages.
Example:
hourctl pkg publish --shared overtime-2.4.0.tar.gzhourctl pkg adopt
Adopt a shared package for the tenant, following a major version.
Each version of NAME@MAJOR published reaches the tenant (--tenant) from then on; its endpoints name it as their policy (policy = "overtime@2"). Replaces what the tenant adopted of it.
hourctl pkg adopt [OPTIONS] <NAME@MAJOR>Arguments:
<NAME@MAJOR>: The shared package and the major version to follow, e.g. overtime@2.
Example:
hourctl -t acme pkg adopt overtime@2hourctl pkg pin
Pin a shared package for the tenant at one version.
The tenant (--tenant) runs NAME@VERSION until told otherwise, whatever is published after it. Replaces what the tenant adopted of it.
hourctl pkg pin [OPTIONS] <NAME@VERSION>Arguments:
<NAME@VERSION>: The shared package and the version to pin, e.g. [email protected].
Example:
hourctl pkg drop
Drop a shared package the tenant adopted.
Refused while one of the tenant’s endpoints names it as its policy.
hourctl pkg drop [OPTIONS] <NAME>Arguments:
<NAME>: The shared package’s name, e.g. overtime.
Example:
hourctl -t acme pkg drop overtimehourctl pkg adopted
List the shared packages the tenant adopted.
Prints each, what the tenant adopted (the major version it follows, or the version it pins) and the version it runs now.
hourctl pkg adopted [OPTIONS]Example:
hourctl -t acme pkg adoptedhourctl pkg activate
Make a revision the one every instance runs.
Activates the revision, then (without —json) waits for every instance to run it, saying who it waits for, and prints how many do. An instance that refuses it says why, and the command fails. Rolling back is activating an earlier revision (hourctl pkg show lists them).
With —policy, a revision of one of the tenant’s own policy packages; with —shared, of a shared package (publishing its version).
hourctl pkg activate [OPTIONS] <NAME@REVISION>Arguments:
<NAME@REVISION>: The package’s name and the revision number, e.g. zk-push@7.
Options:
--policy: One of the tenant’s own policy packages.--shared: A shared policy package.
Examples:
hourctl pkg activate zk-push@7hourctl -t acme pkg activate clock-lifecycle@2 --policyhourctl pkg test
Run every package’s scenarios and report route and command coverage, on this machine, offline.
Runs the scenarios (each package’s tests/*.toml) of the packages in a folder, as a server runs the package, without reaching one; prints ok or FAIL for each, then how many of each package’s routes, commands and actions are tested. Exits 1 on a failed scenario or, unless —allow-untested, on any untested route, command, action or sync declaration.
hourctl pkg test [OPTIONS] [FILTER]Arguments:
[FILTER]: Only run the scenarios whose package id or path contains this text. Coverage is not checked.
Options:
-p, --packages <PATH>: The packages folder. Default:packages.--allow-untested: Do not fail because of untested routes, commands, actions or sync declarations.
Examples:
hourctl pkg testhourctl pkg test zk-pushhourctl pkg render
Print the payload a package builds for one of its commands, on this machine, offline.
The package is read from a packages folder; no server is reached. The parameters are checked as the gateway checks them before it queues a command; every value is passed as text. A payload that is not text is printed as base64: followed by its base64.
hourctl pkg render [OPTIONS] <PACKAGE> <ACTION> [KEY=VALUE]...Arguments:
<PACKAGE>: The package: a name, or a name and version prefix, e.g. zk-push or [email protected]. With several matches the highest version is used.<ACTION>: The command, e.g. add_user.[KEY=VALUE]...: The command’s parameters, as KEY=VALUE.
Options:
-p, --packages <PATH>: The packages folder. Default:packages.
Example:
hourctl pkg render zk-push add_user user_id=1001 name="Ana Diaz"hourctl pkg replay
Replay a capture against a package as it is in the folder, on this machine, offline, and show where its replies differ from the recorded ones.
A capture is what hourctl wire --save writes. No server is reached. Exits 1 when a reply differs, unless —accept made the capture a test. With —json each exchange is one JSON object per line on stdout, and everything else goes to stderr.
hourctl pkg replay [OPTIONS] <CAPTURE> [PACKAGES]Arguments:
<CAPTURE>: The capture file.[PACKAGES]: The packages folder, or one package’s folder. Default:packages.
Options:
--watch: Replay again whenever a package file is saved.--accept: Make the capture a test of the package: write the package’s tests/NAME.toml (NAME from the capture’s file name), expecting what the package answers now. The test keeps the capture’s serials, keys and PINs, so on Unix it is written readable by its owner alone (mode 0600): take them out before committing it.
Examples:
hourctl pkg replay office-capture.tomlhourctl pkg replay office-capture.toml packages --accepthourctl pkg build
Build one package, or every package in a folder, into bundles, on this machine, offline, for hourctl pkg push.
DIR is a package’s folder (with package.toml), built into one bundle, or a packages folder, every package under it built into a bundle of its own. Shared modules are resolved, the Lua compiled, every declaration checked and the package’s scenarios run; a package that fails any of that is not built. The same package always makes the same bundle. Prints each bundle’s path, package, version, host API, hash and scenarios passed.
hourctl pkg build [OPTIONS] <DIR>Arguments:
<DIR>: The package’s folder, or a packages folder.
Options:
-o, --out <PATH>: The bundle to write (one package), or the folder to write them in. Default: NAME-VERSION.tar.gz in the current folder.
Examples:
hourctl pkg build packages/zk/push-3.4hourctl pkg build packages --out disthourctl var
Set, list and delete the vars packages read (vars.get).
A var belongs to a tenant (—tenant): to all of its packages, or with —package to one package (all its versions); a package reads its own var over the tenant’s of the same name. Values are shown: keep credentials in hourctl secret.
hourctl var [OPTIONS] <COMMAND>Commands:
set: Set a var, for the tenant or one package.list: List the vars: name, scope (tenant or package), value, and when and by whom each was last set.delete: Delete a var.
hourctl var set
Set a var, for the tenant or one package.
hourctl var set [OPTIONS] <NAME> <VALUE>Arguments:
<NAME>: The var’s name.<VALUE>: Its value, as text.
Options:
--package <NAME>: The package (by name) the var is for; without it, the tenant’s.
Example:
hourctl var set ntp_server time.example.com --package zk-pushhourctl var list
List the vars: name, scope (tenant or package), value, and when and by whom each was last set.
hourctl var list [OPTIONS]Example:
hourctl var listhourctl var delete
Delete a var. Refused while a package in use requires it.
hourctl var delete [OPTIONS] <NAME>Arguments:
<NAME>: The var’s name.
Options:
--package <NAME>: The package (by name) whose var it is; without it, the tenant’s.
Example:
hourctl var delete ntp_server --package zk-pushhourctl secret
Set, list and delete the secrets packages read (secrets.get).
A secret belongs to a tenant (—tenant): to all of its packages, or with —package to one package. It is sealed at rest with the gateway’s secret key (HOURADVANTAGE_SECRET_KEY) and never shown again: its value is never taken on the command line, and secret list shows names and dates only.
hourctl secret [OPTIONS] <COMMAND>Commands:
set: Set a secret, for the tenant or one package.list: List the secrets’ names, scopes and dates, never their values.delete: Delete a secret.
hourctl secret set
Set a secret, for the tenant or one package.
The value comes from —file, else is asked for at the terminal (not shown as typed), else is read from stdin. One trailing line break is not part of it, and it may not be empty.
hourctl secret set [OPTIONS] <NAME>Arguments:
<NAME>: The secret’s name.
Options:
--package <NAME>: The package (by name) the secret is for; without it, the tenant’s.--file <FILE>: Read the value from this file.
Examples:
hourctl secret set api_token --package zk-pushhourctl secret set api_token --file api-token.txthourctl secret list
List the secrets’ names, scopes and dates, never their values.
hourctl secret list [OPTIONS]Example:
hourctl secret listhourctl secret delete
Delete a secret. Refused while a package in use requires it.
hourctl secret delete [OPTIONS] <NAME>Arguments:
<NAME>: The secret’s name.
Options:
--package <NAME>: The package (by name) whose secret it is; without it, the tenant’s.
Example:
hourctl secret delete api_token --package zk-push