Update CLI reference

This commit is contained in:
Mukundan Sundararajan 2020-12-08 15:30:40 -08:00
parent 2c0933084c
commit e1aad26640
19 changed files with 244 additions and 100 deletions

View File

@ -9,14 +9,13 @@ weight: 10
The Dapr CLI allows you to setup Dapr on your local dev machine or on a Kubernetes cluster, provides debugging support, and launches and manages Dapr instances. The Dapr CLI allows you to setup Dapr on your local dev machine or on a Kubernetes cluster, provides debugging support, and launches and manages Dapr instances.
```bash ```bash
__
____/ /___ _____ _____ ____/ /___ _____ _____
/ __ / __ '/ __ \/ ___/ / __ / __ '/ __ \/ ___/
/ /_/ / /_/ / /_/ / / / /_/ / /_/ / /_/ / /
\__,_/\__,_/ .___/_/ \__,_/\__,_/ .___/_/
/_/ /_/
=============================== ===============================
Distributed Application Runtime Distributed Application Runtime
@ -25,20 +24,20 @@ Usage:
Available Commands: Available Commands:
completion Generates shell completion scripts completion Generates shell completion scripts
components List all Dapr components components List all Dapr components. Supported platforms: Kubernetes
configurations List all Dapr configurations configurations List all Dapr configurations. Supported platforms: Kubernetes
dashboard Start Dapr dashboard dashboard Start Dapr dashboard. Supported platforms: Kubernetes and self-hosted
help Help about any command help Help about any command
init Install Dapr on supported hosting platforms, currently: Kubernetes and self-hosted init Install Dapr on supported hosting platforms. Supported platforms: Kubernetes and self-hosted
invoke Invoke a method on a given Dapr application invoke Invoke a method on a given Dapr application. Supported platforms: Self-hosted
list List all Dapr instances list List all Dapr instances. Supported platforms: Kubernetes and self-hosted
logs Get Dapr sidecar logs for an application logs Get Dapr sidecar logs for an application. Supported platforms: Kubernetes
mtls Check if mTLS is enabled mtls Check if mTLS is enabled. Supported platforms: Kubernetes
publish Publish a pub-sub event publish Publish a pub-sub event. Supported platforms: Self-hosted
run Run Dapr and (optionally) your application side by side run Run Dapr and (optionally) your application side by side. Supported platforms: Self-hosted
status Show the health status of Dapr services status Show the health status of Dapr services. Supported platforms: Kubernetes
stop Stop Dapr instances and their associated apps in self-hosted mode stop Stop Dapr instances and their associated apps. . Supported platforms: Self-hosted
uninstall Uninstall Dapr runtime uninstall Uninstall Dapr runtime. Supported platforms: Kubernetes and self-hosted
Flags: Flags:
-h, --help help for dapr -h, --help help for dapr

View File

@ -12,8 +12,8 @@ Generates shell completion scripts
## Usage ## Usage
```bash ```bash
dapr completion [flags] dapr completion [flags]
dapr completion [command] dapr completion [command]
``` ```
## Examples ## Examples

View File

@ -7,7 +7,7 @@ description: "Detailed information on the components CLI command"
## Description ## Description
List all Dapr components List all Dapr components. Supported platforms: Kubernetes
## Usage ## Usage
@ -15,6 +15,13 @@ List all Dapr components
dapr components [flags] dapr components [flags]
``` ```
## Examples
### List Kubernetes components
```bash
dapr components -k
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description

View File

@ -7,7 +7,7 @@ description: "Detailed information on the configurations CLI command"
## Description ## Description
List all Dapr configurations List all Dapr configurations. Supported platforms: Kubernetes
## Usage ## Usage
@ -15,6 +15,13 @@ List all Dapr configurations
dapr configurations [flags] dapr configurations [flags]
``` ```
## Examples
### List Kubernetes components
```bash
dapr components -k
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description

View File

@ -7,14 +7,35 @@ description: "Detailed information on the dashboard CLI command"
## Description ## Description
Start Dapr dashboard Start Dapr dashboard. Supported platforms: Kubernetes and self-hosted
## Usage ## Usage
```bash ```bash
dapr dashboard [flags] dapr dashboard [flags]
``` ```
## Examples
### Start dashboard locally
```bash
dapr dashboard
```
### Start dashboard locally in a specified port
```bash
dapr dashboard -p 9999
```
### Port forward to dashboard in Kubernetes
```bash
dapr dashboard -k
```
### Port forward to dashboard in Kubernetes using a port
```bash
dapr dashboard -k -p 9999
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description

View File

@ -7,14 +7,30 @@ description: "Detailed information on the init CLI command"
## Description ## Description
Install Dapr on supported hosting platforms, currently: Kubernetes and self-hosted Install Dapr on supported hosting platforms. Supported platforms: Kubernetes and self-hosted
## Usage ## Usage
```bash ```bash
dapr init [flags] dapr init [flags]
``` ```
## Examples
### Initialize Dapr in self-hosted mode
```bash
dapr init
```
### Initialize Dapr in Kubernetes
```bash
dapr init -k
```
### Initialize Dapr in slim self-hosted mode
```bash
dapr init -s
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description

View File

@ -7,14 +7,25 @@ description: "Detailed information on the invoke CLI command"
## Description ## Description
Invoke a method on a given Dapr application Invoke a method on a given Dapr application. Supported platforms: Self-hosted
## Usage ## Usage
```bash ```bash
dapr invoke [flags] dapr invoke [flags]
``` ```
## Examples
### Invoke a sample method on target app with POST Verb
```bash
dapr invoke --app-id target --method sample --data '{"key":"value"}'
```
### Invoke a sample method on target app with GET Verb
```bash
dapr invoke --app-id target --method sample --verb GET
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description
@ -22,5 +33,5 @@ dapr invoke [flags]
| `--app-id`, `-a` | | | The application id to invoke | | `--app-id`, `-a` | | | The application id to invoke |
| `--help`, `-h` | | | Print this help message | | `--help`, `-h` | | | Print this help message |
| `--method`, `-m` | | | The method to invoke | | `--method`, `-m` | | | The method to invoke |
| `--payload`, `-p` | | | The JSON payload (optional) | | `--data`, `-d` | | | The JSON serialized data string (optional) |
| `--verb`, `-v` | | `POST` | The HTTP verb to use | | `--verb`, `-v` | | `POST` | The HTTP verb to use |

View File

@ -1,24 +0,0 @@
---
type: docs
title: "invokeGet CLI command reference"
linkTitle: "invokeGet"
description: "Detailed information on the invokeGet CLI command"
---
## Description
Issue HTTP GET to Dapr app
## Usage
```bash
dapr invokeGet [flags]
```
## Flags
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--app-id`, `-a` | | | The app ID to invoke |
| `--help`, `-h` | | | Help for invokeGet |
| `--method`, `-m` | | | The method to invoke |

View File

@ -1,25 +0,0 @@
---
type: docs
title: "invokePost CLI command reference"
linkTitle: "invokePost"
description: "Detailed information on the invokePost CLI command"
---
## Description
Issue HTTP POST to Dapr app with an optional payload
## Usage
```bash
dapr invokePost [flags]
```
## Flags
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--app-id`, `-a` | | | The app ID to invoke |
| `--help`, `-h` | | | Help for invokePost |
| `--method`, `-m` | | | The method to invoke |
| `--payload`, `-p` | | | (optional) a json payload |

View File

@ -7,14 +7,25 @@ description: "Detailed information on the list CLI command"
## Description ## Description
List all Dapr instances List all Dapr instances. Supported platforms: Kubernetes and self-hosted
## Usage ## Usage
```bash ```bash
dapr list [flags] dapr list [flags]
``` ```
## Examples
### List Dapr instances in self-hosted mode
```bash
dapr list
```
### List Dapr instances in Kubernetes mode
```bash
dapr list -k
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description

View File

@ -7,14 +7,20 @@ description: "Detailed information on the logs CLI command"
## Description ## Description
Gets Dapr sidecar logs for an app in Kubernetes Get Dapr sidecar logs for an application. Supported platforms: Kubernetes
## Usage ## Usage
```bash ```bash
dapr logs [flags] dapr logs [flags]
``` ```
## Examples
### Get logs of sample app from target pod in custom namespace
```bash
dapr logs -k --app-id sample --pod-name target --namespace custom
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description

View File

@ -0,0 +1,29 @@
---
type: docs
title: "mtls export CLI command reference"
linkTitle: "mtls export"
description: "Detailed information on the mtls export CLI command"
---
## Description
Export the root CA, issuer cert and key from Kubernetes to local files
## Usage
```bash
dapr mtls export [flags]
```
## Examples
### Check expiry of Kubernetes certs
```bash
dapr mtls export -o ./certs
```
## Flags
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | help for export |
| `--out`, `-o` | | current directory | The output directory path to save the certs |

View File

@ -0,0 +1,28 @@
---
type: docs
title: "mtls expiry CLI command reference"
linkTitle: "mtls expiry"
description: "Detailed information on the mtls expiry CLI command"
---
## Description
Checks the expiry of the root certificate
## Usage
```bash
dapr mtls expiry [flags]
```
## Examples
### Check expiry of Kubernetes certs
```bash
dapr mtls expiry
```
## Flags
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | help for expiry |

View File

@ -7,7 +7,7 @@ description: "Detailed information on the mtls CLI command"
## Description ## Description
Check if mTLS is enabled Check if mTLS is enabled. Supported platforms: Kubernetes
## Usage ## Usage
@ -16,6 +16,13 @@ dapr mtls [flags]
dapr mtls [command] dapr mtls [command]
``` ```
## Examples
### Check if mTLS is enabled
```bash
dapr mtls -k
```
## Available Commands ## Available Commands
```txt ```txt
@ -29,3 +36,10 @@ export Export the root CA, issuer cert and key from Kubernetes to local fil
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `--help`, `-h` | | | Print this help message | | `--help`, `-h` | | | Print this help message |
| `--kubernetes`, `-k` | | `false` | Check if mTLS is enabled in a Kubernetes cluster | | `--kubernetes`, `-k` | | `false` | Check if mTLS is enabled in a Kubernetes cluster |
## Command Reference
You can learn more about each sub command from the links below.
- [`dapr mtls expiry`]({{< ref dapr-mtls-expiry.md >}})
- [`dapr mtls export`]({{< ref dapr-mtls-export.md >}})

View File

@ -7,7 +7,7 @@ description: "Detailed information on the publish CLI command"
## Description ## Description
Publish an event to multiple consumers Publish a pub-sub event. Supported platforms: Self-hosted
## Usage ## Usage
@ -15,11 +15,19 @@ Publish an event to multiple consumers
dapr publish [flags] dapr publish [flags]
``` ```
## Examples
### Publish to sample topic in target pubsub
```bash
dapr publish --topic sample --pubsub target --data '{"key":"value"}'
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `--data`, `-d` | | | The JSON serialized string (optional) | | `--data`, `-d` | | | The JSON serialized data string (optional) |
| `--help`, `-h` | | | Print this help message | | `--help`, `-h` | | | Print this help message |
| `--pubsub` | | | The name of the pub/sub component | `--pubsub`, `-p` | | | The name of the pub/sub component
| `--topic`, `-t` | | | The topic to be published to | | `--topic`, `-t` | | | The topic to be published to |

View File

@ -7,7 +7,7 @@ description: "Detailed information on the run CLI command"
## Description ## Description
Run Dapr's sidecar and (optionally) an application. Run Dapr and (optionally) your application side by side. Supported platforms: Self-hosted
## Usage ## Usage
@ -17,19 +17,26 @@ dapr run [flags] [command]
## Examples ## Examples
Run a Java application: ### Run a Java application
```bash ```bash
dapr run --app-id myapp -- java -jar myapp.jar dapr run --app-id myapp -- java -jar myapp.jar
``` ```
Run a NodeJs application that listens to port 3000:
### Run a NodeJs application that listens to port 3000
```bash ```bash
dapr run --app-id myapp --app-port 3000 -- node myapp.js dapr run --app-id myapp --app-port 3000 -- node myapp.js
``` ```
Run a Python application:
### Run a Python application
```bash ```bash
dapr run --app-id myapp -- python myapp.py dapr run --app-id myapp -- python myapp.py
``` ```
Run sidecar only:
### Run sidecar only
```bash ```bash
dapr run --app-id myapp dapr run --app-id myapp
``` ```
@ -38,7 +45,7 @@ dapr run --app-id myapp
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `--app-id`, `-i` | | | The id for your application, used for service discovery | | `--app-id`, `-a` | | | The id for your application, used for service discovery |
| `--app-max-concurrency` | | `unlimited` | The concurrency level of the application, otherwise is unlimited | | `--app-max-concurrency` | | `unlimited` | The concurrency level of the application, otherwise is unlimited |
| `--app-port`, `-p` | | | The port your application is listening on | `--app-port`, `-p` | | | The port your application is listening on
| `--app-protocol`, `-P` | | `http` | The protocol (gRPC or HTTP) Dapr uses to talk to the application. Valid values are: `http` or `grpc` | | `--app-protocol`, `-P` | | `http` | The protocol (gRPC or HTTP) Dapr uses to talk to the application. Valid values are: `http` or `grpc` |
@ -49,7 +56,6 @@ dapr run --app-id myapp
| `--dapr-http-port` | | `50001` | The HTTP port for Dapr to listen on | | `--dapr-http-port` | | `50001` | The HTTP port for Dapr to listen on |
| `--enable-profiling` | | `false` | Enable `pprof` profiling via an HTTP endpoint | `--enable-profiling` | | `false` | Enable `pprof` profiling via an HTTP endpoint
| `--help`, `-h` | | | Print this help message | | `--help`, `-h` | | | Print this help message |
| `--image` | | | The image to build the code in. Input is: `repository/image` |
| `--log-level` | | `info` | The log verbosity. Valid values are: `debug`, `info`, `warning`, `error`, `fatal`, or `panic` | | `--log-level` | | `info` | The log verbosity. Valid values are: `debug`, `info`, `warning`, `error`, `fatal`, or `panic` |
| `--placement-host-address` | `DAPR_PLACEMENT_HOST` | `localhost` | The host on which the placement service resides | | `--placement-host-address` | `DAPR_PLACEMENT_HOST` | `localhost` | The host on which the placement service resides |
| `--profile-port` | | `7777` | The port for the profile server to listen on | | `--profile-port` | | `7777` | The port for the profile server to listen on |

View File

@ -7,16 +7,22 @@ description: "Detailed information on the status CLI command"
## Description ## Description
Show the health status of Dapr services Show the health status of Dapr services. Supported platforms: Kubernetes
## Usage ## Usage
This command only works for Kubernetes mode.
```bash ```bash
dapr status -k dapr status -k
``` ```
## Examples
### Get status of Dapr services from Kubernetes
```bash
dapr status -k
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description

View File

@ -7,7 +7,7 @@ description: "Detailed information on the stop CLI command"
## Description ## Description
Stop Dapr instances and their associated apps in self-hosted mode Stop Dapr instances and their associated apps. . Supported platforms: Self-hosted
## Usage ## Usage
@ -15,9 +15,16 @@ Stop Dapr instances and their associated apps in self-hosted mode
dapr stop [flags] dapr stop [flags]
``` ```
## Examples
### Stop Dapr application
```bash
dapr stop --app-id <ID>
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description
| --- | --- | --- | --- | | --- | --- | --- | --- |
| `--app-id` | | | The application id to be stopped | | `--app-id`, `-a` | | | The application id to be stopped |
| `--help`, `-h` | | | Print this help message | | `--help`, `-h` | | | Print this help message |

View File

@ -7,7 +7,7 @@ description: "Detailed information on the uninstall CLI command"
## Description ## Description
Uninstall Dapr runtime Uninstall Dapr runtime. Supported platforms: Kubernetes and self-hosted
## Usage ## Usage
@ -15,6 +15,23 @@ Uninstall Dapr runtime
dapr uninstall [flags] dapr uninstall [flags]
``` ```
## Examples
### Uninstall from self-hosted mode
```bash
dapr uninstall
```
### Uninstall from self-hosted mode and remove .dapr directory, Redis, Placement and Zipkin containers
```bash
dapr uninstall --all
```
### Uninstall from Kubernetes
```bash
dapr uninstall -k
```
## Flags ## Flags
| Name | Environment Variable | Default | Description | Name | Environment Variable | Default | Description