-
Notifications
You must be signed in to change notification settings - Fork 7
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Restate CLI docs #249
Add Restate CLI docs #249
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
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: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Suggested: |
||
|
||
**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 | ||
``` | ||
Comment on lines
+90
to
+94
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. A very useful/powerful command is also It shows running the summary of the service and counters for invocations in various states. Is also shows the a sample of service keys that has active ongoing invocations. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Cool, that is indeed a useful one! I added it. |
||
|
||
**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 . | ||
::: |
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." | ||
--- | ||
|
||
|
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." | ||
--- | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm very hesitant about exposing this as a "data fusion" thing. I would like to combine this with the META URL under one name "admin" URL. Let me work on this first.