gb init
Initialize Genbox configuration for your project.
Synopsis
gb init [options]Description
Creates a genbox.yaml configuration file for your project. Scans your project structure to detect apps, frameworks, and infrastructure, then generates appropriate configuration.
Options
| Option | Description |
|---|---|
--guided | Interactive step-by-step mode |
--quick | Minimal config with auto-detection |
--from-scan | Use detected values from gb scan |
--template <name> | Start from a template |
-y, --yes | Accept all defaults |
Examples
Interactive Mode (Default)
gb initWalks through each section interactively.
Guided Mode
gb init --guidedDetailed step-by-step with explanations.
Quick Mode
gb init --quickGenerates minimal config with $detect markers.
From Scan
# First scan the project
gb scan
# Then initialize from detected values
gb init --from-scanInit Process
- Project Scan: Analyzes directory structure
- App Detection: Finds apps, frameworks, ports
- Infrastructure: Detects from docker-compose
- Profile Generation: Creates recommended profiles
- File Creation: Writes
genbox.yaml
Example Output
Scanning project structure...
? Project name: myproject
? Project structure: (detected: monorepo)
â—‹ single-app
â—Ź monorepo
â—‹ workspace
Found 3 apps:
=== admin ===
? Type: (detected: frontend)
? Port: (detected: 3001) [Enter to accept]
? Framework: (detected: react)
=== api ===
? Type: (detected: backend)
? Port: (detected: 3050) [Enter to accept]
? Framework: (detected: nestjs)
=== web ===
? Type: (detected: frontend)
? Port: (detected: 3000) [Enter to accept]
? Framework: (detected: nextjs)
Found infrastructure:
âś“ mongodb (mongo:7, port 27017)
âś“ redis (redis:7-alpine, port 6379)
Generating profiles...
• admin-quick: Admin → staging backend
• full-stack: All apps + local database
• api-only: Backend services only
Created: genbox.yaml
Run 'gb create' to spin up an environment!Generated File
The init command creates a complete genbox.yaml:
version: 4
project:
name: myproject
structure: monorepo
apps:
admin:
path: admin/
type: frontend
port: 3001
framework: react
api:
path: api/
type: backend
port: 3050
framework: nestjs
web:
path: web/
type: frontend
port: 3000
framework: nextjs
provides:
mongodb:
type: database
image: mongo:7
port: 27017
redis:
type: cache
image: redis:7-alpine
port: 6379
profiles:
admin-quick:
size: small
apps: [admin]
default_connection: staging
full-stack:
size: large
apps: [admin, api, web]
default_connection: localNotes
- Run from project root directory
- Existing
genbox.yamlwill be backed up - Use
--guidedfor learning the schema - Review generated config before using
See Also
gb scan- Scan without creating configgb validate- Validate configurationgb config- Inspect configuration
Last updated on