> For the complete documentation index, see [llms.txt](https://docs-v2.hypertest.co/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs-v2.hypertest.co/user-guides/node.js-sdk/cli-login.md).

# CLI Login

## 1. If running tests in CI env. <a href="#id-1-if-running-test-in-ci" id="id-1-if-running-test-in-ci"></a>

a. Go to your accounts page

<figure><img src="/files/5OkzmFZ4IA33WR8ykXzJ" alt=""><figcaption></figcaption></figure>

b. Click to create a new CLI token

<figure><img src="/files/KIjDTICp9oDdaWtKzJWJ" alt=""><figcaption></figcaption></figure>

c. Copy the newly generated CLI token and add it as a env var with key "HT\_CLI\_REFRESH\_TOKEN"

<figure><img src="/files/V91DYiK92y1nPSKpRlfk" alt=""><figcaption></figcaption></figure>

## 2. If running tests locally. <a href="#id-2-if-running-test-on-local" id="id-2-if-running-test-on-local"></a>

a. Once the test is started, cli will prompt the user to login by opening the dashboard url.

b. If cli is unable to open the url then it will log the url, user can manually click on the link to open dashboard.

<figure><img src="/files/rBxrrljrbic7F3OzPGBL" alt=""><figcaption></figcaption></figure>

c. User can login with SSO or email password option.

d. Once login is successful the user is redirected to accounts page where the cli token is generated if it doesn't exist and the test execution will resume.

<figure><img src="/files/nwtpmTjvccxCszxQ4uJV" alt=""><figcaption></figcaption></figure>

e. If the cli session times out then the process needs to be repeated. Once the token is saved in local, the same token will be reused for future test runs.
