Using environment variables
You can specify the following environment variables:RESTATE_HOST
: The hostname/IP address of the server. Default islocalhost
.RESTATE_HOST_SCHEME
: Default ishttp
.RESTATE_ADMIN_URL
: To specify the full URL of the admin server (scheme+host+port).RESTATE_AUTH_TOKEN
: Set if authentication is required.
myhost
and the host scheme https
, pass environment variables as follows:
You can find the full list of configuration variables in the CLI GitHub repo.
.env
file. The CLI will look for a .env
file in its current directory.
For example, to connect to a Restate admin server running at http://myhost:9070
, save the following in a .env
file:
.env
Using the config file
By default, the CLI will treat$HOME/.config/restate
as its config directory.
This is configurable with $RESTATE_CLI_CONFIG_HOME
. Restate will look for file
named config.toml
inside this directory. You can edit this file with
restate config edit
, or view its contents with restate config view
.
The config file has a native concept of ‘enviroments’ which are sets of
configuration intended to specify different instances of Restate. You can
list your configured environments:
local
environment which is configured to point
at a Restate instance running on your local machine. Additional environments
can be specified as new blocks in config.toml
:
config.toml
- With an argument:
restate -e myhost whoami
- With an environment variable:
RESTATE_ENVIRONMENT=myhost restate whoami
- With the command
restate config use-environment myhost
. This will write the name of the environment to the CLI config directory, so that it’s used by default for all CLI commands. You can switch back tolocal
withrestate config use-environment local
.