Skip to main content

CLI

You can use the CLI to interact with Restate, and manage your services, deployments and invocations.

Installation

Option 1: Using a package manager

Install the Restate CLI via:

npm
Homebrew

npm install --global @restatedev/restate

Option 2: Download the binary

Use curl to download the binaries from the releases page, and make them executable:

MacOS-x64
MacOS-arm64
Linux-x64
Linux-arm64

curl -LO https://github.com/restatedev/restate/releases/latest/download/restate.x86_64-apple-darwin.tar.gz && \
tar -xvf restate.x86_64-apple-darwin.tar.gz && \
chmod +x restate && \
sudo mv restate /usr/local/bin/

Check if the CLI is configured correctly:


restate whoami

Print help to see all available commands:


restate --help

tip

The CLI can be a useful tool for debugging and troubleshooting. Have a look at the introspection page for a list of useful commands .

Configuration

There are two ways to configure the CLI: via environment variables or via a configuration file.

Using environment variables

You can specify the following environment variables:

  • RESTATE_HOST: The hostname/IP address of the server. Default is localhost.
  • RESTATE_HOST_SCHEME: Default is http.
  • RESTATE_ADMIN_URL: To specify the full URL of the admin server (scheme+host+port).
  • RESTATE_AUTH_TOKEN: Set if authentication is required.

For example, to specify the hostname myhost and the host scheme https, pass environment variables as follows:


RESTATE_HOST=myhost RESTATE_HOST_SCHEME=https restate <command>

All CLI configuration variables

You can find the full list of configuration variables in the CLI GitHub repo.

Using a configuration file

You can also specify the configuration in a .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

RESTATE_ADMIN_URL=http://myhost:9070