Command line
Hour Advantage is three programs:
hourd, the server: Hour Advantage Connect, and Time and Attendance where enabled, and the development gateway. The only one that accepts connections.hourctlcontrols running servers through their admin API, and builds, tests, renders and replays packages on this machine, offline (hourctl pkg build|test|render|replay,hourctl attend test).houradminstalls and maintains: the admin password hash, the secret key, the Windows service.
Each group of commands has a page of its own; the tables below say what is where. <program> <command> --help prints the same text as the command’s section here.
hourd: the server
Run the server (Hour Advantage Connect, and Time and Attendance where enabled), check that it answers, and run the development gateway that serves the packages in a folder as they are on disk. hourd is the only program that accepts connections. The whole page.
| Command | What it does |
|---|---|
hourd run | Run the server: Hour Advantage Connect, and Hour Advantage Time and Attendance where enabled. |
hourd healthcheck | Check that the server on this machine answers, for a container health check. |
hourd dev | Develop packages: the whole gateway, running the packages in a folder as they are on disk. |
houradm: install and maintain
Make the admin password hash and the secret key the server reads at startup. On Windows, houradm also installs the server as a service (the Deploying page of the docs covers it under “Windows service”). The whole page.
| Command | What it does |
|---|---|
houradm hash-password | Print an argon2 hash of a password, for HOURADVANTAGE_ADMIN_PASSWORD_HASH. |
houradm gen-secret-key | Print a new key for sealing the secrets kept in the database, for HOURADVANTAGE_SECRET_KEY. |
Connecting to a server
Control running Hour Advantage servers through their admin API.
hourctl finds the admin API at —admin, else at the cluster —cluster names, else at $HOURADVANTAGE_ADMIN_URL, else at the current cluster (hourctl cluster use), else at http://127.0.0.1:9090. A named cluster whose token variable is set (hourctl cluster add --token-env) signs in with that token. Otherwise hourctl signs in with the named API token in $HOURADVANTAGE_ADMIN_TOKEN (or the file $HOURADVANTAGE_ADMIN_TOKEN_FILE names) when one is set, else with the admin login: the user name from —admin-user or $HOURADVANTAGE_ADMIN_USERNAME, and the password from $HOURADVANTAGE_ADMIN_PASSWORD or the file $HOURADVANTAGE_ADMIN_PASSWORD_FILE names. The password is never taken on the command line. With none of them set, hourctl sends no credentials, which only a server without an admin login accepts.
A command prints a table or a few lines; —json prints the API’s JSON instead. An error is one line on stderr, starting error:, and the exit status is 1.
Before its first change, hourctl says on stderr which environment it changes when the server names one, e.g. changing PRODUCTION (gateway.example.com:9090), or with a named cluster changing PRODUCTION (production at gateway.example.com:9090). After a change to the setup it waits for every instance to apply it or refuse it (no time to give up at: it says who it waits for as that changes, and a refusal says why), and says how far they got, e.g. applied on 3/3 instances (config version 42).
Time and Attendance is under hourctl attend; everything else is Hour Advantage Connect’s.
hourctl pkg build|test|render|replay and hourctl attend test run on this machine, offline: they read package folders, run the packages as a server does, and reach no server.
Options:
--admin <URL>: The admin API’s URL, e.g. http://gateway.example.com:9090. Without a scheme, http:// is assumed. Default: $HOURADVANTAGE_ADMIN_URL, else the current cluster (hourctl cluster use), else http://127.0.0.1:9090. Applies to every subcommand.--cluster <NAME>: The named cluster to talk to (hourctl cluster add): its admin URL, and its token from the variable it names. Default: the current cluster (hourctl cluster use) when neither —admin nor $HOURADVANTAGE_ADMIN_URL is given. Applies to every subcommand.--admin-user <NAME>: The admin login’s user name. Default: $HOURADVANTAGE_ADMIN_USERNAME (the variable the gateway reads its login from). The password comes from $HOURADVANTAGE_ADMIN_PASSWORD or the file $HOURADVANTAGE_ADMIN_PASSWORD_FILE names, never from the command line. Applies to every subcommand.--json: Print the admin API’s JSON answer instead of a table or text, for scripts. A command that follows a feed (—follow,stream,wire) prints one JSON object per line. Applies to every subcommand.-t, --tenant <ID>: The tenant a command works on: in Connect, whose listeners, endpoints, sinks, sync groups, devices, jobs, vars and secrets (/api/tenants/ID/...),default(the tenant a fresh install has) when none is named; in Time and Attendance (attend), whose time, which every command butattend tenantsandattend testneeds named. Default: $HOURADVANTAGE_TENANT. Tenants themselves, settings, packages and tokens are the install’s, whatever it says. Applies to every subcommand. Environment:HOURADVANTAGE_TENANT.--install: Work on the install’s own setup instead of a tenant’s:sinks,sinkandexportare the install-level sinks and the install’s setup (settings, log level, tenants), andapplyapplies a file of those. Applies to every subcommand.--insecure: Send the admin login or an API token over plain http:// to a host that is not this machine, where anyone on the way can read it. Without this,hourctlrefuses: reach the admin API through a TLS proxy (https://). Default: $HOURADVANTAGE_INSECURE (1,true,yesoron;0,false,no,offor empty are off), for a job that reaches the admin API over a private network. Applies to every subcommand. Environment:HOURADVANTAGE_INSECURE.--request-id <ID>: The request id every call of this command is sent with (X-Request-Id), to find it by in the gateway’s log, its audit trail and the events it causes. 1 to 128 letters, digits,-,_,.or:. Default: a new one for each command, printed with any error the gateway answers. Applies to every subcommand.
Example:
hourctl --admin http://gateway.example.com:9090 statushourctl: setup and status
See how the server is doing, manage its tenants, export and apply a tenant’s setup (or the install’s, with —install) as a file, compare two clusters and promote packages and setup from one to the other, change its settings, read who changed what, and manage the tokens that may use the admin API and the clusters hourctl knows by name. Every command works on one tenant’s resources: —tenant (or $HOURADVANTAGE_TENANT) names it, default unless said. The whole page.
| Command | What it does |
|---|---|
hourctl status | Show whether the gateway is up, and counts of what it runs. |
hourctl tenants | List the tenants: id, name, status and own limits. |
hourctl tenant | Add, change, suspend, resume, stop or delete a tenant. |
hourctl apply | Make the gateway’s setup match a setup file. |
hourctl export | Print the gateway’s setup as a file hourctl apply reads. |
hourctl diff | Compare the setup of two clusters, read-only. |
hourctl promote | Copy the setup from one cluster to another: packages, listeners, endpoints, sinks, sync groups, vars and settings. |
hourctl cluster | Name the clusters hourctl talks to: add, list, remove, and choose the current one. |
hourctl settings | Show the gateway’s settings, or change them. |
hourctl peers | List the gateway’s instances and the config version each has applied. |
hourctl audit | Read the audit trail (who changed what), oldest first. |
hourctl token | Create, list and revoke named API tokens for the admin API. |
hourctl attend: Time and Attendance
Hour Advantage Time and Attendance, on an instance that runs it: read people’s ledgers and the facts they are worked out from, record corrections and other facts, see who waits to be worked out again, and change the setup, policy layers and policy packages. hourctl attend test runs a policy package’s scenarios on this machine, offline, laid out as the cookbook’s recipes are. The whole page.
| Command | What it does |
|---|---|
hourctl attend ledger | Show a person’s ledger of the pay period a day is in, as last worked out. |
hourctl attend person | Show a person’s employment on a day: whether employed, since when, on leave, for how many days, and the attributes in force. |
hourctl attend facts | List the facts a person’s ledgers are worked out from. |
hourctl attend record | Record facts about a person: all of them, or none. |
hourctl attend exceptions | List the exceptions to follow up, by time: by default those someone still has to deal with (open or acknowledged). |
hourctl attend note | Note one of a person’s exceptions: acknowledge it (seen, being dealt with), excuse it (accepted as it is: it no longer keeps approval back), or reopen it. |
hourctl attend pending | List who waits to have their ledgers worked out again, and why a try failed, by person, a page at a time. |
hourctl attend recalculate | Work people out again keeping nothing: from their facts alone, from their first day, reusing none of what is kept (a ledger kept wrong in a way its digests do not show, by a build with a fault, is put right). |
hourctl attend people | List the people, by id: everyone the tenant knows, or those under an organization on a day. |
hourctl attend timecards | List a pay period’s timecards, by person: paid hours, approved, closed, and the exceptions still to deal with; everyone’s, or those under an organization (by default on the period’s last day). |
hourctl attend hierarchies | List, make and rename the tenant’s hierarchies of organizations. |
hourctl attend orgs | List, show, make, change and move the organizations of a hierarchy. |
hourctl attend locations | List, show, make and change the tenant’s work locations. |
hourctl attend clocks | List, show, make, change and remove the tenant’s clock records, and re-stamp a clock’s punches with its record. |
hourctl attend unlinked | List the unlinked people (whom punches arrived for under the sender’s ids only), show one, and link one to the person they are. |
hourctl attend unreadable | List the punches that were delivered but could not be read (no time, no device or no user to place them on), each as it came and why, or forget one once it is put right. |
hourctl attend employers | List, show, make and change the tenant’s employers: the legal entities its people are employees of. |
hourctl attend employee | Show or set a person’s employee record (their employer, for good, and their worker); list a worker’s records. |
hourctl attend setup | Show, set and remove setup items: the tenant’s, or a person’s own. |
hourctl attend layer | List and add policy layers. |
hourctl attend pkg | Publish, list and show policy packages (the install’s shared ones, with —shared, or the tenant’s own), and adopt, pin and drop them for the tenant. |
hourctl attend leave | List a person’s leave, ask for leave, decide on it, take it back. |
hourctl attend export | Export a pay period with an exporter, list exports, and show one with whose time changed since. |
hourctl attend sinks | List the sinks Time and Attendance’s events are sent to, and what is waiting for each: the tenant’s (sent its events, and those posted into it by the sources each names), or with —install the install’s (sent every tenant’s events). |
hourctl attend sink | Add, change, move or remove one of Time and Attendance’s sinks: a webhook its events are posted to, as Connect’s sinks are, in order and until it answers 2xx. |
hourctl attend events | Read the tenant’s events in Time and Attendance’s log, oldest first: the engine’s own, and those other systems posted into the tenant. |
hourctl attend event | Post events into the tenant’s log in Time and Attendance, as another system does. |
hourctl attend delivery-keys | Issue, list and revoke the tenant’s delivery keys: what a Connect sink (of this install or another) or any other system delivers punches into the tenant with. |
hourctl attend tenants | Create, list, show, change, suspend, resume and delete tenants; write a tenant out, load one in. |
hourctl attend test | Run the scenarios of a policy package, as a cookbook recipe is laid out, on this machine, offline. |
hourctl: listeners, endpoints, sinks and routes
Set up where devices connect (listeners), which package reads them (endpoints), where their events go (sinks), and where people’s punches go (routes), and route the punches that go nowhere yet. The whole page.
| Command | What it does |
|---|---|
hourctl listeners | List the listeners and whether each is running. |
hourctl listener | Add, change, remove, stop or start a listener. |
hourctl endpoints | List the endpoints: where on a listener each one is, its package and sinks. |
hourctl endpoint | Add, change, remove, stop or start an endpoint. |
hourctl sinks | List the sinks and what is waiting for each. |
hourctl sink | Add, change, move or remove a sink. |
hourctl route | List, add or remove routes: where punches can go. |
hourctl unrouted | List a sync group’s unrouted punches, or route them. |
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. The whole page.
| Command | What it does |
|---|---|
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. |
hourctl var | Set, list and delete the vars packages read (vars.get). |
hourctl secret | Set, list and delete the secrets packages read (secrets.get). |
hourctl: devices
The device register: find devices, let them in or keep them out, and key and label them. The whole page.
| Command | What it does |
|---|---|
hourctl devices | List the devices in the register. |
hourctl device | Look up, register, allow, block, key, label, release or forget one device. |
hourctl: actions and jobs
Ask a device to do something, follow or cancel what it was asked, or run one action over many devices in waves (a job). The whole page.
| Command | What it does |
|---|---|
hourctl action | Queue an action for a device, or show or cancel one. |
hourctl actions | List a device’s actions, oldest first. |
hourctl job | Run one action over many devices, in waves: create, list, show and steer jobs. |
hourctl: sync groups
List, create and change sync groups: their members, placement rules, people, rows and settings. The whole page.
| Command | What it does |
|---|---|
hourctl sync show | Show one group: its settings, endpoints, and per domain its rows and how its members stand. |
hourctl sync status | List a group’s members: their rows by domain and state, errors and pauses. |
hourctl sync create | Add a group. |
hourctl sync set | Change a group’s settings, as KEY=VALUE. |
hourctl sync delete | Remove a group. |
hourctl sync rows | List one member’s rows, and where the member is with each. |
hourctl sync resync | Send a member every row again, of one domain or all. |
hourctl sync retry | Send a member’s failed rows again, of one domain or all. |
hourctl sync resume | Take in again what a member paused by the bulk-delete guard reports. |
hourctl sync forget | Forget a device that left the group: the deletes it never confirmed stop waiting for it. |
hourctl sync placement | Show a group’s placement rules (which people go to which members), or change them. |
hourctl sync people | List the group’s people. |
hourctl sync person | Show, write or delete one person. |
hourctl sync change-id | Give a person a new user id on every member. |
hourctl sync retry-change-id | Carry on with an id change where it stopped, from that step. |
hourctl sync biometrics | Show whether a person may have biometrics in the group, or allow or refuse them. |
hourctl sync setting | Show the values a group keeps for a settings class, or set them. |
hourctl sync row | Show, write or delete one access or list row. |
hourctl sync changes | Read the change feed: every row changed after a version, deletes included. |
hourctl sync punches | Show a person’s latest punch in the group, and the few before it. |
hourctl: watching
Read stored events, post events as another system does, read failed device messages, set the log level, read the device messages an instance has in hand, and watch what happens on every instance, live. The whole page.
| Command | What it does |
|---|---|
hourctl events | Read stored events, oldest first. |
hourctl event | Post events into the tenant’s event log, as another system does. |
hourctl failures | List device messages that failed, newest first. |
hourctl logs | Show the log level, or change it on every instance. |
hourctl wire | Watch every byte devices send and receive, on every instance, live. |
hourctl stream | Watch what happens on every instance, live, until Ctrl-C. |
hourctl requests | List the device messages the instance that answers is handling now, and what each is doing. |