Skip to content

hourctl: 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.

Every hourctl command also takes the connection options.

hourctl status

Show whether the gateway is up, and counts of what it runs.

Prints one line each for the gateway (URL, version, instance, and whether it is shutting down or cannot reach its database), the listeners (running, stopped, failed), the endpoints (stopped), the devices (allowed, pending, blocked) and the sinks (events waiting, sinks failing). A part the gateway has no route for (an older gateway) is shown as unavailable; one it refuses to give (a login it does not accept, an error) is shown the same and the command exits 1, after the rest is printed.

hourctl status [OPTIONS]

Example:

Terminal window
hourctl status

hourctl tenants

List the tenants: id, name, status and own limits.

A tenant is whoever operates clocks through this install: each has its own listeners, endpoints, sinks, sync groups, devices, jobs, vars and secrets (--tenant picks whose a command works on).

hourctl tenants [OPTIONS]

Example:

Terminal window
hourctl tenants

hourctl tenant

Add, change, suspend, resume, stop or delete a tenant.

Suspending or stopping a tenant stops everything Connect does for it: its devices are told to come back later (and keep what they have), no command goes out, and none of its jobs, sync groups or sinks runs, until it is resumed. Only an install token (or the login) reaches these.

hourctl tenant [OPTIONS] <COMMAND>

Commands:

  • create: Add a tenant.
  • show: Show one tenant.
  • set: Change a tenant’s name, external ids, metadata or limits; only what is given changes.
  • suspend: Suspend a tenant: nothing of it runs until it is resumed.
  • resume: Resume a suspended or stopped tenant.
  • stop: Stop a tenant (it has left): nothing of it runs, and it is kept until it is deleted or resumed.
  • delete: Delete a tenant and everything Connect keeps of it: its devices, events, sync data, jobs, vars and secrets, and its listeners, endpoints, sinks and sync groups.

hourctl tenant create

Add a tenant.

hourctl tenant create [OPTIONS] <ID>

Arguments:

  • <ID>: The tenant’s id: 1 to 64 letters, digits, ’-’ or ’_’, e.g. acme. It cannot be changed.

Options:

  • --name <NAME>: A name for people to know it by.
  • --external-id <SYSTEM=ID>...: What another system knows it by, SYSTEM=ID; once per system. SYSTEM= takes it away.
  • --metadata <JSON>: Its metadata, a JSON object, kept as given (set whole).
  • --devices <N>: Devices it may have (allowed or blocked); 0: no limit.
  • --pending-devices <N>: Devices it may have waiting to be allowed; 0: no limit.
  • --people <N>: People its sync groups may keep; 0: no limit.
  • --messages-per-second <N>: Device messages a second its devices may send to one instance; 0: no limit.

Examples:

Terminal window
hourctl tenant create acme --name "Acme Manufacturing"
hourctl tenant create acme --external-id crm=C-1042 --devices 50

hourctl tenant show

Show one tenant.

hourctl tenant show [OPTIONS] <ID>

Arguments:

  • <ID>: The tenant’s id, e.g. acme.

Example:

Terminal window
hourctl tenant show acme

hourctl tenant set

Change a tenant’s name, external ids, metadata or limits; only what is given changes.

hourctl tenant set [OPTIONS] <ID>

Arguments:

  • <ID>: The tenant’s id: 1 to 64 letters, digits, ’-’ or ’_’, e.g. acme. It cannot be changed.

Options:

  • --name <NAME>: A name for people to know it by.
  • --external-id <SYSTEM=ID>...: What another system knows it by, SYSTEM=ID; once per system. SYSTEM= takes it away.
  • --metadata <JSON>: Its metadata, a JSON object, kept as given (set whole).
  • --devices <N>: Devices it may have (allowed or blocked); 0: no limit.
  • --pending-devices <N>: Devices it may have waiting to be allowed; 0: no limit.
  • --people <N>: People its sync groups may keep; 0: no limit.
  • --messages-per-second <N>: Device messages a second its devices may send to one instance; 0: no limit.

Example:

Terminal window
hourctl tenant set acme --devices 100

hourctl tenant suspend

Suspend a tenant: nothing of it runs until it is resumed.

hourctl tenant suspend [OPTIONS] <ID>

Arguments:

  • <ID>: The tenant’s id.

Example:

Terminal window
hourctl tenant suspend acme

hourctl tenant resume

Resume a suspended or stopped tenant.

hourctl tenant resume [OPTIONS] <ID>

Arguments:

  • <ID>: The tenant’s id.

Example:

Terminal window
hourctl tenant resume acme

hourctl tenant stop

Stop a tenant (it has left): nothing of it runs, and it is kept until it is deleted or resumed.

hourctl tenant stop [OPTIONS] <ID>

Arguments:

  • <ID>: The tenant’s id.

Example:

Terminal window
hourctl tenant stop acme

hourctl tenant delete

Delete a tenant and everything Connect keeps of it: its devices, events, sync data, jobs, vars and secrets, and its listeners, endpoints, sinks and sync groups. The tokens scoped to it (connect:<tenant>) are revoked. It cannot be undone. Events that install-level sinks have not taken yet are removed with it: it is refused, naming the sinks and how many events, unless you say —force.

hourctl tenant delete [OPTIONS] <ID>

Arguments:

  • <ID>: The tenant’s id.

Options:

  • --yes: Say that you mean it: without it, nothing is deleted.
  • --force: Delete although install-level sinks have not taken all of the tenant’s events: they are lost.

Example:

Terminal window
hourctl tenant delete acme --yes

hourctl apply

Make the gateway’s setup match a setup file.

The file is TOML in the layout hourctl export prints: [[listener]], [[sink]], [[sync_group]] (with its placement rules), [[endpoint]] (with its labels), [[device_labels]] (endpoint, device, labels), retention_days, audit_retention_days, trusted_proxies, tenant_destinations, [limits] and [log] (level). Each one named is created when it is missing and changed where it differs; nothing is removed. The whole file is checked before anything is sent; a number that is not finite (nan, inf) is refused, naming where it is.

A file never holds secrets: password_env (on a listener) and secret_env (on a sink) name the environment variable that holds them, read here and sent as values. They cannot be compared, so they are sent every time.

Prints what it created or updated, one line each (“would:” in front with —dry-run).

hourctl apply [OPTIONS] <FILE>

Arguments:

  • <FILE>: The setup file to apply.

Options:

  • --dry-run: Say what would change, and change nothing.

Example:

Terminal window
hourctl apply gateway.toml --dry-run

hourctl export

Print the gateway’s setup as a file hourctl apply reads.

Prints the listeners, sinks, sync groups, endpoints, the devices’ own labels, the settings and the log level as TOML, or the API’s JSON with —json. Secrets are left out.

hourctl export [OPTIONS] [COMMAND]

Examples:

Terminal window
hourctl export > gateway.toml
hourctl export lb haproxy

Commands:

  • lb: Print the HTTP listeners’ device ports as a load balancer or deploy file snippet.

hourctl export lb

Print the HTTP listeners’ device ports as a load balancer or deploy file snippet.

Exposing a port is deploy configuration and a listener is runtime configuration, so a new listener port needs both: this prints the part for the deploy side. —json does not apply.

hourctl export lb [OPTIONS] <FORMAT>

Arguments:

  • <FORMAT>: Which snippet to print. One of: haproxy (HAProxy: a frontend and backend per port, round robin, health from the admin port), nginx (nginx http block: an upstream and server per port), k8s (A Kubernetes Service of type LoadBalancer), compose (A Docker Compose ports: list).

Example:

Terminal window
hourctl export lb k8s

hourctl diff

Compare the setup of two clusters, read-only.

Compares the package lines and the tenant’s policy package lines (the active revision of each, by its content hash), listeners, endpoints, sinks, sync groups (each endpoint’s own group too: settings, placement, domains), settings, the vars and the secrets’ names, scope by scope; a secret’s value is never read. Fields that belong to each environment (a sink’s URL and secret, trusted_proxies, tenant_destinations, a listener’s addresses and broker login, an endpoint’s allow_from and deny_from, the value of a var both have) are listed apart, as differing by design. Device registrations, people and sync data are never compared.

The exit status is 0 when there are no differences, 1 when there are, and 2 when the comparison could not be made.

hourctl diff [OPTIONS] <FROM> <TO>

Arguments:

  • <FROM>: The cluster compared from (its name), e.g. test.
  • <TO>: The cluster compared with (its name), e.g. production.

Example:

Terminal window
hourctl diff test production

hourctl promote

Copy the setup from one cluster to another: packages, listeners, endpoints, sinks, sync groups, vars and settings.

Works out what the chosen items need on TO, prints that plan, and changes TO only with —yes. A package line is promoted as the exact bundle of its active revision on FROM, pushed to TO and activated there (the same content hash); a policy package line likewise, from the tenant’s packages on FROM to the same tenant’s on TO. A listener, sink, sync group (an endpoint’s own group too) or endpoint is created or updated on TO. An endpoint brings its sync group, and the listener, sinks, package line and policy package line it names that TO lacks; a sync group brings the sinks it names; a package line brings the vars it requires that TO lacks.

The fields that belong to an environment are TO’s: a listener’s addresses and broker login, a sink’s URL and secret, an endpoint’s allow_from and deny_from, trusted_proxies, tenant_destinations. TO keeps its own; an item new on TO takes them from the —values file, and the plan is refused when one it needs is not there. A var TO lacks is copied (or set from the values file); a var TO has with another value is kept, unless named with —var. Secrets, device registrations, people and sync data are never copied: the plan is refused while a promoted package requires a secret TO lacks.

The plan is checked whole, and refused with every reason at once, before anything changes. Every change is made through TO’s admin API, under TO’s token, and is in TO’s audit trail.

hourctl promote [OPTIONS] <--package <LINE>|--policy <LINE>|--shared <LINE>|--adoption <NAME>|--endpoint <ID>|--sink <ID>|--group <NAME>|--listener <ID>|--var <NAME>|--settings|--all> <FROM> <TO>

Arguments:

  • <FROM>: The cluster promoted from (its name), e.g. test.
  • <TO>: The cluster promoted to (its name), e.g. production.

Options:

  • --package <LINE>...: A package line, [email protected], e.g. [email protected]; repeat for several.
  • --policy <LINE>...: A policy package line of the tenant’s, [email protected], e.g. [email protected]; repeat for several.
  • --shared <LINE>...: A shared package’s version published, NAME@VERSION, e.g. [email protected], the same content on both; repeat for several.
  • --adoption <NAME>...: A shared package the tenant adopted (its name), with the version it takes on FROM; repeat for several.
  • --endpoint <ID>...: An endpoint (its id); repeat for several.
  • --sink <ID>...: A sink (its id); repeat for several.
  • --group <NAME>...: A sync group (its id); repeat for several.
  • --listener <ID>...: A listener (its id); repeat for several.
  • --var <NAME>...: A var, NAME for the tenant’s or PACKAGE/NAME for a package’s; repeat for several. A var named here replaces the value TO has.
  • --settings: The settings: retention_days, audit_retention_days and the limits.
  • --all: Every package line, policy package line and shared version active on FROM, every adoption of the tenant’s, and every listener, sink, sync group, endpoint and var FROM has, and the settings. With —var, the vars named replace the values TO has.
  • --values <FILE>: A TOML file of TO’s own values for items new on TO: [sinks.ID] url and secret_env, [listeners.ID] listen or broker, username, password_env, allow_from, deny_from and proxy_protocol, [endpoints.ID] allow_from and deny_from, and [vars] NAME = “value” ([vars.PACKAGE] for a package’s). A *_env field names the environment variable that holds the secret.
  • --yes: Make the changes. Without it the plan is printed and nothing changes.

Examples:

Terminal window
hourctl promote test production --package [email protected] --endpoint office
hourctl -t acme promote test production --policy [email protected]
hourctl -t acme promote test production --adoption overtime
hourctl promote test production --all --values production-values.toml --yes

hourctl cluster

Name the clusters hourctl talks to: add, list, remove, and choose the current one.

A cluster is a name for a gateway’s admin URL and the environment variable that holds its API token; the token itself is never kept. They are kept in hourctl.toml in your config folder: %APPDATA%\houradvantage\hourctl.toml on Windows, else $XDG_CONFIG_HOME/houradvantage/hourctl.toml or ~/.config/houradvantage/hourctl.toml. —cluster NAME on any command talks to that cluster; diff and promote name two.

hourctl cluster [OPTIONS] <COMMAND>

Commands:

  • add: Add a cluster: its name, its admin URL and the variable its token is in.
  • list: List the clusters: name, admin URL, token variable and whether it is set, and which is current.
  • remove: Remove a cluster.
  • use: Make a cluster the current one: commands talk to it when neither —admin, —cluster nor $HOURADVANTAGE_ADMIN_URL says otherwise.

hourctl cluster add

Add a cluster: its name, its admin URL and the variable its token is in.

The token is read from the variable —token-env names, or from the file <VAR>_FILE names, each time hourctl talks to the cluster. Without —token-env, hourctl signs in as it does without a cluster ($HOURADVANTAGE_ADMIN_TOKEN, else the admin login). Refused when the name is taken.

hourctl cluster add [OPTIONS] <NAME> <URL>

Arguments:

  • <NAME>: The cluster’s name: letters, digits, -, _ and ., e.g. production.
  • <URL>: Its admin API’s URL, e.g. https://gw.example.com:9090. Without a scheme, http:// is assumed.

Options:

  • --token-env <VAR>: The environment variable that holds its API token, e.g. HOURADVANTAGE_PROD_TOKEN. Never the token itself.

Example:

Terminal window
hourctl cluster add production https://gw.example.com:9090 --token-env HOURADVANTAGE_PROD_TOKEN

hourctl cluster list

List the clusters: name, admin URL, token variable and whether it is set, and which is current.

hourctl cluster list [OPTIONS]

Example:

Terminal window
hourctl cluster list

hourctl cluster remove

Remove a cluster. Removing the current one leaves none current.

hourctl cluster remove [OPTIONS] <NAME>

Arguments:

  • <NAME>: The cluster’s name.

Example:

Terminal window
hourctl cluster remove staging

hourctl cluster use

Make a cluster the current one: commands talk to it when neither —admin, —cluster nor $HOURADVANTAGE_ADMIN_URL says otherwise.

hourctl cluster use [OPTIONS] <NAME>

Arguments:

  • <NAME>: The cluster’s name.

Example:

Terminal window
hourctl cluster use test

hourctl settings

Show the gateway’s settings, or change them.

Without a subcommand, prints the settings, one name value per line: retention_days, audit_retention_days, trusted_proxies, tenant_destinations and the limits (limits.max_body_bytes, limits.max_pending_devices, limits.traffic_body_bytes).

hourctl settings [OPTIONS] [COMMAND]

Example:

Terminal window
hourctl settings

Commands:

  • set: Change settings, as KEY=VALUE pairs, and print them all.

hourctl settings set

Change settings, as KEY=VALUE pairs, and print them all.

The settings: retention_days (days finished commands, delivered events, failed device messages and deleted sync rows are kept; default 30), audit_retention_days (days audit entries are kept; empty to keep them for ever, the default), trusted_proxies (load balancers in front of the device listeners, addresses or CIDR ranges separated by commas, empty for none), tenant_destinations (internal addresses, CIDR ranges or host names tenants’ webhook sinks and MQTT brokers may reach, separated by commas, empty for none: tenants reach public addresses only), max_body_bytes (largest device message, default 4194304), max_pending_devices (devices waiting to be allowed per endpoint, 0 for no limit, default 100) and traffic_body_bytes (bytes of each body kept in the traffic log, 0 for none, default 16384). The limits may also be named limits.NAME.

retention_days is how long events are kept once every sink has taken them; an event a sink has not taken is kept until it does.

hourctl settings set [OPTIONS] <KEY=VALUE>...

Arguments:

  • <KEY=VALUE>...: The settings to change, as KEY=VALUE.

Examples:

Terminal window
hourctl settings set max_pending_devices=50 retention_days=14
hourctl settings set trusted_proxies=10.0.0.0/8,192.0.2.7
hourctl settings set tenant_destinations=10.20.0.0/16,payroll.internal

hourctl peers

List the gateway’s instances and the config version each has applied.

Prints the environment the gateway names (PRODUCTION when it is one), the current config version, and for each instance its name, the address its admin API is reached on for live views, when it was last seen, the config version it applied (and the error if it refused a newer one), and which instance answered.

hourctl peers [OPTIONS]

Example:

Terminal window
hourctl peers

hourctl audit

Read the audit trail (who changed what), oldest first.

Prints at most 100 entries, from the oldest kept (or after —after): sequence number, when, who, what was done and a summary. With —follow it reads on and prints new entries until Ctrl-C. Entries are kept for ever, or for audit_retention_days when that is set. —by, —action, —since, —until and —request limit it to the changes that hold to all given, and -t TENANT to those made in that tenant’s routes.

hourctl audit [OPTIONS]

Options:

  • --after <SEQ>: Only entries after this sequence number. Pass the last number a page showed to read the next page.
  • -f, --follow: Keep reading: poll for new entries every 2 seconds until Ctrl-C.
  • --by <USER>: Only changes made by this user: the login’s name, token:NAME, or local.
  • --action <PREFIX>: Only changes whose action (method and path, as the list shows it) starts with this: "POST /api/tokens", "DELETE ".
  • --since <TIME>: Only changes made at or after this time: RFC 3339 (2026-10-04T08:00:00Z), or a while ago (90s, 15m, 2h, 7d).
  • --until <TIME>: Only changes made before this time, given as —since takes it. Must be later than —since.
  • --request <ID>: Only the change made by the request with this id (the id a refusal or --request-id names).

Example:

Terminal window
hourctl audit --follow

hourctl token

Create, list and revoke named API tokens for the admin API.

A token stands in for the admin login, e.g. for a script or CI job: hourctl uses the one in $HOURADVANTAGE_ADMIN_TOKEN (or the file $HOURADVANTAGE_ADMIN_TOKEN_FILE names) instead of the login when it is set.

hourctl token [OPTIONS] <COMMAND>

Commands:

  • create: Create a token and print its secret, which cannot be shown again.
  • list: List the tokens, with who made each and when it was last used.
  • revoke: Revoke a token: every instance refuses it from then on.

hourctl token create

Create a token and print its secret, which cannot be shown again.

The secret is printed alone on a line, so a script can capture it. Without —scope the token reaches the whole install, as the login does; with —scope it reaches one tenant’s routes only. Only an install token (or the login) makes tokens.

hourctl token create [OPTIONS] <NAME>

Arguments:

  • <NAME>: A name for the token, e.g. ci.

Options:

  • --scope <ENGINE:TENANT>: What it reaches: connect:TENANT (that Connect tenant’s routes, /api/tenants/TENANT/...) or attend:TENANT (that Time and Attendance tenant’s). Absent: the whole install.

Examples:

Terminal window
hourctl token create ci
hourctl token create acme-portal --scope connect:acme

hourctl token list

List the tokens, with who made each and when it was last used.

hourctl token list [OPTIONS]

Example:

Terminal window
hourctl token list

hourctl token revoke

Revoke a token: every instance refuses it from then on. It stays in the list, marked revoked, and its name stays taken.

hourctl token revoke [OPTIONS] <NAME>

Arguments:

  • <NAME>: The token’s name.

Example:

Terminal window
hourctl token revoke ci