Webchat CLI is a tool to help you build and deploy custom webchat components.
npm install @botpress/webchat-cliWebchat CLI is a tool to help you build and deploy custom webchat components.
``bash`
npm install -g @botpress/webchat-cli && npm install -D @bpinternal/zui
Start by creating a new component:
`bash`
webchat init
You will be asked to provide a name for your component. Once provided, the CLI will create a new folder with the name of your component containing the following files:
- Component.bp.tsx: The main component of your webchat component.schema.ts
- : The schema of your webchat component properties.styles.css
- : The styles of your webchat component.
You can now start developing your webchat component. Once you are done, you can build your component by running:
`bash`
webchat build
and selecting your component from the list.
This will create a Component.bp.js file in your folder. You can now deploy this file to your bot by running:
`bash`
webchat deploy
and select your component from the list.
If this is the first time you are deploying a component, you will be asked to:
- provide Personal Access Token (PAT)
- select your workspace
- select your bot
Once you have provided the required information, the CLI will deploy your component to your bot.
`bash`
webchat remove
and select your component from the list.
This will remove the component from your bot.
`bash``
webchat logout
This will logout from your workspace.