Skip to main content
Generate TypeScript type definitions for your Botpress project to enable autocomplete and type checking.

Usage

Alias: bp gen

What it does

The generate command:
  1. Analyzes your project definition
  2. Reads installed integrations and interfaces
  3. Generates TypeScript type definitions
  4. Outputs .d.ts files for intellisense

Options

—workDir

Specify project directory:
Default: current directory

Global options

All global options are available:

Generated files

Typings are generated in:
These files provide:
  • Type definitions for events
  • Type definitions for actions
  • Type definitions for states
  • Type definitions for configurations
  • Autocomplete for installed integrations

When to generate

Run bp generate after:
  • Creating a new project
  • Installing integrations/interfaces
  • Updating project definition
  • Changing events, actions, or states
Generate is automatically run during bp build

Examples

Generate for current project

Generate for specific project

Generate with verbose output

Integration with IDEs

Generated types enable:
  • IntelliSense in VS Code
  • Type checking in TypeScript
  • Autocomplete for Botpress APIs
  • Go-to-definition navigation

Development workflow

Troubleshooting

Types not showing up

Ensure your IDE is using the workspace TypeScript version:
  1. Open command palette
  2. Select “TypeScript: Select TypeScript Version”
  3. Choose “Use Workspace Version”

Outdated types

Regenerate after any project changes:

Build vs Generate

  • bp generate: Only generates types
  • bp build: Generates types AND bundles code
Use generate for faster iteration during development.