Commit 34a4943b by achatterjee-grafana Committed by GitHub

addressed issues 28763 and 30314. (#31404)

parent d912970a
......@@ -7,25 +7,17 @@ weight = 400
# Grafana CLI
Grafana CLI is a small executable that is bundled with Grafana server and is supposed to be executed on the same machine Grafana server is running on.
Grafana CLI has `plugins` and `admin` commands, as well as global options.
Grafana CLI is a small executable that is bundled with Grafana server. It can be executed on the same machine Grafana server is running on. Grafana CLI has `plugins` and `admin` commands, as well as global options.
To list all commands and options:
```
grafana-cli -h
```
## Invoking Grafana CLI
**Linux users**
Some commands, such as installing or removing plugins, require `sudo` in order to run.
**Windows users**
Some commands, such as installing or removing plugins, require you to run Windows PowerShell as Administrator.
To invoke Grafana CLI, add the path to the grafana binaries in your `PATH` environment variable. Alternately, if your current directory is the `bin` directory, use `./grafana-cli`. Otherwise, you can specify full path to the CLI. For example, on Linux `/usr/share/grafana/bin/grafana-cli` and on Windows `C:\Program Files\GrafanaLabs\grafana\bin\grafana-cli.exe`.
Before you enter commands, `cd` into the Grafana bin directory. The default path is:
```
cd "C:\Program Files\GrafanaLabs\grafana\bin"
```
>**Note:** Some commands, such as installing or removing plugins, require `sudo` on Linux. If you are on Windows, run Windows PowerShell as Administrator.
## Grafana CLI command syntax
......@@ -122,7 +114,7 @@ Sets the path for the Grafana install/home path, defaults to working directory.
**Example:**
```bash
grafana-cli --homepath "c:\Program Files\grafana" admin reset-admin-password mynewpassword
grafana-cli --homepath "/usr/share/grafana" admin reset-admin-password <new password>
```
### Override config file
......@@ -202,7 +194,7 @@ If there are two flags being used to set the homepath and the config file path,
To correct this, use the `--homepath` global option to specify the Grafana default homepath for this command:
```bash
grafana-cli admin reset-admin-password --homepath "/usr/share/grafana" <new password>
grafana-cli --homepath "/usr/share/grafana" admin reset-admin-password <new password>
```
If you have not lost the admin password, we recommend that you change the user password either in the User Preferences or in the Server Admin > User tab.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment