CLI
Commands & Flags
The koko init Command
The primary command to scaffold a new workspace on your local machine:
Syntax: `koko init [project-name] [flags]`
koko init my-project Complete Flags Reference
All supported flags for automating project generation without interactive prompts:
- -d, --default - Instantly bootstraps using the default recipe (SaaS Starter with Next.js + Drizzle + Better-Auth).
- -r, --recipie <name> - Chooses a production blueprint recipe: saas, pern, mern, fastapi_react, enterprise_nestjs, java_spring, mobile_expo.
- -f, --frontend <framework> - Frontend framework: nextjs, react, nuxt, svelte, astro, native, none.
- -b, --backend <runtime> - Backend runtime: express, hono, fastapi, go_chi, spring_boot, nestjs, self, none.
- --api <layer> - Typed API layer: trpc, orpc, none.
- -p, --package-manager <pm> - Package manager: pnpm, npm, bun, go_mod, pip, uv, mvn, gradle.
- --database <engine> - Database server: postgres, mongodb, mysql, sqlite, none.
- --orm <tool> - ORM or query tool: drizzle, prisma, mongoose, sqlalchemy, gorm, jpa, none.
- --auth <provider> - Authentication provider: better-auth, clerk, next-auth, none.
- --addons <tools> - Comma-separated addons: shadcn, lucide, svgl, motion, stripe, polar, resend, brevo, zod, docker, github_actions.
- --git <yes|no> - Initialize local Git repository (default: no in headless CLI mode).
CI/CD & Scripting Examples
Integrate Koko CLI into bash scripts, Makefiles, or CI/CD pipelines for automated scaffolding:
The koko doctor Command
Diagnoses project architecture, detects discrepancies and drift against koko.config.json, and synchronizes manifest automatically. For an extensive deep-dive with CI/CD recipes, explore our dedicated Diagnostics guide.
✓ 1-Click Manifest Healing: Run --fix to update configuration and align dependency versions.
✓ Early Conflict Detection: Identifies Docker database port clashes and outdated packages before compilation.
- -f, --fix - Automatically apply detected fixes and update koko.config.json.
- -d, --dir <path> - Target project directory to analyze (default: .).
- -v, --verbose - Output comprehensive diagnostic trace for each module.
- --json - Structured machine-readable output for automated CI/CD pipelines.
# Run project diagnostics
koko doctor
# Diagnose and auto-repair koko.config.json
koko doctor --fix The koko version Command
Prints detailed build information, semantic version, operating system, architecture, and Go runtime version:
koko version