Skip to content

CLI reference

The harmonic command manages the server. After a global install (npm install -g @mintopia/harmonic) it’s on your PATH; without one, prefix any command with npx @mintopia/harmonic. Running harmonic with no command, or with help / --help, prints usage.

Terminal window
harmonic <command> [options]
npx @mintopia/harmonic <command> [options]
CommandWhat it does
serveRun the server in the foreground (Ctrl-C to stop). Best for a quick one-off.
startRun the server in the background; logs to <data-dir>/harmonic.log. Returns immediately.
installInstall Harmonic as an OS service. Run harmonic install --help for the available options and platform-specific details.
statusReport whether a background server is running, and where. Exits non-zero if it isn’t, usable in scripts.
stopStop the background server started with start.
helpShow usage. Also --help, or running with no command.

Run Harmonic standalone when you want to manage its lifetime yourself: use harmonic serve to keep it in the foreground, or harmonic start to run its background daemon. Use harmonic install when you want your OS to manage Harmonic as a service instead. For service setup and options, run harmonic install --help.

Only one standalone background server runs per data directory. start launches it, status inspects it, and stop shuts it down. All three read the same --data-dir to find each other, so pass a matching --data-dir to every command when you run off the default.

OptionCommandsDefaultDescription
--port <n>serve, start4700Port to listen on.
--host <h>serve, start0.0.0.0Bind address. 0.0.0.0 is reachable from your network; use 127.0.0.1 for local-only.
--data-dir <dir>all~/.harmonicWhere Harmonic keeps its data and background log.
--password <pw>serve, startSet or update the operator password. Pass an empty value (--password '') to remove it and run ungated.

--data-dir applies to every command, including status and stop, which use it to locate the running server. status and stop accept only --data-dir; passing --port, --host, or --password to them is an error and exits non-zero. Those three flags belong to the commands that start a server (serve, start).

Run in the foreground on a custom port, local-only:

Terminal window
harmonic serve --host 127.0.0.1 --port 8080

Start a password-protected background server with its own data directory:

Terminal window
harmonic start --password 'correct horse' --data-dir ~/harmonic-work
harmonic status --data-dir ~/harmonic-work
harmonic stop --data-dir ~/harmonic-work

Remove a previously set password (run ungated again):

Terminal window
harmonic start --password ''

A global install keeps itself current. Harmonic checks npm once an hour (and once at startup); when a newer release is out, a banner appears in the app. The next time your fleet is idle it installs the new version, swaps to it, and relaunches, so nothing is interrupted mid-flight. Dismiss the banner to hide a version you’re not ready for; the next release brings it back.

Running through npx fetches the latest published version every time, so there’s nothing to update. From a source checkout Harmonic doesn’t self-update; pull and rebuild instead.

  • Configuration reference: the environment variables (HARMONIC_DATA_DIR, HARMONIC_PASSWORD) that back these options, and what lives in the data directory.
  • Security: the password, host binding, and what “ungated” means before you expose Harmonic.
  • Quickstart: install and run from scratch.