create-botpress-actions
v0.2.1
Published
Scaffold a new Botpress actions project
Maintainers
Readme
create-botpress-actions
Scaffold a new Botpress actions project with TypeScript support and modern build tools.
Quick Start
npm create botpress-actions@latest my-project
# or
pnpm create botpress-actions@latest my-project
# or
yarn create botpress-actions my-projectFeatures
- 🚀 Quick setup - Interactive CLI with sensible defaults
- 📦 Two templates - Minimal starter or full Pokemon API example
- 🔧 Pre-configured - TypeScript, Vite, and Deno ready to use
- 📝 Best practices - Includes CLAUDE.md for AI assistance
- 🎯 Production ready - Build system optimized for Botpress deployment
Templates
Minimal (Recommended)
Clean starter template with:
- One example action
- Basic project structure
- Essential configuration files
Pokemon Example
Full-featured template demonstrating:
- Multiple actions with shared code
- API integration patterns
- Complex schema definitions
- Testing examples
CLI Options
create-botpress-actions [project-name] [options]| Option | Description | Default |
|--------|-------------|---------|
| -t, --template <template> | Template to use (minimal or pokemon) | Interactive prompt |
| --no-git | Skip git initialization | Git enabled |
| --no-install | Skip dependency installation | Install enabled |
| -p, --package-manager <pm> | Package manager (pnpm, npm, yarn) | pnpm |
Project Structure
Generated projects include:
my-project/
├── src/
│ ├── actions/ # Your Botpress actions
│ ├── schemas/ # Reusable schemas
│ └── shared/ # Shared utilities
├── test/ # Deno test files
├── scripts/ # Helper scripts
├── vite.config.ts # Build configuration
├── tsconfig.json # TypeScript config
├── deno.json # Deno runtime config
├── package.json # Dependencies
├── CLAUDE.md # AI assistance guide
└── README.md # Project documentationDevelopment Workflow
After creating your project:
cd my-project
pnpm install # Install dependencies (if not done)
pnpm dev # Start development (watch mode)
pnpm build # Build for production
pnpm test # Run Deno testsBuilding Actions
- Create actions in
src/actions/ - Define schemas using Zod (
@bpinternal/zui) - Run
pnpm buildto generate Botpress-compatible code - Copy from
dist/to Botpress Studio
Example action:
// src/actions/greet.ts
import { z } from '@bpinternal/zui';
const inputSchema = z.object({
name: z.string()
});
const outputSchema = z.object({
message: z.string()
});
export async function greet(input: z.infer<typeof inputSchema>) {
return { message: `Hello, ${input.name}!` };
}Requirements
- Node.js 18+
- pnpm, npm, or yarn
- Deno (for testing)
License
MIT
