From 34a4943baf4e9c461b090e6c80d8161d49ce1a36 Mon Sep 17 00:00:00 2001 From: achatterjee-grafana <70489351+achatterjee-grafana@users.noreply.github.com> Date: Mon, 22 Feb 2021 19:56:12 -0500 Subject: [PATCH] addressed issues 28763 and 30314. (#31404) --- docs/sources/administration/cli.md | 20 ++++++-------------- 1 file changed, 6 insertions(+), 14 deletions(-) diff --git a/docs/sources/administration/cli.md b/docs/sources/administration/cli.md index 5c32403a1c1..87d77715be2 100644 --- a/docs/sources/administration/cli.md +++ b/docs/sources/administration/cli.md @@ -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. +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`. -**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: -``` -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 ``` ### 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" +grafana-cli --homepath "/usr/share/grafana" admin reset-admin-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.