Skip to main content
Version: 3.x (unreleased)

Environment Variables

Mops CLI supports several environment variables to customize its behavior.

Network Selection

MOPS_NETWORK

Select the network (local, staging, or ic). This is the only way to change it — mops defaults to ic and never persists a network selection to disk, so every process that should talk to a different registry needs the variable set.

When set to local, the agent fetches the root key from the replica (required for local replicas) and defaults to http://127.0.0.1:4943.

note

Since mops 3.0.0 the agent makes update calls over the IC HTTP API v3 synchronous-call endpoint. A local replica has to serve it — icp and recent dfx do; a pre-v3 replica does not.

export MOPS_NETWORK="local"
mops install

Registry Configuration

MOPS_REGISTRY_HOST

Override the registry replica or boundary node URL. Useful for pointing to a local IC replica or custom deployment during development.

export MOPS_REGISTRY_HOST="http://127.0.0.1:4943"
mops install

MOPS_REGISTRY_CANISTER_ID

Override the registry canister principal. Use this to target a specific registry canister instance.

export MOPS_REGISTRY_CANISTER_ID="your-custom-canister-id"
mops install

Combined Usage

Both variables can be set together to redirect all registry operations to a custom deployment:

export MOPS_REGISTRY_HOST="http://mops-alternative.host:4943"
export MOPS_REGISTRY_CANISTER_ID="2d2zu-vaaaa-aaaak-qb6pq-cai"
mops install

These overrides apply to all registry operations (add, install, publish, search, etc.) and work with any network selection (staging, ic, or local).