Skip to content

Commit

Permalink
Merge pull request #7 from nowsecure/doc-updates
Browse files Browse the repository at this point in the history
readme.md updates
  • Loading branch information
cosdon authored Aug 29, 2024
2 parents 495ff04 + 429a686 commit 32c2eb1
Showing 1 changed file with 44 additions and 6 deletions.
50 changes: 44 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,13 @@ The following is needed to use the ns-cli:

### Install

1. Get binary from [Releases](https://github.com/nowsecure/nowsecure-platform-cli/releases)
2. Right click the .pkg file and select `run`.
The NowSecure CLI currently supports macOS, Debian based Linux distributions (Ubuntu), and Microsoft Windows (beta). Below are the steps to install on each operating system:

1. Navigate to the [Releases](https://github.com/nowsecure/nowsecure-platform-cli/releases) page and download the appropriate binary for your operating system/architecture (32 or 64bit).
2. Install based on your operating system:
1. MacOS: Right click the .pkg file and select `run`.
2. Linux: `sudo dpkg -i ns-cli_<VERSION>.deb`
3. Window: Double-click `ns-cli_<VERSION>.exe`

### Configure

Expand All @@ -35,9 +40,9 @@ The following is needed to use the ns-cli:

**Note:** Most users will only need to use the default profile.
3. The next prompt will ask you to enter the Platform API token that you will be using. Paste this into the field provided and hit enter.
4. The next prompt will ask you to enter the Graphql endpoint for the NowSecure Platform. You can just hit enter if you are using the CLI to interact with the default production instance of NowSecure Platform. If you are using a single tenant deployment of NowSecure Platform, you will need to enter the URL of your Graphql endpoint. This URL will be in the format of `api.<tenant>.nowsecure.com`.
5. The next prompt will ask you to enter the REST endpoint for the NowSecure Platform. You can just hit enter if you are using the CLI to interact with the default production instance of NowSecure Platform. If you are using a single tenant deployment of NowSecure Platform, you will need to enter the URL of your REST endpoint. This URL will be in the format of `lab-api.<tenant>.nowsecure.com`.
6. The next prompt and final will ask you to enter the UI Server for the NowSecure platform. You can just hit enter if you are using the CLI to interact with the default production instance of NowSecure Platform. If you are using a single tenant deployment of NowSecure Platform, you will need to enter the URL of your UI Server. This URL will be in the format of `app.<tenant>.nowsecure.com`.
4. The next prompt will ask you to enter the Graphql endpoint for NowSecure Platform. You can just hit enter if you are using the CLI to interact with the default production instance of NowSecure Platform. If you are using a single tenant deployment of NowSecure Platform, you will need to enter the URL of your Graphql endpoint. This URL will be in the format of `api.<tenant>.nowsecure.com`.
5. The next prompt will ask you to enter the REST endpoint for NowSecure Platform. You can just hit enter if you are using the CLI to interact with the default production instance of NowSecure Platform. If you are using a single tenant deployment of NowSecure Platform, you will need to enter the URL of your REST endpoint. This URL will be in the format of `lab-api.<tenant>.nowsecure.com`.
6. The next prompt and final will ask you to enter the UI Server for NowSecure platform. You can just hit enter if you are using the CLI to interact with the default production instance of NowSecure Platform. If you are using a single tenant deployment of NowSecure Platform, you will need to enter the URL of your UI Server. This URL will be in the format of `app.<tenant>.nowsecure.com`.

Once done, verify that the CLI functions as expected by running `ns-cli app list`. A listing of the apps in your platform account will be displayed. If desired, you can run `ns-cli app list --json` to return the results in json format. Example:

Expand All @@ -50,6 +55,37 @@ REF TITLE
dcf30d7a-2c16-11eb-80b5-snip Facebook ios com.facebook.Facebook "Cool Group"
9d691706-3181-11eb-80b5-snip Darksky ios com.jackadam.darksky "Auto Group"
```
#### Windows Configuration Note

In some cases, the `ns-cli configure` will return "Error: N ot a valid token" when using CTRL-V to paste a valid token into the Windows Command or Powershell Prompt. If this occurs, paste the token into the command prompt by using right click from your mouse. When you do this, you should see asterisks to represent the token that is being submitted. If this does not work, we recommend manually creating the `.nsclirc` file via the steps in the following section.



#### Manual Configuration of .nsclirc file

The `.nsclirc` file holds the configuration for the ns-cli. If you want to manually configure this file, it should be created in the root of the user's home directory and should be named `.nsclirc` with no extensions (.txt, .env, etc). The contents of this file should be configured as follows:

* `[Profile]`: The ns-cli supports multiple profiles with the default profile being aptly named `[default]`.
* `token`: The token that you are using.
* `graphql` (optional): The graphql API endpoint that will be used. This parameter is optional if you are using the default, https://api.nowsecure.com.
* `rest`: (optional): The rest API endpoint that will be used. This parameter is optional if you are using the default, https://lab-api.nowsecure.com.
* `ui`: (optional): The URL to the UI that will be used. THis parameter is optional if you are using the default, https://app.nowsecure.com

Example of an .nsclirc file supporting a single profile using the default endpoints:

```
[default]
token=eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenwC
```
Example of an .nsclirc file supporting a single profile using single tenant endpoints:

```
[default]
token=eyJhbGciOiJFUzUxMiIsInR5cCI6IkpXVCJ9.eyTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenTokenwC
graphql=https://api.st1.nowsecure.com
rest=https://lab-api.st1.nowsecure.com
ui=https://rainier.st1.nowsecure.com
```

### Usage

Expand Down Expand Up @@ -115,7 +151,9 @@ You can use the `--help` option to get more details on each of the options above

#### autocomplete

Running `ns-cli autocomplete` will provide details on how to integrate the ns-cli into your `.zshrc` to perform autocomplete actions.
Running `ns-cli autocomplete` will provide details on how to integrate the ns-cli into your `.zshrc` to perform autocomplete actions.

**Note:** Autocomplete is not currently supported in Windows

#### configure

Expand Down

0 comments on commit 32c2eb1

Please sign in to comment.