-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
141 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,138 @@ | ||
--- | ||
sidebar_position: 4 | ||
description: "Use the CLI to interact with Restate." | ||
--- | ||
|
||
import Tabs from '@theme/Tabs'; | ||
import TabItem from '@theme/TabItem'; | ||
|
||
# CLI | ||
|
||
You can use the CLI to interact with Restate, and manage your services, deployments and invocations. | ||
|
||
## Installation | ||
|
||
Install the Restate CLI via: | ||
|
||
<Tabs groupId="operating-systems"> | ||
<TabItem value="lin" label="npm"> | ||
|
||
```shell | ||
npm install @restatedev/restate | ||
``` | ||
|
||
</TabItem> | ||
<TabItem value="mac" label="Homebrew"> | ||
|
||
```shell | ||
brew install restatedev/tap/restate | ||
``` | ||
|
||
</TabItem> | ||
</Tabs> | ||
|
||
|
||
## 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_META_URL`: To specify the full URL of meta service (scheme+host+port). | ||
- `RESTATE_DATAFUSION_HTTP_URL`: To specify the full URL of datafusion HTTP endpoint. | ||
- `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: | ||
|
||
```shell | ||
RESTATE_HOST=myhost RESTATE_HOST_SCHEME=https restate <command> | ||
``` | ||
|
||
### 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 meta running at `http://myhost:7777`, save the following in a `.env` file: | ||
|
||
``` | ||
RESTATE_META_URL=http://myhost:7777 | ||
``` | ||
|
||
## Usage | ||
|
||
Here are a few useful commands: | ||
|
||
**Check if the CLI is configured correctly** | ||
|
||
```shell | ||
restate whoami | ||
``` | ||
|
||
|
||
**Printing help** | ||
|
||
```shell | ||
restate --help | ||
``` | ||
|
||
**Downloading an example or template** | ||
|
||
```shell | ||
restate example | ||
``` | ||
|
||
Follow the prompts to select which template you want to download. | ||
|
||
**Listing your services** | ||
|
||
```shell | ||
restate svc list | ||
``` | ||
|
||
**Show the status of the service(s)** | ||
|
||
```shell | ||
restate svc status | ||
``` | ||
|
||
Shows a summary of the services and their methods. | ||
It shows counters for the invocations in the various states (pending, running, suspended, etc.) | ||
It also lists a sample of active service keys. | ||
|
||
To print the status of a specific service: | ||
|
||
```shell | ||
restate svc status <SERVICE_NAME> | ||
``` | ||
|
||
**Listing ongoing invocations** | ||
|
||
```shell | ||
restate inv list | ||
``` | ||
|
||
**Describing the status of an invocation** | ||
|
||
```shell | ||
restate inv describe <INVOCATION_ID> | ||
``` | ||
|
||
Use this command to understand the progress of the invocation: the status, any errors and retries that occurred, the current journal, etc. | ||
|
||
**Cancel an ongoing invocation** | ||
|
||
```shell | ||
restate inv cancel <INVOCATION_ID> | ||
``` | ||
|
||
Use this command to cancel an invocation and its children. | ||
Use the `--kill` flag to ungracefully kill the invocation and its children. | ||
|
||
:::tip | ||
The CLI can be a useful tool for debugging and troubleshooting. | ||
Have a look at the [introspection page](/services/introspection) for a list of useful commands . | ||
::: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 4 | ||
sidebar_position: 5 | ||
description: "Find out how to configure logging for Restate." | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
--- | ||
sidebar_position: 6 | ||
sidebar_position: 7 | ||
description: "Try out Restate without any servers." | ||
--- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters