> For the complete documentation index, see [llms.txt](https://docs.nosto.com/magento/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nosto.com/magento/guides/console-commands.md).

# Console Commands

It is possible to use a console command to reconnect or remove the account. This process can be handy when your deployments are automated.

![3.8.0](https://img.shields.io/badge/nosto-3.8.0-red.svg)

## Getting tokens from the Nosto Admin Panel.

Log-in into [Nosto Admin](https://my.nosto.com) with your already existing account, select the store you want to reconnect and head to `Settings -> Authentication Tokens`.\
To obtain the tokens, just hit the decrypt button. ![cropper](https://user-images.githubusercontent.com/2778820/44570846-cf96f300-a787-11e8-952e-0fc1950ea77e.png)

## Getting Store View Scope Code From Magento's Backend

Since you need a different Nosto account for each store view, you need to get the store scope code. You can find in: `System -> Manage stores`

![stores\_\_\_system\_\_\_magento\_admin\_and\_editing\_reconnecting\_nosto\_account\_via\_cli\_command\_ \_nosto\_nosto-magento2\_wiki](https://user-images.githubusercontent.com/2778820/44987528-2d012000-af90-11e8-907d-710ecca01db9.png)

You can find the store code under the store view link. If for any reason Magento do not show this information, you can also click in the storeview and lookup in the `code` field

![english\_\_\_stores\_\_\_system\_\_\_magento\_admin](https://user-images.githubusercontent.com/2778820/44987581-57eb7400-af90-11e8-99d2-74fc28c521e1.png)

## Using the Console Command to Reconnect Your Existing Nosto Account

The script file should be available in the `%nosto_installation_root%/shell/reconnect.php`.

If you have installed the extension through modman, the installation root directory should be under `%magento_root%/.modman/nosto-magento`.

If you have installed via Magento Connect or via package upload, the extension should be in the `app/code/community/Nosto/Tagging` directory.

In order to use this command with non-interactive installation scripts, you should pass all the parameters via command line arguments.

You can use the help from the command to figure out all the necessary parameters: ![image](https://user-images.githubusercontent.com/2778820/44987768-07c0e180-af91-11e8-8743-aa4636b82f7b.png)

### Command Example:

```bash
php -f app/code/community/Nosto/Tagging/shell/reconnect.php -- \
--account-id NOSTO_ACCOUNT_NAME \
--products_token PRODUCTS_TOKEN \
--sso_token SSO_TOKEN \
--settings_token SETTINGS_TOKEN \
--rates_token EXCHANGE_RATES_TOKEN \
--scope-code STORE_VIEW_SCOPE_CODE \
--override
```

![image](https://user-images.githubusercontent.com/2778820/44988170-6e92ca80-af92-11e8-9f38-aacd73f7a4f9.png)

## Using the Console Command to Remove Your Nosto Account

This command is used to disconnect an existing account from your store.

The script file should be available in the `%nosto_installation_root%/shell/remove.php`.

If you have installed the extension through modman, the installation root directory should be under `%magento_root%/.modman/nosto-magento`.

If you have installed via Magento Connect or via package upload, the extension should be in the `app/code/community/Nosto/Tagging` directory.

In order to use this command with non-interactive installation scripts, you should pass all the parameters via command line arguments.

![image](https://user-images.githubusercontent.com/44775916/49878267-d24d4f00-fe2f-11e8-85bc-d0395caed695.png)

### Command Example:

```bash
php -f app/code/community/Nosto/Tagging/shell/remove.php -- \                                  
--scope-code STORE_VIEW_SCOPE_CODE
```

![image](https://user-images.githubusercontent.com/44775916/49878573-949cf600-fe30-11e8-85a9-981cd4b74b9a.png)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.nosto.com/magento/guides/console-commands.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
