Skip to content

Commit

Permalink
Update CLI ref based on master's help output. (#895)
Browse files Browse the repository at this point in the history
  • Loading branch information
artursouza committed Nov 6, 2020
1 parent daa503e commit 685e976
Show file tree
Hide file tree
Showing 18 changed files with 214 additions and 122 deletions.
39 changes: 20 additions & 19 deletions daprdocs/content/en/reference/cli/cli-overview.md
Original file line number Diff line number Diff line change
@@ -1,47 +1,48 @@
---
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

__
____/ /___ _____ _____
/ __ / __ '/ __ \/ ___/
/ /_/ / /_/ / /_/ / /
\__,_/\__,_/ .___/_/
/_/
======================================================
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.
```
Expand All @@ -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 >}})
Expand Down
105 changes: 105 additions & 0 deletions daprdocs/content/en/reference/cli/dapr-completion.md
Original file line number Diff line number Diff line change
@@ -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 |
|
4 changes: 2 additions & 2 deletions daprdocs/content/en/reference/cli/dapr-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
4 changes: 2 additions & 2 deletions daprdocs/content/en/reference/cli/dapr-configurations.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
10 changes: 5 additions & 5 deletions daprdocs/content/en/reference/cli/dapr-dashboard.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ description: "Detailed information on the dashboard CLI command"

## Description

Start Dapr dashboard.
Start Dapr dashboard

## Usage

Expand All @@ -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 |
2 changes: 1 addition & 1 deletion daprdocs/content/en/reference/cli/dapr-help.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,4 @@ dapr help [command] [flags]

| Name | Environment Variable | Default | Description
| --- | --- | --- | --- |
| `--help`, `-h` | | | Help for help |
| `--help`, `-h` | | | Prints this help message |
11 changes: 7 additions & 4 deletions daprdocs/content/en/reference/cli/dapr-init.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 |
9 changes: 5 additions & 4 deletions daprdocs/content/en/reference/cli/dapr-invoke.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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 |
24 changes: 0 additions & 24 deletions daprdocs/content/en/reference/cli/dapr-invokeGet.md

This file was deleted.

25 changes: 0 additions & 25 deletions daprdocs/content/en/reference/cli/dapr-invokePost.md

This file was deleted.

4 changes: 2 additions & 2 deletions daprdocs/content/en/reference/cli/dapr-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
10 changes: 5 additions & 5 deletions daprdocs/content/en/reference/cli/dapr-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -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) |
12 changes: 10 additions & 2 deletions daprdocs/content/en/reference/cli/dapr-mtls.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |
8 changes: 4 additions & 4 deletions daprdocs/content/en/reference/cli/dapr-publish.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 |

0 comments on commit 685e976

Please sign in to comment.