1.0.0 • Published yesterdayCLI
create-ai-cursor
Licence
MIT
Version
1.0.0
Deps
4
Size
210 kB
Vulns
0
Weekly
0
create-ai-cursor
A professional CLI generator that scaffolds a complete .cursor/ AI infrastructure for frontend and backend projects.
What This CLI Does
create-ai-cursor generates a tailored Cursor AI setup including:
- Rules — Project coding standards (
.mdcfiles) - Skills — Step-by-step agent workflows (
SKILL.mdfiles) - Agents — Specialized AI personas for architecture, review, and domain expertise
- Commands — Reusable slash command templates
Each preset is customized based on your interactive answers (framework, styling, database, ORM, etc.).
Installation
# Run directly with npx (no install required)
npx create-ai-cursor
# Or install globally
npm install -g create-ai-cursor
# Or use locally in this repo
pnpm install
pnpm build
pnpm link --global
Usage
# Interactive — choose preset and answer questions
create-ai-cursor
# Frontend preset
create-ai-cursor frontend
npx create-ai-cursor frontend
# Backend preset
create-ai-cursor backend
npx create-ai-cursor backend
# Non-interactive with defaults (useful for CI/testing)
create-ai-cursor frontend --defaults
create-ai-cursor backend --defaults
Run the command from your project root. It creates a .cursor/ directory in the current working directory.
Examples
# Generate frontend Cursor setup for a Next.js project
cd my-next-app
npx create-ai-cursor frontend
# Generate backend Cursor setup for an Express API
cd my-api
npx create-ai-cursor backend
Frontend Preset
Interactive questions:
| Question | Options |
|---|---|
| Project name | Free text |
| Framework | React / Next.js |
| Styling | Tailwind / CSS Modules / Styled Components |
| State management | React Query + Zustand / Redux Toolkit / None |
| Testing | Vitest + Testing Library / Playwright / Both / None |
Generated Files
.cursor/
├── rules/
│ ├── typescript.mdc
│ ├── react.mdc
│ ├── architecture.mdc
│ ├── accessibility.mdc
│ ├── performance.mdc
│ ├── testing.mdc
│ ├── documentation.mdc
│ └── context7.mdc
├── skills/
│ ├── create-feature/SKILL.md
│ ├── refactor-component/SKILL.md
│ ├── code-review/SKILL.md
│ ├── accessibility-audit/SKILL.md
│ ├── performance-audit/SKILL.md
│ └── testing-strategy/SKILL.md
├── agents/
│ ├── frontend-architect.md
│ ├── react-expert.md
│ ├── typescript-expert.md
│ ├── performance-reviewer.md
│ ├── accessibility-reviewer.md
│ └── code-reviewer.md
└── commands/
├── feature.md
├── review.md
├── refactor.md
├── test.md
└── docs.md
Backend Preset
Interactive questions:
| Question | Options |
|---|---|
| Project name | Free text |
| Runtime | Node.js / Bun |
| Framework | Express / Fastify / NestJS |
| Database | PostgreSQL / MongoDB / MySQL / None |
| ORM | Prisma / Drizzle / TypeORM / None |
| Auth | JWT / Session / OAuth / None |
| Testing | Vitest / Jest / Supertest / None |
Generated Files
.cursor/
├── rules/
│ ├── typescript.mdc
│ ├── backend-architecture.mdc
│ ├── api-design.mdc
│ ├── database.mdc
│ ├── security.mdc
│ ├── error-handling.mdc
│ ├── testing.mdc
│ ├── documentation.mdc
│ └── context7.mdc
├── skills/
│ ├── create-endpoint/SKILL.md
│ ├── database-migration/SKILL.md
│ ├── api-review/SKILL.md
│ ├── security-review/SKILL.md
│ ├── debugging/SKILL.md
│ └── testing-strategy/SKILL.md
├── agents/
│ ├── backend-architect.md
│ ├── api-expert.md
│ ├── database-expert.md
│ ├── security-reviewer.md
│ ├── testing-expert.md
│ └── code-reviewer.md
└── commands/
├── endpoint.md
├── review-api.md
├── migration.md
├── debug.md
└── test.md
Context7 Integration
Both presets include a context7.mdc rule that instructs the AI to:
- Use Context7 MCP for latest official documentation
- Not rely solely on model memory for external library APIs
- Verify APIs for React, Next.js, TypeScript, React Query, Tailwind, Prisma, Drizzle, Express, Fastify, and NestJS
Safety and Overwrite Behavior
- Existing files are never overwritten by default
- When a file exists, you are prompted to: Skip, Overwrite, or Overwrite all remaining
- A final summary shows all created, overwritten, and skipped files
Development Commands
# Install dependencies
pnpm install
# Run CLI in development (with tsx)
pnpm dev frontend
pnpm dev backend
# Build for production
pnpm build
# Run built CLI
pnpm start frontend
Project Structure
src/
├── cli.ts
├── types.ts
├── presets/
│ ├── frontend.ts
│ └── backend.ts
├── generators/
│ ├── copyTemplateFiles.ts
│ ├── generateRules.ts
│ ├── generateSkills.ts
│ ├── generateAgents.ts
│ ├── generateCommands.ts
│ └── generateCursorSetup.ts
├── templates/
│ ├── frontend/
│ └── backend/
└── utils/
├── applyTemplate.ts
├── ensureDir.ts
├── writeFileSafe.ts
└── logger.ts
Tech Stack
- TypeScript (strict mode)
- Node.js (ESM)
- commander — CLI argument parsing
- prompts — Interactive questions
- fs-extra — File system operations
- chalk — Terminal styling
- tsx — Development execution
License
MIT