CLI Tools
The @guidekit/cli package provides command-line tools for project setup and diagnostics.
Installation
The CLI is available via npx (no installation needed):
npx guidekit <command>Or install globally:
npm install -g @guidekit/cliCommands
guidekit init
Interactive setup wizard that scaffolds GuideKit configuration for your project.
npx guidekit init
npx guidekit init --platformWhat it does:
- Detects your framework (Next.js App Router, Pages Router, React)
- Checks for missing packages
- Creates
.env.localwith GuideKit variables - For Next.js App Router + token auth: creates
lib/guidekit-routes.tsand/api/guidekit/{token,llm,health}routes - With
--platform: also scaffolds STT/TTS routes and Platform Mode provider props - Creates a provider wrapper component (Next.js App Router)
- Optionally patches
layout.tsxto importProviders
Options:
--yes— Skip prompts and use defaults--platform— Enable Platform Mode (RAG, plugins, intelligence)--auth-mode token|direct— Proxy auth mode (default:token)--json— Output the scaffold result as JSON (implies--yes)
npx guidekit init --yes --platform
npx guidekit init --yes --auth-mode direct --jsonguidekit doctor
Validates your setup — checks environment variables, packages, proxy route files, provider wiring, local endpoints (when the dev server is running), external provider connectivity, and, when run inside the GuideKit monorepo, CI/local parity for the example app and release-confidence workflows.
npx guidekit doctor
npx guidekit doctor --fix
npx guidekit doctor --jsonWhen run interactively, doctor will offer to apply safe fixes (create .env.local, generate a GUIDEKIT_SECRET, add .env to .gitignore, scaffold missing proxy routes, and wire the provider into layout.tsx). Use --fix to apply them without prompting, or --json to get machine-readable output.
Checks performed:
.env/.env.localfile exists.gitignoreincludes.envfilesGUIDEKIT_SECRETis set and valid lengthLLM_API_KEYis presentSTT_API_KEYandTTS_API_KEY(optional, for voice)@guidekit/core,@guidekit/react,@guidekit/serverare installed- Proxy route files and
layout.tsxprovider wiring (Next.js App Router) - Local
/api/guidekit/tokenand/api/guidekit/health(warns if dev server is not running) - Connectivity to Google AI, Deepgram, and ElevenLabs APIs
- In the GuideKit monorepo, example-app token-route parity, hosted PR E2E coverage, and the Nightly dependency-audit gate
Example output:
GuideKit Doctor — Checking your setup
ℹ Project root: /Users/you/myapp
Environment
✓ .env file: Found .env.local
✓ .gitignore: .env files are ignored
✓ GUIDEKIT_SECRET: Set and valid length
✓ LLM API Key: Found
○ STT API Key: Not set (optional)
○ TTS API Key: Not set (optional)
Packages
✓ @guidekit/core: Installed (^0.1.0)
✓ @guidekit/react: Installed (^0.1.0)
✓ @guidekit/server: Installed (^0.1.0)
Connectivity
✓ LLM provider connectivity: Reachable
✓ STT provider connectivity: Reachable
✓ TTS provider connectivity: Reachable
✓ All checks passed! Your GuideKit setup looks good.guidekit generate-secret
Generates a cryptographically random 256-bit signing secret for JWT token authentication.
npx guidekit generate-secret
npx guidekit generate-secret --write-env
npx guidekit generate-secret --write-env --copy
npx guidekit generate-secret --jsonWhen run interactively, the command can write GUIDEKIT_SECRET directly to .env.local and copy it to the clipboard. Use --write-env and --copy to do this without prompting, or --json to get machine-readable output.
Output:
GuideKit — Generate Signing Secret
✓ Generated a cryptographically random 256-bit signing secret:
SIIwq8fzeBsh1s5WTTMBZEiXcxU5BH51A0ScD5ORVvQ
✓ Saved GUIDEKIT_SECRET to /Users/you/myapp/.env.local
Warning: Keep this secret safe. Never commit it to version control.Interactive menu
Running npx guidekit without a command in an interactive terminal opens a menu so you can pick a command instead of typing it:
npx guidekitIn CI or non-TTY environments, the same command prints the help text below.
Help
npx guidekit --help
npx guidekit --version