genbox.yaml Schema
Complete reference for the genbox.yaml configuration file.
Version
version: 4The schema version. Currently only version 4 is supported.
Project
Required project metadata:
project:
name: myapp # Required: Project name
description: My application # Optional: Description
structure: monorepo # Required: Project structureStructure Types
| Value | Description |
|---|---|
single-app | Single application |
monorepo | Multiple apps in one repo |
workspace | pnpm/npm/yarn workspace |
microservices | Multiple repos |
hybrid | Mix of structures |
Apps
Define your applications:
apps:
frontend:
path: ./web # Required: Relative path
type: frontend # Required: App type
port: 3000 # Port (or $detect)
framework: nextjs # Framework (or $detect)
runner: pm2 # How to run: pm2, docker, node
description: Customer website
commands: # Build/run commands
install: pnpm install
dev: pnpm dev
build: pnpm build
start: pnpm start
connects_to: # Dependencies
api:
mode: local # local, staging, production
env:
NEXT_PUBLIC_API_URL: http://localhost:3050
env: # Env var files to load
- .env
- .env.localApp Types
| Type | Description |
|---|---|
frontend | Client-side application |
backend | Server-side application |
worker | Background worker |
gateway | API gateway |
library | Shared library (not runnable) |
fullstack | Full-stack application |
Runners
| Runner | Description |
|---|---|
pm2 | Process manager (default) |
docker | Via docker-compose |
node | Direct node execution |
bun | Bun runtime |
none | Not runnable (library) |
Provides (Infrastructure)
Define infrastructure services:
provides:
mongodb:
type: database
image: mongo:7
port: 27017
data_dir: /data/db # Optional: Data directory
env: # Container env vars
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: secret
redis:
type: cache
image: redis:7-alpine
port: 6379
rabbitmq:
type: queue
image: rabbitmq:3-management
port: 5672
additional_ports:
management: 15672Infrastructure Types
| Type | Description |
|---|---|
database | Database service |
cache | Caching service |
queue | Message queue |
storage | Object storage |
search | Search engine |
email | Email service |
custom | Custom service |
Environments
Define external environment connections:
environments:
staging:
description: Staging environment
urls:
api: https://api.staging.example.com
admin: https://admin.staging.example.com
env:
MONGODB_URI: ${STAGING_MONGODB_URI}
production:
description: Production (read-only)
urls:
api: https://api.example.com
safety:
read_only: true
require_confirmation: trueProfiles
Define environment configurations:
profiles:
quick:
description: Frontend only, staging backend
size: small
apps:
- frontend
default_connection: staging
full:
description: Full stack with local DB
extends: quick # Inherit from another profile
size: large
apps:
- frontend
- backend
default_connection: local
database:
mode: copy
source: staging
exclude:
- logs
- sessions
api-dev:
description: Backend development
size: medium
apps:
- backend
connections:
backend:
mongodb: local
redis: stagingDatabase Modes
| Mode | Description |
|---|---|
none | No database |
local | Empty local database |
copy | Copy from source environment |
snapshot | Restore from backup |
remote | Connect to remote database |
Server Sizes
| Size | vCPU | RAM | Credits/Hour |
|---|---|---|---|
small | 2 | 4 GB | 1 |
medium | 4 | 8 GB | 2 |
large | 8 | 16 GB | 4 |
xl | 16 | 32 GB | 8 |
Defaults
Set default values:
defaults:
size: medium
branch: main
database:
mode: copy
source: staging
connection_mode: local
install_claude_code: true
inject_claude_auth: trueHooks
Lifecycle hooks:
hooks:
post_checkout:
- command: pnpm install
workdir: ${APP_PATH}
post_create:
- command: ./scripts/setup.sh
run_as: root
pre_start:
- command: pnpm build
workdir: /home/dev/myapp/web
post_start:
- command: docker-compose up -d
workdir: /home/dev/myapp/api
condition: apps.api
pre_destroy:
- command: ./scripts/cleanup.shRepos
Multi-repository configuration:
repos:
main:
url: git@github.com:org/main.git
path: /home/dev/myapp
branch: main
apps:
- frontend
- backend
shared:
url: git@github.com:org/shared-libs.git
path: /home/dev/shared
branch: main
git_auth:
method: ssh # ssh or token
ssh_key_path: ~/.ssh/id_rsaStrict Mode
Enable strict validation:
strict:
enabled: true
allow_detect: true # Allow $detect markers
warnings_as_errors: false # Treat warnings as errorsComplete Example
See the examples directory for complete configuration examples.
Last updated on