Update CLI ref based on master's help output. (#895)

This commit is contained in:
Artur Souza 2020-11-06 13:30:13 -08:00 committed by GitHub
parent daa503e2a0
commit 685e97656f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
18 changed files with 214 additions and 122 deletions

View File

@ -1,14 +1,15 @@
---
type: docs
title: "Dapr command line (CLI) reference"
title: "Dapr command line interface (CLI) reference"
linkTitle: "Overview"
description: "Detailed information on the dapr CLI"
description: "Detailed information on the Dapr CLI"
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.
```bash
__
____/ /___ _____ _____
/ __ / __ '/ __ \/ ___/
@ -16,32 +17,32 @@ The Dapr CLI allows you to setup Dapr on your local dev machine or on a Kubernet
\__,_/\__,_/ .___/_/
/_/
======================================================
A serverless runtime for hyperscale, distributed systems
===============================
Distributed Application Runtime
Usage:
dapr [command]
Available Commands:
completion Generates shell completion scripts
components List all Dapr components
configurations List all Dapr configurations
dashboard Start Dapr dashboard
help Help about any command
init Setup dapr in Kubernetes or Standalone modes
invoke Invokes a Dapr app with an optional payload (deprecated, use invokePost)
invokeGet Issue HTTP GET to Dapr app
invokePost Issue HTTP POST to Dapr app with an optional payload
init Install Dapr on supported hosting platforms, currently: Kubernetes and self-hosted
invoke Invoke a method on a given Dapr application
list List all Dapr instances
logs Gets Dapr sidecar logs for an app in Kubernetes
mtls Check if mTLS is enabled in a Kubernetes cluster
publish Publish an event to multiple consumers
run Launches Dapr and (optionally) your app side by side
status Shows the Dapr system services (control plane) health status.
stop Stops multiple running Dapr instances and their associated apps
uninstall Removes a Dapr installation
logs Get Dapr sidecar logs for an application
mtls Check if mTLS is enabled
publish Publish a pub-sub event
run Run Dapr and (optionally) your application side by side
status Show the health status of Dapr services
stop Stop Dapr instances and their associated apps in self-hosted mode
uninstall Uninstall Dapr runtime
Flags:
-h, --help help for Dapr
--version version for Dapr
-h, --help help for dapr
--version version for dapr
Use "dapr [command] --help" for more information about a command.
```
@ -50,13 +51,13 @@ Use "dapr [command] --help" for more information about a command.
You can learn more about each Dapr command from the links below.
- [`dapr completion`]({{< ref dapr-completion.md >}})
- [`dapr components`]({{< ref dapr-components.md >}})
- [`dapr configurations`]({{< ref dapr-configurations.md >}})
- [`dapr dashboard`]({{< ref dapr-dashboard.md >}})
- [`dapr help`]({{< ref dapr-help.md >}})
- [`dapr init`]({{< ref dapr-init.md >}})
- [`dapr invoke`]({{< ref dapr-invoke.md >}})
- [`dapr invokeGet`]({{< ref dapr-invokeGet.md >}})
- [`dapr invokePost`]({{< ref dapr-invokePost.md >}})
- [`dapr list`]({{< ref dapr-list.md >}})
- [`dapr logs`]({{< ref dapr-logs.md >}})
- [`dapr mtls`]({{< ref dapr-mtls.md >}})

View File

@ -0,0 +1,105 @@
---
type: docs
title: "completion CLI command reference"
linkTitle: "completion"
description: "Detailed information on the completion CLI command"
---
## Description
Generates shell completion scripts
## Usage
```bash
dapr completion [flags]
dapr completion [command]
```
## Examples
### Installing bash completion on macOS using Homebrew
If running Bash 3.2 included with macOS:
```bash
brew install bash-completion
```
Or, if running Bash 4.1+:
```bash
brew install bash-completion@2
```
Add the completion to your completion directory:
```bash
dapr completion bash > $(brew --prefix)/etc/bash_completion.d/dapr
source ~/.bash_profile
```
### Installing bash completion on Linux
If bash-completion is not installed on Linux, please install the bash-completion' package via your distribution's package manager.
Load the dapr completion code for bash into the current shell:
```bash
source <(dapr completion bash)
```
Write bash completion code to a file and source if from .bash_profile:
```bash
dapr completion bash > ~/.dapr/completion.bash.inc
printf "source '$HOME/.dapr/completion.bash.inc'" >> $HOME/.bash_profile
source $HOME/.bash_profile
```
### Installing zsh completion on macOS using homebrew
If zsh-completion is not installed on macOS, please install the 'zsh-completion' package:
```bash
brew install zsh-completions
```
Set the dapr completion code for zsh[1] to autoload on startup:
```bash
dapr completion zsh > "${fpath[1]}/_dapr"
source ~/.zshrc
```
### Installing zsh completion on Linux
If zsh-completion is not installed on Linux, please install the 'zsh-completion' package via your distribution's package manager.
Load the dapr completion code for zsh into the current shell:
```bash
source <(dapr completion zsh)
```
Set the dapr completion code for zsh[1] to autoload on startup:
```bash
dapr completion zsh > "${fpath[1]}/_dapr"
```
### Installing Powershell completion on Windows
Create $PROFILE if it not exists:
```bash
if (!(Test-Path -Path $PROFILE )){ New-Item -Type File -Path $PROFILE -Force }
```
Add the completion to your profile:
```bash
dapr completion powershell >> $PROFILE
```
## Available Commands
```txt
bash Generates bash completion scripts
powershell Generates powershell completion scripts
zsh Generates zsh completion scripts
```
## Flags
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | Prints this help message |
|

View File

@ -19,5 +19,5 @@ dapr components [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | Help for components |
| `--kubernetes`, `-k` | | `false` | List all Dapr components in a k8s cluster |
| `--help`, `-h` | | | Print this help message |
| `--kubernetes`, `-k` | | `false` | List all Dapr components in a Kubernetes cluster |

View File

@ -19,5 +19,5 @@ dapr configurations [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | Help for configurations |
| `--kubernetes`, `-k` | | `false` | List all Dapr configurations in a k8s cluster |
| `--help`, `-h` | | | Print this help message |
| `--kubernetes`, `-k` | | `false` | List all Dapr configurations in a Kubernetes cluster |

View File

@ -7,7 +7,7 @@ description: "Detailed information on the dashboard CLI command"
## Description
Start Dapr dashboard.
Start Dapr dashboard
## Usage
@ -19,8 +19,8 @@ dapr dashboard [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | Help for dashboard |
| `--kubernetes`, `-k` | | `false` | Start Dapr dashboard in local browser |
| `--version`, `-v` | | `false` | Check Dapr dashboard version |
| `--port`, `-p` | | `8080` | The local port on which to serve dashboard |
| `--help`, `-h` | | | Prints this help message |
| `--kubernetes`, `-k` | | `false` | Opens Dapr dashboard in local browser via local proxy to Kubernetes cluster |
| `--namespace`, `-n` | | `dapr-system` | The namespace where Dapr dashboard is running |
| `--port`, `-p` | | `8080` | The local port on which to serve Dapr dashboard |
| `--version`, `-v` | | `false` | Print the version for Dapr dashboard |

View File

@ -19,4 +19,4 @@ dapr help [command] [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | Help for help |
| `--help`, `-h` | | | Prints this help message |

View File

@ -7,7 +7,7 @@ description: "Detailed information on the init CLI command"
## Description
Setup Dapr in Kubernetes or Standalone modes
Install Dapr on supported hosting platforms, currently: Kubernetes and self-hosted
## Usage
@ -19,9 +19,12 @@ dapr init [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | Help for init |
| `--enable-ha` | | `false` | Enable high availability (HA) mode |
| `--enable-mtls` | | `true` | Enable mTLS in your cluster |
| `--help`, `-h` | | | Print this help message |
| `--kubernetes`, `-k` | | `false` | Deploy Dapr to a Kubernetes cluster |
| `--namespace`, `-n` | | `dapr-system` | The Kubernetes namespace to install Dapr in |
| `--network` | `DAPR_NETWORK` | | The Docker network on which to deploy the Dapr runtime |
| `--runtime-version` | | `latest` | The version of the Dapr runtime to install, for example: `v0.1.0-alpha` |
| `--redis-host` | `DAPR_REDIS_HOST` | `localhost` | The host on which the Redis service resides |
| `--slim`, `-s` | | `false` | Initialize dapr in self-hosted mode without placement, redis and zipkin containers.|
| `--runtime-version` | | `latest` | The version of the Dapr runtime to install, for example: `1.0.0` |
| `--slim`, `-s` | | `false` | Exclude placement service, Redis and Zipkin containers from self-hosted installation |

View File

@ -7,7 +7,7 @@ description: "Detailed information on the invoke CLI command"
## Description
Invokes a Dapr app with an optional payload (deprecated, use invokePost)
Invoke a method on a given Dapr application
## Usage
@ -19,7 +19,8 @@ dapr invoke [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--app-id`, `-a` | | | The app ID to invoke |
| `--help`, `-h` | | | Help for invoke |
| `--app-id`, `-a` | | | The application id to invoke |
| `--help`, `-h` | | | Print this help message |
| `--method`, `-m` | | | The method to invoke |
| `--payload`, `-p` | | | (optional) a json payload |
| `--payload`, `-p` | | | The JSON payload (optional) |
| `--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

@ -19,5 +19,5 @@ dapr list [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | Help for list |
| `--kubernetes`, `-k` | | `false` | List all Dapr pods in a k8s cluster |
| `--help`, `-h` | | | Print this help message |
| `--kubernetes`, `-k` | | `false` | List all Dapr pods in a Kubernetes cluster |

View File

@ -19,8 +19,8 @@ dapr logs [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--app-id`, `-a` | | | The app id for which logs are needed |
| `--help`, `-h` | | | Help for logs |
| `--kubernetes`, `-k` | | `true` | only works with a Kubernetes cluster (default true) |
| `--namespace`, `-n` | | `default` | (optional) Kubernetes namespace in which your application is deployed. default value is 'default' |
| `--pod-name`, `-p` | | | (optional) Name of the Pod. Use this in case you have multiple app instances (Pods) |
| `--app-id`, `-a` | | | The application id for which logs are needed |
| `--help`, `-h` | | | Print this help message |
| `--kubernetes`, `-k` | | `true` | Get logs from a Kubernetes cluster |
| `--namespace`, `-n` | | `default` | The Kubernetes namespace in which your application is deployed |
| `--pod-name`, `-p` | | | The name of the pod in Kubernetes, in case your application has multiple pods (optional) |

View File

@ -7,17 +7,25 @@ description: "Detailed information on the mtls CLI command"
## Description
Check if mTLS is enabled in a Kubernetes cluster
Check if mTLS is enabled
## Usage
```bash
dapr mtls [flags]
dapr mtls [command]
```
## Available Commands
```txt
expiry Checks the expiry of the root certificate
export Export the root CA, issuer cert and key from Kubernetes to local files
```
## Flags
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | Help for mtls |
| `--help`, `-h` | | | Print this help message |
| `--kubernetes`, `-k` | | `false` | Check if mTLS is enabled in a Kubernetes cluster |

View File

@ -19,7 +19,7 @@ dapr publish [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--pubsub` | | | Name of the pub/sub component
| `--data`, `-d` | | | (optional) a json serialized string |
| `--help`, `-h` | | | Help for publish |
| `--topic`, `-t` | | | The topic the app is listening on |
| `--data`, `-d` | | | The JSON serialized string (optional) |
| `--help`, `-h` | | | Print this help message |
| `--pubsub` | | | The name of the pub/sub component
| `--topic`, `-t` | | | The topic to be published to |

View File

@ -7,7 +7,7 @@ description: "Detailed information on the run CLI command"
## Description
Launches Dapr and (optionally) your app side by side
Run Dapr's sidecar and (optionally) an application.
## Usage
@ -15,21 +15,42 @@ Launches Dapr and (optionally) your app side by side
dapr run [flags] [command]
```
## Examples
Run a Java application:
```bash
dapr run --app-id myapp -- java -jar myapp.jar
```
Run a NodeJs application that listens to port 3000:
```bash
dapr run --app-id myapp --app-port 3000 -- node myapp.js
```
Run a Python application:
```bash
dapr run --app-id myapp -- python myapp.py
```
Run sidecar only:
```bash
dapr run --app-id myapp
```
## Flags
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--app-id` | | | An ID for your application, used for service discovery |
| `--app-port` | | `-1` | The port your application is listening o
| `--run-path` | | `Linux & Mac: $HOME/.dapr/run`, `Windows: %USERPROFILE%\.dapr\run` | Path for run directory |
| `--config` | | `Linux & Mac: $HOME/.dapr/config.yaml`, `Windows: %USERPROFILE%\.dapr\config.yaml` | Dapr configuration file |
| `--enable-profiling` | | | Enable `pprof` profiling via an HTTP endpoint |
| `--dapr-grpc-port` | | `-1` | The gRPC port for Dapr to listen on |
| `--help`, `-h` | | | Help for run |
| `--app-id`, `-i` | | | The id for your application, used for service discovery |
| `--app-max-concurrency` | | `unlimited` | The concurrency level of the application, otherwise is unlimited |
| `--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-ssl` | | `false` | Enable https when Dapr invokes the application
| `--components-path`, `-d` | | `Linux & Mac: $HOME/.dapr/components`, `Windows: %USERPROFILE%\.dapr\components` | The path for components directory
| `--config`, `-c` | | `Linux & Mac: $HOME/.dapr/config.yaml`, `Windows: %USERPROFILE%\.dapr\config.yaml` | Dapr configuration file |
| `--dapr-grpc-port` | | `3500` | The gRPC 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
| `--help`, `-h` | | | Print this help message |
| `--image` | | | The image to build the code in. Input is: `repository/image` |
| `--log-level` | | `info` | Sets the log verbosity. Valid values are: `debug`, `info`, `warning`, `error`, `fatal`, or `panic` |
| `--max-concurrency` | | `-1` | Controls the concurrency level of the app |
| `--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 |
| `--port`, `-p` | | `-1` | The HTTP port for Dapr to listen on |
| `--profile-port` | | `-1` | The port for the profile server to listen on |
| `--protocol` | | `http` | Tells Dapr to use HTTP or gRPC to talk to the app. Valid values are: `http` or `grpc` |
| `--profile-port` | | `7777` | The port for the profile server to listen on |

View File

@ -7,17 +7,19 @@ description: "Detailed information on the status CLI command"
## Description
Shows the Dapr system services (control plane) health status.
Show the health status of Dapr services
## Usage
This command only works for Kubernetes mode.
```bash
dapr status [flags]
dapr status -k
```
## Flags
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | Help for status |
| `--kubernetes`, `-k` | | `true` | only works with a Kubernetes cluster (default true) |
| `--help`, `-h` | | | Print this help message |
| `--kubernetes`, `-k` | | `false` | Show the health status of Dapr services on Kubernetes cluster |

View File

@ -7,7 +7,7 @@ description: "Detailed information on the stop CLI command"
## Description
Stops multiple running Dapr instances and their associated apps
Stop Dapr instances and their associated apps in self-hosted mode
## Usage
@ -19,5 +19,5 @@ dapr stop [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--app-id` | | | The app ID to stop (standalong mode) |
| `--help`, `-h` | | | Help for stop |
| `--app-id` | | | The application id to be stopped |
| `--help`, `-h` | | | Print this help message |

View File

@ -7,7 +7,7 @@ description: "Detailed information on the uninstall CLI command"
## Description
Removes a Dapr installation
Uninstall Dapr runtime
## Usage
@ -20,7 +20,7 @@ dapr uninstall [flags]
| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--all` | | `false` | Remove Redis, Zipkin containers in addition to actor placement container. Remove default dapr dir located at `$HOME/.dapr or %USERPROFILE%\.dapr\`. |
| `--help`, `-h` | | | Help for uninstall |
| `--help`, `-h` | | | Print this help message |
| `--kubernetes`, `-k` | | `false` | Uninstall Dapr from a Kubernetes cluster |
| `--namespace`, `-n` | | `dapr-system` | The Kubernetes namespace to uninstall Dapr from |
| `--network` | `DAPR_NETWORK` | | The Docker network from which to remove the Dapr runtime |
| `--runtime-version` | | `latest` | The version of the Dapr runtime to uninstall, for example: `v0.1.0-alpha` (Kubernetes mode only) |