npm create builderbot command is the recommended way to create new BuilderBot projects. It provides an interactive wizard that helps you configure your chatbot with the right provider, database, and language settings.
Basic Usage
Interactive Mode
Run the command without any arguments to launch the interactive setup:- Display the BuilderBot version and welcome message
- Check system requirements (Node.js 20+, Git)
- Prompt for provider selection
- Prompt for database selection
- Prompt for language preference
- Create the project directory
- Copy template files
- Display setup instructions
Non-Interactive Mode
You can skip the interactive prompts by providing all required arguments:Command Arguments
When using non-interactive mode, all three arguments are required:--provider
Specifies the WhatsApp or messaging provider.
Available options:
--database
Specifies the database backend for storing conversation data.
Available options:
--language
Specifies the programming language for the project.
Available options:
Examples
Create a TypeScript Project with Baileys and MongoDB
base-ts-baileys-mongo.
Create a JavaScript Project with Meta and PostgreSQL
base-js-meta-postgres.
Create an Email Bot with JSON Storage
base-ts-email-json.
Project Structure
After running the command, you’ll get a project with this structure:What Happens During Creation
1. System Check
The CLI verifies:- Node.js version is 20 or higher
- Git is installed and accessible
2. Template Selection
Based on your selections, the CLI:- Determines the correct template name:
base-[language]-[provider]-[database] - Locates the template in the starters directory
- Validates the template exists
3. File Copying
The CLI:- Creates a new directory with the template name
- Copies all template files to the new directory
- Renames
_gitignoreto.gitignore - Sets the correct BuilderBot package versions in
package.json
4. Completion
After successful creation, you’ll see:Post-Installation Steps
1. Navigate to Project
2. Install Dependencies
3. Configure Environment
Copy the example environment file:.env with your provider credentials and database connection details.
4. Start Development
For TypeScript projects:Error Handling
Missing Arguments
If you provide some but not all arguments in non-interactive mode:Invalid Provider
Invalid Database
Invalid Language
System Requirements Not Met
If Node.js version is too old:Advanced Usage
Using Specific Versions
Create a project with a specific BuilderBot version:Using Different Package Managers
With Yarn:Templates Matrix
The CLI includes pre-built templates for all combinations:- Languages: 2 (TypeScript, JavaScript)
- Providers: 10 (Baileys, Sherpa, Evolution API, WPPConnect, Twilio, Meta, Facebook Messenger, Instagram, GoHighLevel, Email)
- Databases: 5 (Memory, JSON, MongoDB, MySQL, PostgreSQL)
- Proper typing (TypeScript projects)
- Provider-specific configuration
- Database connection setup
- Example flows and handlers
- Development tooling