Skip to main content
This is the default command — you can omit the word create and pass the directory directly.
npx @chat-js/cli@latest create [directory] [options]
npx @chat-js/cli@latest [directory] [options]

Arguments

ArgumentDescription
directoryTarget directory for the project. Prompted interactively if omitted.

Options

FlagDefaultDescription
-y, --yesfalseSkip all prompts and use defaults (Vercel gateway, GitHub auth, no extra features).
--no-installSkip automatic dependency installation.
--from-git <url>Clone from a git repository instead of the built-in template.

Interactive prompts

When run without --yes, the CLI walks you through:
  1. Project name — the target directory name
  2. Gateway — the AI gateway to use (e.g. Vercel AI Gateway, OpenRouter)
  3. Features — optional features to enable (e.g. web search, image generation)
  4. Auth providers — authentication method (e.g. GitHub OAuth)
  5. Install dependencies — whether to run the package manager automatically
The CLI auto-detects your package manager from the npm_config_user_agent environment variable (npm, pnpm, yarn, or bun).

What gets generated

The create command copies the built-in template and writes a tailored chat.config.ts with your selections pre-filled:
my-app/
├── app/                    # Next.js App Router pages and layouts
│   ├── (auth)/             # Auth-related routes
│   ├── (chat)/             # Chat interface routes
│   ├── api/                # API route handlers
│   └── layout.tsx
├── components/             # Shared UI components
├── hooks/                  # React hooks
├── lib/                    # Core logic (AI, auth, DB, config schema)
├── providers/              # React context providers
├── trpc/                   # tRPC router
├── chat.config.ts          # Your app configuration (generated)
├── drizzle.config.ts       # Database schema config
├── next.config.ts
├── package.json
└── tsconfig.json
After scaffolding, the CLI prints the exact environment variables required for your chosen configuration.

Examples

Interactive setup (recommended)
npx @chat-js/cli@latest create my-chat-app
Skip prompts, use all defaults
npx @chat-js/cli@latest create my-chat-app --yes
Create without installing dependencies
npx @chat-js/cli@latest create my-chat-app --no-install
Clone from a custom git repository
npx @chat-js/cli@latest create my-chat-app --from-git https://github.com/your-org/your-fork
Full flow after scaffolding
npx @chat-js/cli@latest create my-chat-app
cd my-chat-app
cp .env.example .env.local
# Fill in the env vars printed by the CLI
npm run db:push
npm run dev