# Quickstart

> Creating a bot is as simple as running the following command and following the instructions
>
> - **Canonical URL:** https://www.builderbot.app/en/quickstart
> - **Documentation Index:** https://www.builderbot.app/llms.txt
> - **Full Corpus:** https://www.builderbot.app/llms-full.txt

## Create

Creating a bot is as simple as running the following command and following the instructions

> **NOTE:**
> Prerequisites to consider before using this tool, [Node](https://nodejs.org/en) v20 or higher and [Git](https://git-scm.com/download)

```bash (pnpm)
pnpm create builderbot@latest
```

```bash (npm)
npm create builderbot@latest
```

or you can use the following command to create a bot with the default configuration

```bash (pnpm)
pnpm create builderbot@latest --provider=baileys --database=memory --language=ts
```

```bash (npm)
npm create builderbot@latest --provider=baileys --database=memory --language=ts
```

Use the space key to select and the enter key to confirm. The CLI performs a preliminary check of the Node and operating system version, informing you if it meets the requirements or providing you with relevant information. In addition to generating a base project for you to simply start up

```bash
pnpm create builderbot@latest
```

> **WARNING:**
> If you have problems with your terminal try running the command with __CMD, PowerShell, GitBash__ or another console you have installed.

---

## Requirements

Make sure you have installed Node version __20 or higher__, below you can see an example to check the version of node you are using.

```bash (Node Version)
node -v
v20.10.0
```

  [Download node from its official website](https://nodejs.org/en)

It is recommended to have GIT installed for proper operation. If you are using Linux or MacOc you probably already have GIT installed by default.

```bash (Git Version)
git -v
git version XXXX
```

  [Download GIT from its official website](https://git-scm.com/downloads)

---

## Base Example

In this example we can see the basis of a simple bot which responds to the keywords sent by a user, the words are: `info, hello, hi`. You can see how to create the bot and implement the [flows](/concepts#flow).

```ts (main.ts)
import { createBot, createProvider, createFlow, addKeyword, MemoryDB } from '@builderbot/bot'
import { BaileysProvider } from '@builderbot/provider-baileys'

/** send static messages */
const welcomeFlow = addKeyword<BaileysProvider, MemoryDB>(['hello', 'hi']).addAnswer('Ey! welcome')

/** send dynamic message from db or other sources */
const infoFlow = addKeyword<BaileysProvider, MemoryDB>('info')
    .addAction(async (ctx, { flowDynamic }) => {
        await flowDynamic(`Welcome ${ctx.name}`)
    })

/** send media files */
const mediaFlow = addKeyword<BaileysProvider, MemoryDB>('image')
    .addAnswer(`Send Image A`, { media: 'https://i.imgur.com/AsvWfUX.png' })
    .addAction(async (ctx, { flowDynamic }) => {
        await flowDynamic(`Welcome ${ctx.name}`)
        await flowDynamic(
            [
                {
                    body: 'Send Image B',
                    media: 'https://i.imgur.com/w0RtKnN.png'
                }
            ]
        )
    })

/** initialization bot */
const main = async () => {

    const adapterDB = new MemoryDB()
    const adapterFlow = createFlow([welcomeFlow, infoFlow, mediaFlow])
    const adapterProvider = createProvider(BaileysProvider)

    adapterProvider.initHttpServer(3000)

    await createBot({
        flow: adapterFlow,
        provider: adapterProvider,
        database: adapterDB,
    })
}

main()

```

```js (main.js)
const { createBot, createProvider, createFlow, addKeyword, MemoryDB } = require('@builderbot/bot')
const { BaileysProvider } = require('@builderbot/bot')

/** send static messages */
const welcomeFlow = addKeyword(['hello', 'hi']).addAnswer('Ey! welcome')

/** send dynamic message from db or other sources */
const infoFlow = addKeyword('info')
    .addAction(async (ctx, { flowDynamic }) => {
        await flowDynamic(`Welcome ${ctx.name}`)
    })

/** send media files */
const mediaFlow = addKeyword('image')
    .addAnswer(`Send Image A`, { media: 'https://i.imgur.com/AsvWfUX.png' })
    .addAction(async (ctx, { flowDynamic }) => {
        await flowDynamic(`Welcome ${ctx.name}`)
        await flowDynamic(
            [
                {
                    body: 'Send Image B',
                    media: 'https://i.imgur.com/w0RtKnN.png'
                }
            ]
        )
    })

/** initialization bot */
const main = async () => {

    const adapterDB = new MemoryDB()
    const adapterFlow = createFlow([welcomeFlow, infoFlow])
    const adapterProvider = createProvider(BaileysProvider)

    adapterProvider.initHttpServer(3000)

    await createBot({
        flow: adapterFlow,
        provider: adapterProvider,
        database: adapterDB,
    })
}

main()

```

---
