UCM Environment Variables

The following are optional environment variables. You can set them in your shell profile (e.g. .bashrc, .zshrc, etc.) to have them persistently available, or provide them as arguments when you enter the ucm command.

Merge/diff tool config

UCM_MERGETOOL

Allows selecting which merge tool to use when resolving merge conflicts.

See the UCM merge tool documentation for more details.

UCM_DIFFTOOL

Allows selecting which diff tool to use when viewing diffs.

If the UCM_DIFFTOOL environment variable is set, it will be executed with variables $LOCAL and $REMOTE as described in the Git-scm docs.

Console output config

UNISON_PAGER

Allows selecting which pager to use for long command outputs. Defaults to less on Linux & Mac, more on Windows

E.g.

UNISON_FZF_PATH

Allows configuring which binary to use when triggering fuzzy searches using fzf. If unset, we default to searching for a binary named fzf in your $PATH.

E.g.

If you wish to disable fzf entirely, you can set UNISON_FZF_PATH to "NONE".

Unison Share config

UNISON_SHARE_HOST

Allows selecting the location for the default Share server.

E.g.

UNISON_SHARE_ACCESS_TOKEN

Allows overriding the credentials used when authenticating with the Share server.

E.g.

UNISON_SYNC_VERSION

Allows regressing to sync version 1 when interacting with Share.

UNISON_SYNC_HISTORY_COMMENTS

Toggles on/off syncing of history comments with Share.

Defaults to disabled.

UNISON_LSP_PORT

Allows selecting the port to run the LSP server on. Defaults to 5757.

E.g.

Language server config

UNISON_LSP_ENABLED

Allows explicitly enabling or disabling the LSP server. Acceptable values are 'true' or 'false'

Note for Windows users: Due to an outstanding issue with GHC's IO manager on Windows, the LSP is disabled by default on Windows machines. Enabling the LSP on windows can cause UCM to hang on exit and may require the process to be killed by the operating system or via Ctrl-C. Note that this doesn't pose any risk of codebase corruption or cause any known issues, it's simply an annoyance.

If you accept this annoyance, you can enable the LSP server on Windows by exporting the UNISON_LSP_ENABLED=true environment variable.

You can set this persistently in powershell using:

See this issue for more details.

E.g.

$ UNISON_LSP_ENABLED=true ucm

General codebase config

UNISON_READONLY

Force unison to use readonly connections to codebases.

UNISON_DEBUG

Enable debugging output for various portions of the application. See lib/unison-prelude/src/Unison/Debug.hs for the full list of supported flags.

E.g.

UNISON_ENTITY_VALIDATION

Allows disabling validation of entities pulled from a codebase server. It's generally a good idea to leave this enabled unless you know exactly what you're doing.

Defaults to enabled.

UNISON_MIGRATION

Setting:

will cause ucm to automatically migrate the codebase to the latest version, without prompting for confirmation.

UNISON_PULL_WORKERS

Allows setting the number of workers to use when pulling from a codebase server. Defaults to 5.

UNISON_PUSH_WORKERS

Allows setting the number of workers to use when pushing to a codebase server. Defaults to 1.

UNISON_SYNC_CHUNK_SIZE

Allows setting the chunk size used in requests when syncing a codebase. Defaults to 50.

Local Codebase Server

The port, host and token to be used for the local codebase server can all be configured by providing environment variables when starting ucm, using UCM_PORT, UCM_HOST, and UCM_TOKEN.

E.g.