Setting-up environment variables to use the CLI

If you want to use the CLI, every command requires you to specify the --network flag. Another clever and usefull way is to set-up the UNS_NETWORK environment variable and by the mean to enter your CLI command without specifying the --network flag every time.

UNS_NETWORK environment variable can get the following values:

  • devnet, to interact with the DEVNET network, the integration test
  • local, to interact with the node running locally, on your workstation.
  • mainnet, to interact with the MAIN NETWORK, as soon as this network is live

Well, depending on your desktop or laptop operating system, setting-up this environment variable have different syntax.

Here there are:

On Linux and macOS

On Linux (and macOS) you need to use the export keyword to make the variable available during all your session.

$ export UNS_NETWORK=devnet

then you can directly enter any command like $ uns status without the flag and the command will run on the DEVNET !

On Windows, with the new PowerShell Core 6 console

With the new PowerShell Core, you need to do it with this command:

> $Env:UNS_NETWORK="devnet"

On Windows, with the former cmd.exe console

With the former windows console, only set it like this:

>set UNS_NETWORK=devnet

This is also valid for the proxy environment variables: HTTP_PROXY and HTTPS_PROXY (more info on

1 Like

Clear explanations, thanks