# Getting started with eWizard CLI

## Software requirements

To start working with eWizard CLI:

1. Install Node.js from the [official site](http://nodejs.org/).

    ---
    **Note**

    _To guarantee the stable work of eWizard CLI, we recommend using the LTS version._

    ---

2. Install [Git](http://git-scm.com/).

## Install eWizard CLI

To install the [eWizard CLI npm package](https://www.npmjs.com/package/ewizard-cli) globally on your computer:

```bash
npm install -g ewizard-cli
```

For more information on how to develop e-Detailers, emails, sites with eWizard CLI, visit our [Documentation site](https://viseven.ewizard.io/docs/ewizardjs/).

For more information about the eWizard CLI commands, see [eWizard CLI commands documentation](https://viseven.ewizard.io/docs/ewizardjs/documentation/guide/cli.html).

Otherwise, below is the Quick Start Guide for you.

## Login

Once you've installed eWizard CLI, log in to your eWizard instance.

1. Use the Command prompt to log in.

    ```bash
    wiz login
    ```

2. If it's your first login, enter your eWizard instance.

    ---
    **Note**

    _You receive your eWizard instance link with your user name and password credentials. The eWizard instance follows this pattern: `https://[company].ewizard.io`. For example, [https://viseven.ewizard.io](https://viseven.ewizard.io)._

    ---

    The authentication form opens in your browser.

3. Enter your login and password.

4. Select **Sign in**.

    Congratulations! You are logged in.

## Initialize project

To create the initial project structure and install all dependencies, run:

```bash
wiz init
```

After successful project creation, you can use other eWizard CLI commands.

## Components

Use `wiz install` to fetch and install components. Under the hood, it works with the npm packages.

To install a component, run:

```bash
wiz install
```

Make sure the `package.json` file in your project has the component dependency. For example, to install the `wiz-button` component, add this dependency:

```json
// .package.json

"wiz-button": "git+https://git.qapint.com/ewizardjs/email/components/wiz-button.git"
```

Or you can run:

```bash
wiz install [COMPONENT_NAME]
```

This command installs the component to the `./node_modules` directory and writes the dependency to the `package.json` file.

For example:

```bash
wiz install wiz-button
```

## Development process

Run the following command to build a project:

```bash
wiz dev
```

Use `wiz dev` with the `--live` option to start a hot reload server. This command builds your project and runs it on the dev server. By default, the dev server is running on port 3000.

Go to `http://localhost:3000` in your browser to see the project with live reloading. eWizard CLI tracks changes in the project files, rebuilds the project and reloads it in the browser.

## Run tests locally

Before running tests, create the `.env` file in the root of your project with eWizard credentials:

```bash
TEST_URL=https://instance.ewizard.io
TEST_USER=[USER_NAME]
TEST_PASSWORD=[PASSWORD]
```

---
**Note**

_The instance is your company name. For example, https://viseven.ewizard.io._

_`[USER_NAME]` is your eWizard username or email address._

_`[PASSWORD]` is your eWizard password._

---
