Commit 34a4943b by achatterjee-grafana Committed by GitHub

addressed issues 28763 and 30314. (#31404)

parent d912970a
...@@ -7,25 +7,17 @@ weight = 400 ...@@ -7,25 +7,17 @@ weight = 400
# Grafana CLI # 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 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.
Grafana CLI has `plugins` and `admin` commands, as well as global options.
To list all commands and options: To list all commands and options:
``` ```
grafana-cli -h grafana-cli -h
``` ```
## Invoking Grafana CLI
**Linux users** 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`.
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.
Before you enter commands, `cd` into the Grafana bin directory. The default path is: >**Note:** Some commands, such as installing or removing plugins, require `sudo` on Linux. If you are on Windows, run Windows PowerShell as Administrator.
```
cd "C:\Program Files\GrafanaLabs\grafana\bin"
```
## Grafana CLI command syntax ## Grafana CLI command syntax
...@@ -122,7 +114,7 @@ Sets the path for the Grafana install/home path, defaults to working directory. ...@@ -122,7 +114,7 @@ Sets the path for the Grafana install/home path, defaults to working directory.
**Example:** **Example:**
```bash ```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 ### Override config file
...@@ -202,7 +194,7 @@ If there are two flags being used to set the homepath and the config file path, ...@@ -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: To correct this, use the `--homepath` global option to specify the Grafana default homepath for this command:
```bash ```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. 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