# Deployment Using CLI

**Automating Spurtcommerce Multi-Vendor Solution Deployment using CLI**

Deploying and setting up an ecommerce web application involves many steps and configurations. In this article, we will look at a Node.js Command Line Interface (CLI) tool that automates the installation and configuration of the Spurtcommerce Multi-Vendor Solution.

This tool simplifies and automates tasks like cloning from GitHub, setting up the database, modifying environment files, and installing dependencies. This process not only saves developers time but also creates a smoother and more error-resistant development environment.

**1. Simplifying Setup with Command-line Arguments:**

The tool uses the *yargs* package to give developers an easy way to customize deployment settings. By typing specific commands, users can start processes like installing the repository and validating its correctness.

To kick off the installation,

·       Setup your system with the required pre-requisites detailed in this [<mark style="color:blue;">link</mark> ](https://www.spurtcommerce.dev/getting-started/prerequisites/set-up-development-environment)

·       Use the following CLI command to install the Spurtcommerce CLI globally:

```
$ npn i -g @spurtcommerce/cli
```

The node npm package @spurtcommerce/cli refers to the Spurtcommerce CLI tool, a command-line interface specifically developed for managing Spurtcommerce projects. This package installs the Spurtcommerce CLI globally on your system, making the Spurtcommerce command available from any directory in your terminal.                                &#x20;

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

• Then, use Spurtcommerce CLI tool installed above to initiate the installation of the Multi-Vendor module, automating the process and potentially prompting the user for additional information required during the installation.

```
$ spurtcommerce -i Multivendor
```

<figure><img src="/files/9E3GwY00TerAMfFcCB4F" alt=""><figcaption></figcaption></figure>

**2. GitHub Repository Cloning Made Effortless:**

The Spurtcommerce CLI tool uses the simple-git package to automate cloning the Spurtcommerce Multi-Vendor Solution from [GitHub ](https://github.com/spurtcommerce/multivendor-marketplace.git) This speeds up the initial setup and ensures a clean local environment.                                                                                                                                          &#x20;

**3. Database Setup and Migration:**

·       Understanding the importance of user interaction, the CLI tool incorporates the inquirer package to prompt users for essential database-related information. This step ensures a smooth and error-free configuration process, guiding developers through key aspects such as MySQL hostname, port, username, and password.

·       To seamlessly integrate user-provided database configuration parameters, the CLI tool dynamically modifies the content of the environment file (api/.env). This automated adjustment not only eliminates manual configuration errors but also enhances the adaptability of the deployment process.

·       By connecting to the MySQL database using the provided credentials, the CLI tool executes table migrations based on the SQL file (api/spurtcommerce.sql). This automated database setup ensures consistency and reliability, sparing developers from the intricacies of manual migration processes.

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

**4. Dependency Installation:**

Installing Node.js dependencies is crucial. The tool uses the exec function to seamlessly install these dependencies for the Spurtcommerce Multi-Vendor APIs, ensuring a smooth setup.

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

**5. Real-time Feedback and Interaction:**

To keep users informed, the tool uses console.log statements and loading animations. This real-time feedback enhances transparency and user engagement during the deployment process.

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

Once all the dependencies are installed, you are ready to use Spurtcommerce application in your system!

**Admin panel** **- Default credentials:**

**username:** <marketplace@spurtcart.com>&#x20;

**password:** Piccosoft2012

**Conclusion:**

Automation is key to speeding up deployment and improving the quality of web application development. This tool simplifies tasks for developers and enhances user engagement during the deployment of Spurtcommerce Multi-Vendor Solution. Consider incorporating similar automation into your projects for more efficient and streamlined workflows.


---

# Agent Instructions: 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:

```
GET https://docs.spurtcommerce.com/getting-started/development-and-setup/deployment-using-cli.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
