@forinda/kickjs-cli 3.2.0 → 4.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -1,15 +1,14 @@
1
1
  # @forinda/kickjs-cli
2
2
 
3
- CLI for KickJS — project scaffolding, DDD module generation, dev/build/start commands.
3
+ CLI for KickJS — project scaffolding, DDD module generators, dev/build/start commands.
4
4
 
5
5
  ## Install
6
6
 
7
7
  ```bash
8
- # Using the KickJS CLI (recommended — installs as dev dependency)
9
- kick add cli
10
-
11
- # Manual install
12
8
  pnpm add -D @forinda/kickjs-cli
9
+
10
+ # or scaffold a fresh project
11
+ npx @forinda/kickjs-cli new my-api
13
12
  ```
14
13
 
15
14
  ## Commands
@@ -19,100 +18,24 @@ kick new <name> # Scaffold a new KickJS project
19
18
  kick dev # Start dev server with Vite HMR
20
19
  kick build # Production build via Vite
21
20
  kick start # Run production build
22
- kick info # Print system and framework info
23
21
 
24
- kick g module <names...> # Generate one or more DDD modules
25
- kick g scaffold <name> # Generate CRUD module from field definitions
26
- kick g controller <name> # Generate controller
27
- kick g service <name> # Generate service
28
- kick g middleware <name> # Generate middleware
29
- kick g guard <name> # Generate auth guard
30
- kick g adapter <name> # Generate lifecycle adapter
31
- kick g dto <name> # Generate DTO with Zod schema
22
+ kick g module <name> # Generate a full DDD module
23
+ kick g scaffold <name> <fields…> # CRUD module from field definitions
24
+ kick g controller|service|middleware|guard|adapter|dto <name>
32
25
 
33
- kick rm module <names...> # Remove one or more modules
26
+ kick rm module <name> # Remove a module
34
27
  kick add <pkg> # Install a KickJS package + peers
35
28
  kick add --list # Show all available packages
36
- ```
37
-
38
- ## Interactive Project Scaffolding
39
-
40
- `kick new` uses [@clack/prompts](https://github.com/natemoo-re/clack) for a rich interactive experience with colored output:
41
-
42
- - **Template selection** — REST, GraphQL, DDD, CQRS, Minimal
43
- - **Package manager** — pnpm, npm, yarn
44
- - **Repository/ORM** — Prisma, Drizzle, In-Memory, Custom
45
- - **Multi-select packages** — auth, swagger, otel, ws, queue, cron, mailer, graphql, devtools, notifications, multi-tenant
46
- - **Git init + dependency install** confirmations
47
-
48
- Selected packages are automatically wired into the generated `package.json` dependencies and `src/index.ts` adapter registrations.
49
-
50
- All prompts can be skipped with flags for CI/scripting:
51
-
52
- ```bash
53
- kick new my-api --template rest --pm pnpm --repo prisma \
54
- --packages auth,swagger,otel --no-git --no-install
55
- ```
56
-
57
- ## Generator Flags
58
-
59
- ```bash
60
- kick g module users --no-entity # Skip entity/value objects
61
- kick g module users --no-tests # Skip test files
62
- kick g module users --minimal # Only index.ts + controller
63
- kick g module users --dry-run # Preview without writing
64
- kick g module users --repo prisma # Use Prisma repository (working code)
65
- kick g module users --repo drizzle # Use Drizzle repository (working code)
66
- kick g module users --no-pluralize # Singular names: src/modules/user/
67
- ```
68
-
69
- ## Repository Types
70
-
71
- The `--repo` flag or `defaultRepo` config controls the generated repository implementation:
72
29
 
73
- | Type | File | Code |
74
- |------|------|------|
75
- | `inmemory` (default) | `in-memory-{name}.repository.ts` | Working Map-based store |
76
- | `drizzle` | `drizzle-{name}.repository.ts` | Working Drizzle ORM queries |
77
- | `prisma` | `prisma-{name}.repository.ts` | Working Prisma Client queries |
78
- | `{ name: 'custom' }` | `custom-{name}.repository.ts` | In-memory stub with TODO markers |
79
-
80
- Custom repo types accept any string and generate a stub repository with the correct class/file naming:
81
-
82
- ```bash
83
- kick g module user --repo typeorm # → typeorm-user.repository.ts, TypeormUserRepository
84
- kick g module user --repo mongoose # → mongoose-user.repository.ts, MongooseUserRepository
30
+ kick mcp start # Run app as an MCP stdio server
31
+ kick typegen # Refresh KickRoutes / KickEnv type maps
85
32
  ```
86
33
 
87
- ## Configuration
88
-
89
- Configure defaults in `kick.config.ts`:
90
-
91
- ```typescript
92
- import { defineConfig } from '@forinda/kickjs-cli'
93
-
94
- export default defineConfig({
95
- pattern: 'ddd',
96
-
97
- // Module generation settings
98
- modules: {
99
- dir: 'src/modules',
100
- repo: 'prisma', // built-in: 'drizzle' | 'inmemory' | 'prisma'
101
- // repo: { name: 'typeorm' }, // custom ORM
102
- pluralize: true, // set false for singular module names
103
- schemaDir: 'prisma/', // schema output directory
104
- },
105
-
106
- commands: [
107
- { name: 'db:migrate', description: 'Run migrations', steps: 'npx prisma migrate dev' },
108
- { name: 'db:seed', description: 'Seed database', steps: 'npx prisma db seed' },
109
- ],
110
- })
111
- ```
34
+ `kick new` is interactive (template, package manager, ORM, package multi-select, git init, install) — every prompt has a flag for CI: `--template rest|graphql|ddd|cqrs|minimal`, `--pm pnpm|npm|yarn`, `--repo prisma|drizzle|inmemory|custom`, `--no-git`, `--no-install`, `--force`.
112
35
 
113
36
  ## Documentation
114
37
 
115
- [Full documentation](https://forinda.github.io/kick-js/guide/generators)
38
+ [forinda.github.io/kick-js/guide/cli-commands](https://forinda.github.io/kick-js/guide/cli-commands) — every command + flag, custom commands via `kick.config.ts`, generator architecture.
116
39
 
117
40
  ## License
118
41