mirror of
https://github.com/hexastack/hexabot
synced 2025-03-10 14:25:42 +00:00
GITBOOK-92: No subject
This commit is contained in:
parent
e3e31f6bea
commit
8f70e82029
@ -52,6 +52,7 @@
|
||||
|
||||
## Developer Guide
|
||||
|
||||
* [CLI Command Reference](developer-guide/cli-command-reference.md)
|
||||
* [Developers Installation Guide](developer-guide/developers-installation-guide.md)
|
||||
* [Hexabot UI Admin Panel](developer-guide/hexabot-ui-admin-panel.md)
|
||||
* [Hexabot Live Chat Widget](developer-guide/hexabot-live-chat-widget.md)
|
||||
|
159
docs/developer-guide/cli-command-reference.md
Normal file
159
docs/developer-guide/cli-command-reference.md
Normal file
@ -0,0 +1,159 @@
|
||||
# CLI Command Reference
|
||||
|
||||
Hexabot CLI is a powerful command-line tool to help manage your Hexabot chatbot instance. With it, you can create new projects, initialize environments, start services in various modes, run database migrations, and more. The CLI aims to make managing your chatbot seamless and intuitive.
|
||||
|
||||
Not yet familiar with [Hexabot](https://hexabot.ai/)? It's a open-source chatbot / agent solution that allows users to create and manage AI-powered, multi-channel, and multilingual chatbots with ease. If you would like to learn more, please visit the [official github repo](https://github.com/Hexastack/Hexabot/).
|
||||
|
||||
### Getting Started
|
||||
|
||||
#### Prerequisites
|
||||
|
||||
* Node.js >= 18.17.0
|
||||
* npm (Node Package Manager)
|
||||
* Docker installed
|
||||
|
||||
#### Installation
|
||||
|
||||
Install Hexabot CLI globally to have easy access to its commands:
|
||||
|
||||
```
|
||||
npm install -g hexabot-cli
|
||||
```
|
||||
|
||||
#### Usage
|
||||
|
||||
Once installed, you can use the `hexabot` command in your terminal. Here are some of the available commands:
|
||||
|
||||
#### Commands
|
||||
|
||||
**`create <projectName>`**
|
||||
|
||||
Create a new Hexabot project.
|
||||
|
||||
```
|
||||
hexabot create my-chatbot
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
* `--template <template>`: Specify a GitHub repository in the format `GITHUB_USERNAME/GITHUB_REPO` to use a custom template.
|
||||
|
||||
Example:
|
||||
|
||||
```
|
||||
hexabot create my-chatbot --template myusername/my-template-repo
|
||||
```
|
||||
|
||||
**`init`**
|
||||
|
||||
Initialize the environment by copying `.env.example` to `.env`.
|
||||
|
||||
```
|
||||
hexabot init
|
||||
```
|
||||
|
||||
**`dev`**
|
||||
|
||||
Start specified services in development mode with Docker Compose.
|
||||
|
||||
```
|
||||
hexabot dev --services nlu,ollama
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
* `--services <services>`: Comma-separated list of services to enable.
|
||||
|
||||
**`start`**
|
||||
|
||||
Start specified services with Docker Compose.
|
||||
|
||||
```
|
||||
hexabot start --services api,nlu
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
* `--services <services>`: Comma-separated list of services to enable.
|
||||
|
||||
**`migrate [args...]`**
|
||||
|
||||
Run database migrations.
|
||||
|
||||
```
|
||||
hexabot migrate
|
||||
```
|
||||
|
||||
You can also pass additional arguments to the migration command.
|
||||
|
||||
**`start-prod`**
|
||||
|
||||
|
||||
|
||||
Start specified services in production mode with Docker Compose.
|
||||
|
||||
```
|
||||
hexabot start-prod --services api,nlu
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
* `--services <services>`: Comma-separated list of services to enable.
|
||||
|
||||
**`stop`**
|
||||
|
||||
Stop specified Docker Compose services.
|
||||
|
||||
```
|
||||
hexabot stop --services api,nlu
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
* `--services <services>`: Comma-separated list of services to stop.
|
||||
|
||||
**`destroy`**
|
||||
|
||||
Destroy specified Docker Compose services and remove volumes.
|
||||
|
||||
```
|
||||
hexabot destroy --services api,nlu
|
||||
```
|
||||
|
||||
Options:
|
||||
|
||||
* `--services <services>`: Comma-separated list of services to destroy.
|
||||
|
||||
### Example Workflow
|
||||
|
||||
1. **Create a new project**:
|
||||
|
||||
```
|
||||
hexabot create my-chatbot
|
||||
```
|
||||
|
||||
This will create a new folder `my-chatbot` with all necessary files to get started.
|
||||
2. **Navigate to your project folder**:
|
||||
|
||||
```
|
||||
cd my-chatbot
|
||||
```
|
||||
3. **Install dependencies**:
|
||||
|
||||
```
|
||||
npm install
|
||||
```
|
||||
4. **Initialize environment**:
|
||||
|
||||
```
|
||||
hexabot init
|
||||
```
|
||||
|
||||
This command copies the `.env.example` file to `.env`, which you can edit to customize your configuration.
|
||||
5. **Run in development mode**:
|
||||
|
||||
```
|
||||
hexabot dev --services nlu,ollama
|
||||
```
|
||||
|
||||
This starts the required services in development mode.
|
@ -24,38 +24,6 @@ _curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.40.1/install.sh | bash
|
||||
Check NVM official documentation for more details :[https://github.com/nvm-sh/nvm?tab=readme-ov-file#node-version-manager---](https://github.com/nvm-sh/nvm?tab=readme-ov-file#node-version-manager---) 
|
||||
{% endhint %}
|
||||
|
||||
### # Installation
|
||||
|
||||
1. **Clone the Repository:**
|
||||
|
||||
```
|
||||
$ git clone https://github.com/hexastack/hexabot.git
|
||||
```
|
||||
|
||||
2. **Installation:**
|
||||
|
||||
Install node dependencies using:
|
||||
|
||||
```
|
||||
$ npm install
|
||||
```
|
||||
|
||||
2. **Environment Setup:** 
|
||||
|
||||
To configure the environment variables, use the Makefile at the root folder for initialization:
|
||||
|
||||
```
|
||||
$ npx hexabot init
|
||||
```
|
||||
|
||||
This will copy the `.env.example` file to `.env` in the `./docker` directory if the file does not already exist.
|
||||
|
||||
3. **Running the Application:** Once your environment is set up, you can start the app. Use either of the following commands:
|
||||
|
||||
{% hint style="info" %}
|
||||
**Note:** The first time you run the app, Docker will take some time to download all the required images
|
||||
{% endhint %}
|
||||
|
||||
<details>
|
||||
|
||||
<summary>Do you want to install Hexabot on a Windows machine?</summary>
|
||||
@ -70,22 +38,52 @@ Learn more : [https://learn.microsoft.com/en-us/windows/wsl/tutorials/wsl-contai
|
||||
|
||||
</details>
|
||||
|
||||
```
|
||||
$ npx hexabot start
|
||||
```
|
||||
### Installation
|
||||
|
||||
Or for development mode:
|
||||
1. **Install Hexabot CLI globally to have easy access to its commands:**
|
||||
|
||||
```
|
||||
$ npx hexabot dev
|
||||
$ npm install -g hexabot-cli
|
||||
```
|
||||
|
||||
You can enable specific services like the NLU engine, nginx or smtp4dev (coma seperated) :
|
||||
2. **Create a new project**:
|
||||
|
||||
```
|
||||
$ npx hexabot dev --enable=nlu
|
||||
$ hexabot create my-chatbot
|
||||
```
|
||||
|
||||
3. **Navigate to your project folder**
|
||||
|
||||
```
|
||||
$ cd my-chatbot/
|
||||
```
|
||||
|
||||
4. **Install dependencies**:
|
||||
|
||||
```
|
||||
$ npm i
|
||||
```
|
||||
|
||||
5. **Environment Setup:** 
|
||||
|
||||
To configure the environment variables, use the following command:
|
||||
|
||||
```
|
||||
$ hexabot init
|
||||
```
|
||||
|
||||
This will copy the `.env.example` file to `.env` in the `./docker` directory if the file does not already exist.
|
||||
|
||||
6. **Run in development mode:** Once your environment is set up, you can start the app. Use the following command:
|
||||
|
||||
```
|
||||
$ hexabot dev --services nlu,ollama
|
||||
```
|
||||
|
||||
{% hint style="info" %}
|
||||
**Note:** The first time you run the app, Docker will take some time to download all the required images
|
||||
{% endhint %}
|
||||
|
||||
### Usage
|
||||
|
||||
UI Admin Panel is accessible via [http://localhost:8080](http://localhost:8080), the default credentials are 
|
||||
@ -102,12 +100,6 @@ adminadmin
|
||||
```
|
||||
{% endcode %}
|
||||
|
||||
Live Chat Widget demo is accessible via [http://localhost:5173](http://localhost:5173)
|
||||
|
||||
### Useful Commands
|
||||
|
||||
* `npx hexabot init` : Copies the .env.example file to .env in the ./docker directory if .env does not exist. This is usually used for initial setup.
|
||||
* `npx hexabot dev` : Builds the Docker images locally before starting the services in development mode. It first checks the .env file for completeness against .env.example.
|
||||
* `npx hexabot start` : Starts the app by pulling the Docker images from Docker Hub. This target also checks the .env file for required variables.
|
||||
* `npx hexabot stop` : Stops all running Docker services defined in the compose files.
|
||||
* `npx hexabot destroy` : Stops all services and removes all volumes associated with the Docker compose setup, ensuring a clean state.
|
||||
{% hint style="info" %}
|
||||
You can find more about the Hexabot CLI command [here](../developer-guide/cli-command-reference.md).
|
||||
{% endhint %}
|
||||
|
Loading…
Reference in New Issue
Block a user