UniClipboard
Configuration & Reference

Environment Variables

Environment variables read by unic, unicd, and the desktop app, plus default data directory locations.

Edit on GitHub

User Environment Variables

VariablePurpose
UNIC_HOMEData directory (database, config, logs, received files, plugins). Used to run a second instance or an isolated profile
UNIC_SOCKControl socket path; defaults to $UNIC_HOME/unic.sock
UNIC_RENDEZVOUS_URLPairing code service URL; rendezvous_url in the config file takes precedence
UNIC_RELAY_URLExplicit hybrid relay origin on unicd (https://, or http:// for local/private-network use; public deployments should use HTTPS); sync.relay.url in config.toml takes precedence over UNIC_RELAY_URL, and both override Cloud-advertised origins (which strictly require https://). Checked by unicd, whereas unic cloud checks saved TOML sync.relay.url; see Hybrid Relay & Self-Hosting
UNIC_RELAY_ACCESS_KEYIndependent fallback credential for a manual scoped Cloud API key (uc_ak_... with relay scope) or self-hosted X-Unic-Relay-Key; sync.relay.access_key in config.toml takes precedence per origin; unicd evaluates its own host env (never Desktop GUI env, and never sends static fallback to non-default Cloud-advertised origins), while unic cloud logout checks the CLI process's own UNIC_RELAY_ACCESS_KEY separately
UNIC_CLOUD_URLUniClipboard Cloud authorization service origin for unic cloud (no config.toml key; overridden by --cloud-url); defaults to https://cloud.uniclipboard.app
UNIC_PLUGIN_REGISTRY_URLRegistry URL for the desktop plugin marketplace; set to an empty string to disable network fetches

For example, to start a second local node on the same machine:

UNIC_HOME=/tmp/unicA unicd
UNIC_HOME=/tmp/unicA unic status

Unix socket paths have a length limit (around 104 bytes on macOS). Keep UNIC_HOME short, or set UNIC_SOCK to a shorter path.

When UNIC_HOME or UNIC_SOCK is set, the desktop app runs in custom-profile mode.

Default Data Directory

When UNIC_HOME is not set, the location is resolved in this order:

  1. If a regular file named portable.dat exists next to the executable, data/ in the same directory is used (portable mode).
  2. Otherwise, unic inside the system configuration directory is used (unic-development for development builds):
OSPath
macOS~/Library/Application Support/unic
Windows%AppData%\unic
Linux$XDG_CONFIG_HOME/unic, defaulting to ~/.config/unic

Run unic config path to see the exact configuration file path in use.

Variables Passed to Plugin Processes

External Go plugin processes receive UNIC_PLUGIN_DIR on startup, pointing to the plugin's own directory. See Go Plugin Development.

Other UNIC_ variables in the repository (such as UNIC_E2E* and UNIC_DESKTOP_E2E*) are for testing and builds only, not for end users.

Do not pass a v1 passphrase via environment variables; use --passphrase-stdin when migrating. See v1 Migration.

On this page