Skip to main content
Install cordon as an OS-managed background service that starts automatically and restarts on failure.

cordon service install

This command does not create or edit cordon.toml — it only installs OS service metadata so the service runs cordon start with the config path you pass. The file must already exist, usually from cordon setup.
Services are optional. Most development workflows don’t need a background service — just run cordon start alongside your app (e.g., in a Procfile). Use cordon service install when you want the proxy to start automatically on login and restart on failure for a specific project. Each service is tied to one project’s cordon.toml.
Installs a launchd user agent at ~/Library/LaunchAgents/.

cordon service uninstall

cordon service start

Start an installed cordon service.
With no arguments, the target is auto-detected: the current directory’s project service if installed, otherwise the sole installed service. If multiple services are installed and none matches the current directory, the command errors and lists them. The service must already be installed via cordon service install. If the service is already running, prints a warning and exits successfully.

cordon service stop

Stop a running cordon service.
With no arguments, the target is auto-detected: the current directory’s project service if installed, otherwise the sole installed service. If multiple services are installed and none matches the current directory, the command errors and lists them.

cordon service log

View logs for a cordon service.
With no arguments, the target is auto-detected: the current directory’s project service if installed, otherwise the sole installed service. If multiple services are installed and none matches the current directory, the command errors and lists them.
Tails cordon.stderr.log under ~/Library/Logs/cordon-<service-name>/cordon-<dirname>-<hash8> for project scope, cordon-user for user scope. Cordon writes startup errors and diagnostics to stderr. The launchd service may also create a sibling cordon.stdout.log, but cordon service log does not read it.

cordon service cleanup

List installed services whose embedded --config path no longer exists on disk (orphaned services) and remove them. Services accumulate when project directories are deleted or moved — cleanup prunes stale service definitions.
--dry-run and --all are mutually exclusive.

Interactive mode

With no flags, each orphan is listed and you’re prompted per service:
  • y — remove this service
  • n (or blank) — keep it
  • a — remove this and all remaining orphans
  • q — quit and leave remaining orphans untouched

Running orphans

If an orphaned service is still running (it was started before its config was deleted), cleanup skips it and prints a hint:
Stop the service manually, then re-run cleanup.

Exit status

Cleanup exits non-zero if any removal failed.

Multiple instances

Run separate cordon instances with different configurations:
Each instance gets its own service with an independent lifecycle.