Data Hub

Watcher CLI

Every data-hub-watcher command, subcommand, and flag in one place: init, watch, upload, config, service, and self-update.

ForLab operators

The complete data-hub-watcher command surface. For task-oriented walkthroughs see Installing a watcher, Run as a Windows service, and Upgrading the watcher.

Global flags

These apply to every command:

FlagDescription
--config PATHOverride the config file path. Equivalent to the DATA_HUB_CONFIG_PATH env var.
--verboseEnable debug-level logging on stderr.
--versionPrint the installed watcher version and exit.
--helpShow help for the command or subcommand.

init

Interactive setup wizard. Prompts for environment, API key, instrument, watch directory, file patterns, run detection, stability period, and upload mode; then registers the watcher and writes ~/.data-hub/config.yaml and ~/.data-hub/.env.<environment>.

FlagDescription
--show-keyEcho the API key as you type/paste it (useful when a terminal mangles hidden input).

The key is validated (must start with dhub_) and normalized to strip zero-width and non-breaking-space characters that Windows clipboards inject. See Installing a watcher → Setup.

watch

Start the file-monitoring loop: detect stable files, group them into runs, report runs, upload (auto mode) or poll the queue (manual mode), and send heartbeats every 60 seconds. Press Ctrl+C to stop.

FlagDescription
--dry-runValidate config, check API reachability and instrument status, and preview which files would be picked up, without starting the monitor.

upload

One-shot upload outside the watch loop.

data-hub-watcher upload --file /path/to/file.csv --run-id RUN001  # upload a specific file
data-hub-watcher upload                                            # process the server-side queue (manual mode)
data-hub-watcher upload --dry-run                                  # preview without uploading
FlagDescription
--file PATHThe file to upload.
--run-id IDThe run to attach the file to.
--dry-runPreview without uploading.

config

Manage the YAML config. Changes that affect the server are synced automatically.

SubcommandDescription
config showPretty-print the current config.
config validateValidate the config file offline.
config set-environment ENVSwitch the active environment (staging, production, preview).
config editRe-prompt each field with current values as defaults.
config openOpen the config in your editor, then re-validate.
config pathPrint the resolved config file path.

config set-environment (and config edit when the environment changes) accept:

FlagDescription
--api-base-url URLRequired when switching to preview.
--api-key KEYOtherwise read from the env file or prompted.
--show-keyEcho the key as entered.
--no-registerFail instead of registering a new watcher if none is stored for the target environment.

See the Configuration reference → Switching environments.

service (Windows only)

Requires the windows-service extra. Manage the watcher as a Windows service.

SubcommandDescription
service installRegister the service.
service uninstallRemove the service.
service startStart the service.
service stopStop the service.
service statusShow service status.
service reinstallStop, uninstall, install, and start in one go.

service install and service reinstall accept --env-path PATH to override which .env file the service loads. Full details in Run as a Windows service.

self-update

Check the API for a newer published version and upgrade in place.

data-hub-watcher self-update            # check + upgrade if needed
data-hub-watcher self-update --check    # report status only, no upgrade
data-hub-watcher self-update --force    # re-run the upgrade even if versions match
FlagDescription
--checkReport status only; don't upgrade.
--forceRe-run the upgrade subprocess even if the installed version already matches.

The upgrade flow depends on your install method; see Upgrading the watcher.

On this page