Visual Builder
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]`

Terminal
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:

Scaffold Complete MERN Stack

Scaffold a monorepo with React SPA, Express TS API, MongoDB, and Docker Compose:

Terminal
koko init app-mern -r mern

Scaffold FastAPI + React Vite

Scaffold React client and Python FastAPI backend with async support:

Terminal
koko init app-python -r fastapi_react

Scaffold Pure Go Chi REST API

Scaffold a modular Go backend with PostgreSQL and GORM:

Terminal
koko init api-go -f none -b go_chi --database postgres --orm gorm -p go_mod

Dynamic Addon Injection (koko add)

The `koko add <addon>` subcommand allows you to inject payment, authentication, email, or UI services into an existing Koko workspace weeks or months after creation, without manual wiring.

✓ Context & Idempotency Check: Koko inspects the local `koko.config.json` manifest. If the service is already configured, it alerts you gracefully without duplicating code.
✓ Official Dependencies Catalog: Queries Koko Master Catalog and installs exact versions in the appropriate workspace (`apps/web`, `apps/api`, or root).
✓ Safe Environment Injection (.env): Safely appends required secret and publishable keys to `.env` and `.env.example` without overwriting existing variables.
  • stripe - Global payment processing with Stripe (injects STRIPE_SECRET_KEY and NEXT_PUBLIC_STRIPE_PUBLISHABLE_KEY).
  • polar - Developer-first payment integration with Polar.sh.
  • resend - Transactional email delivery powered by Resend SDK.
  • brevo - Marketing and transactional email engine with Brevo.
  • shadcn - Base UI component primitives and Tailwind CSS utilities.
  • lucide - Official Lucide Icons icon pack.
  • zod - Strict runtime validation and type-safety with Zod.
  • docker - Containerized developer infrastructure via docker-compose.yml.
  • github_actions - CI/CD pipeline workflows for linting, testing, and integrity checks.
Terminal
# Example: Inject Stripe payments into an existing project koko add stripe # Example: Add transactional email service with Resend koko add resend # Example: Incorporate shadcn/ui components koko add shadcn

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.

Terminal
# 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:

Terminal
koko version