CLI tool to scaffold new Captify plugin applications.
npx create-captify-app my-app
Or with prompts:
npx create-captify-app
You'll be prompted for:
- App name: Lowercase with dashes (e.g.,
my-captify-app
) - Port number: Development port (default: 3002)
- Description: Brief app description
From your app directory:
npx create-captify-app upgrade
Select which configuration files to update from the latest template.
The CLI creates a minimal Captify plugin app with:
package.json
- Dependencies and scriptsnext.config.ts
- Next.js configuration with basePathtsconfig.json
- TypeScript configurationpostcss.config.cjs
- PostCSS with Tailwind v4.gitignore
- Standard Next.js ignore patterns.env.example
- Environment variable template
src/config.ts
- App configuration and menu structuresrc/app/layout.tsx
- Root layout with auth and Captify providerssrc/app/page.tsx
- Home page componentsrc/app/globals.css
- Global styles with Tailwind imports
Apps created with this CLI follow the Captify plugin architecture:
- Authentication: Delegates to platform (port 3000) via cross-origin cookies
- AWS Services: Proxies requests through platform's
/api/captify
endpoint - Independent Deployment: Each plugin runs on its own port and domain
- ✅ Minimal setup - only essential files for deployment
- ✅ No build artifacts - uses Next.js server-side rendering
- ✅ Tailwind CSS v4 with
@captify-io/core
themes - ✅ TypeScript support
- ✅ Hash-based routing via
HashRouter
- ✅ Session management with NextAuth.js
After creating your app:
cd my-app
npm install
npm run dev
App will run on the configured port (default: 3002).
Important: Platform must be running on port 3000 for authentication.
Copy .env.example
to .env
and configure:
# Platform URL (required for auth)
NEXT_PUBLIC_CAPTIFY_URL=http://localhost:3000
# NextAuth config (must match platform)
NEXTAUTH_URL=http://localhost:3000
NEXTAUTH_SECRET=your-secret-key
# AWS config (optional)
COGNITO_IDENTITY_POOL_ID=
BEDROCK_AGENT_ID=
BEDROCK_AGENT_ALIAS_ID=
npm run dev
npm run build
npm start
Apps are typically deployed to AWS Elastic Beanstalk with Nginx reverse proxy routing by subdomain.
The CLI supports selective upgrades:
- Run
npx create-captify-app upgrade
from app directory - Select files to update (preserves custom code)
- Safe files to upgrade:
next.config.ts
tsconfig.json
postcss.config.cjs
src/app/globals.css
.gitignore
Note: package.json
, src/config.ts
, and page files are NOT upgraded to preserve customizations.
MIT