kaven-cli 0.3.0 → 0.3.5

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,13 +1,17 @@
1
1
  # Kaven CLI
2
2
 
3
+ > 📖 Versão em Português: [README.pt-BR.md](./README.pt-BR.md)
4
+
5
+ [![npm version](https://img.shields.io/npm/v/kaven-cli/alpha.svg)](https://www.npmjs.com/package/kaven-cli)
6
+ [![npm downloads](https://img.shields.io/npm/dm/kaven-cli.svg)](https://www.npmjs.com/package/kaven-cli)
3
7
  [![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0)
4
- [![Version](https://img.shields.io/badge/version-0.2.0--alpha.1-orange.svg)](https://semver.org)
5
8
  [![Node](https://img.shields.io/badge/node-%3E%3D20-brightgreen.svg)](https://nodejs.org)
9
+ [![CI](https://github.com/kaven-co/kaven-cli/actions/workflows/ci.yml/badge.svg)](https://github.com/kaven-co/kaven-cli/actions/workflows/ci.yml)
6
10
 
7
- The official command-line tool for the **Kaven** SaaS boilerplate ecosystem.
8
- Bootstrap projects, manage modules, and interact with the Kaven Marketplace.
11
+ The official command-line tool for the [Kaven](https://kaven.site) SaaS boilerplate framework.
12
+ Bootstrap projects, manage modules, and interact with the Kaven Marketplace — all from your terminal.
9
13
 
10
- > **Alpha**: APIs and commands are subject to change before v1.0.0.
14
+ > **Alpha:** APIs and commands may change before v1.0.0.
11
15
 
12
16
  ---
13
17
 
@@ -19,16 +23,14 @@ npm install -g kaven-cli@alpha
19
23
  pnpm add -g kaven-cli@alpha
20
24
  ```
21
25
 
22
- **Requirements:** Node.js >= 20, pnpm (for `kaven init`)
26
+ **Requirements:** Node.js >= 20, pnpm (required by `kaven init`)
23
27
 
24
28
  ---
25
29
 
26
30
  ## Quick Start
27
31
 
28
- Five commands to get productive with Kaven:
29
-
30
32
  ```bash
31
- # 1. Bootstrap a new project
33
+ # 1. Bootstrap a new Kaven project
32
34
  kaven init my-saas-app
33
35
 
34
36
  # 2. Authenticate with the marketplace
@@ -54,10 +56,11 @@ Bootstrap a new Kaven project from the official template.
54
56
 
55
57
  ```
56
58
  Options:
57
- --defaults Skip interactive prompts and use default values
58
- --skip-install Skip running pnpm install after setup
59
+ --defaults Skip interactive prompts, use defaults
60
+ --skip-install Skip pnpm install after setup
59
61
  --skip-git Skip git init and initial commit
60
62
  --force Overwrite existing directory
63
+ --with-squad Initialize AIOX squad in the project
61
64
 
62
65
  Examples:
63
66
  kaven init my-app
@@ -65,17 +68,21 @@ Examples:
65
68
  kaven init my-app --skip-git --skip-install
66
69
  ```
67
70
 
71
+ ---
72
+
68
73
  ### `kaven auth`
69
74
 
70
- Manage authentication and session tokens.
75
+ Manage authentication with the Kaven Marketplace.
71
76
 
72
77
  ```
73
78
  Commands:
74
- login Start device code authentication flow (RFC 8628)
75
- logout Clear the local authentication session
76
- whoami Display info about the authenticated user
79
+ login Start device code flow (RFC 8628) — opens browser to confirm
80
+ logout Clear the local session
81
+ whoami Display the authenticated user info
77
82
  ```
78
83
 
84
+ ---
85
+
79
86
  ### `kaven marketplace`
80
87
 
81
88
  Explore and install modules from the Kaven Marketplace.
@@ -83,117 +90,148 @@ Explore and install modules from the Kaven Marketplace.
83
90
  ```
84
91
  Commands:
85
92
  list List available modules
86
- install Install a module
87
- browse Interactive TUI module browser
93
+ install Download and apply a module to the current project
94
+ browse Interactive TUI browser
88
95
 
89
- Options for list:
96
+ Options (list):
90
97
  --category <cat> Filter by category
91
- --sort <field> Sort: newest (default), popular, name
98
+ --sort <field> newest (default) | popular | name
92
99
  --page <n> Page number
93
- --limit <n> Results per page (max: 100)
94
- --json Output raw JSON
100
+ --limit <n> Results per page (max 100)
101
+ --json Raw JSON output
95
102
 
96
- Options for install:
97
- --version <ver> Install specific version
103
+ Options (install):
104
+ --version <ver> Install a specific version
98
105
  --force Skip overwrite confirmation
99
106
  --skip-env Skip .env injection
100
- --env-file <path> Target .env file
107
+ --env-file <path> Target .env file path
101
108
  ```
102
109
 
110
+ ---
111
+
103
112
  ### `kaven module`
104
113
 
105
- Manage installed modules.
114
+ Manage modules installed in the current project.
106
115
 
107
116
  ```
108
117
  Commands:
109
- doctor Run health checks on the project and modules
118
+ doctor Run health checks on the project and installed modules
110
119
  add Install a module from a local manifest
111
- remove Remove an installed module
120
+ remove Uninstall an installed module
112
121
  publish Publish a module to the marketplace
113
122
 
114
- Options for doctor:
115
- --fix Auto-fix detected issues (pnpm install, prisma generate, env vars)
116
- --json Output machine-readable JSON
123
+ Options (doctor):
124
+ --fix Auto-fix detected issues (runs pnpm install, prisma generate, patches env)
125
+ --json Machine-readable JSON output
117
126
 
118
- Exit codes for doctor:
127
+ Exit codes (doctor):
119
128
  0 All checks passed
120
- 1 One or more errors found
121
- 2 Warnings only (no errors)
129
+ 1 One or more errors
130
+ 2 Warnings only
122
131
 
123
- Options for publish:
132
+ Options (publish):
124
133
  --dry-run Validate and package without uploading
125
- --changelog <text> Release notes for this version
134
+ --changelog <msg> Release notes for this version
126
135
  ```
127
136
 
137
+ > `kaven doctor` is an alias for `kaven module doctor`.
138
+
139
+ ---
140
+
128
141
  ### `kaven upgrade`
129
142
 
130
- Upgrade your Kaven license tier via Paddle checkout.
143
+ Upgrade your license tier via Paddle checkout.
131
144
 
132
145
  ```
133
146
  Options:
134
147
  --no-browser Print checkout URL instead of opening browser
135
148
 
136
149
  Behavior:
137
- - Opens a Paddle checkout in your browser
138
- - Polls for payment confirmation (every 5s, max 10 min)
139
- - Updates local license on success
150
+ Opens Paddle checkout in browser → polls for payment (every 5s, max 10 min)
151
+ updates local license on success
140
152
  ```
141
153
 
142
- ### `kaven license`
154
+ ---
143
155
 
144
- Manage your Kaven license.
156
+ ### `kaven license`
145
157
 
146
158
  ```
147
159
  Commands:
148
- status Show current license status and tier
160
+ status Show current license tier and expiry
149
161
  ```
150
162
 
163
+ ---
164
+
151
165
  ### `kaven cache`
152
166
 
153
- Manage the local API response cache (~/.kaven/cache, max 50 MB).
167
+ Manage the local API response cache (`~/.kaven/cache`, max 50 MB).
154
168
 
155
169
  ```
156
170
  Commands:
157
- status Show cache statistics (size, entries, age)
171
+ status Show cache stats (size, entries, age)
158
172
  clear Delete all cached data
159
173
 
160
174
  Cache TTLs:
161
- Module listings: 24 hours
162
- Module manifests: 7 days
163
- License status: 1 hour
175
+ Module listings 24 hours
176
+ Module manifests 7 days
177
+ License status 1 hour
164
178
  ```
165
179
 
180
+ ---
181
+
166
182
  ### `kaven telemetry`
167
183
 
168
- View observability and audit logs.
184
+ ```
185
+ Commands:
186
+ view Show recent local telemetry events
187
+ -l, --limit <n> Number of events (default: 10)
188
+ ```
189
+
190
+ ---
191
+
192
+ ### `kaven config`
169
193
 
170
194
  ```
171
195
  Commands:
172
- view Display the most recent local telemetry events
173
- -l, --limit <n> Number of events to show (default: 10)
196
+ set <key> <value> Set a configuration value
197
+ get <key> Get a configuration value
174
198
  ```
175
199
 
176
200
  ---
177
201
 
202
+ ### `kaven init-ci`
203
+
204
+ Initialize CI/CD configuration in the current project. Generates GitHub Actions workflows tailored for Kaven projects.
205
+
206
+ ---
207
+
178
208
  ## Configuration
179
209
 
180
- Kaven CLI stores configuration in `~/.kaven/`:
210
+ All configuration lives in `~/.kaven/`:
181
211
 
182
212
  ```
183
213
  ~/.kaven/
184
- auth.json Authentication tokens (chmod 600)
185
- config.json CLI configuration (apiUrl override)
186
- license.json License key and tier
187
- signing-key.json Module signing key pair (chmod 600)
188
- cache/ API response cache (max 50 MB)
189
- telemetry.log Local telemetry events
214
+ auth.json Authentication tokens (chmod 600)
215
+ config.json CLI configuration
216
+ license.json License key and tier
217
+ signing-key.json Module Ed25519 signing key (chmod 600)
218
+ cache/ API response cache (max 50 MB)
219
+ telemetry.log Local telemetry events
190
220
  ```
191
221
 
192
- ### Overriding the API URL
222
+ ### Environment Variables
223
+
224
+ | Variable | Description |
225
+ |----------|-------------|
226
+ | `KAVEN_API_URL` | Override the marketplace API URL |
227
+ | `KAVEN_DEBUG=1` | Enable verbose debug output |
228
+ | `KAVEN_OFFLINE=1` | Use cached data only, no network requests |
229
+ | `KAVEN_TELEMETRY=0` | Disable telemetry entirely |
193
230
 
194
- Set `KAVEN_API_URL` environment variable or add to `~/.kaven/config.json`:
231
+ ### API URL Override (config file)
195
232
 
196
233
  ```json
234
+ // ~/.kaven/config.json
197
235
  {
198
236
  "apiUrl": "https://api.your-kaven-instance.com"
199
237
  }
@@ -208,55 +246,79 @@ KAVEN_DEBUG=1 kaven marketplace list
208
246
  ### Offline Mode
209
247
 
210
248
  ```bash
211
- KAVEN_OFFLINE=1 kaven marketplace list # Uses cached data only
249
+ KAVEN_OFFLINE=1 kaven marketplace list
212
250
  ```
213
251
 
214
252
  ---
215
253
 
216
254
  ## Troubleshooting
217
255
 
218
- ### "Not authenticated" error
219
-
220
- Run `kaven auth login` and complete the device code flow in your browser.
221
-
222
- ### "module.json not found" on publish
223
-
224
- Run `kaven module publish` from inside the module directory
225
- (the directory containing `module.json`).
226
-
227
- ### pnpm install fails on kaven init
228
-
229
- Install pnpm globally: `npm install -g pnpm`
230
- Or use `kaven init --skip-install` and run `pnpm install` manually.
256
+ **"Not authenticated" error**
257
+ ```bash
258
+ kaven auth login
259
+ ```
231
260
 
232
- ### Prisma client out of sync
261
+ **"module.json not found" on publish**
233
262
 
234
- Run `kaven module doctor --fix` or manually: `npx prisma generate`
263
+ Run `kaven module publish` from inside the module directory (the one containing `module.json`).
235
264
 
236
- ### Cache issues
265
+ **pnpm install fails on `kaven init`**
266
+ ```bash
267
+ npm install -g pnpm # install pnpm globally
268
+ # or skip it and install later:
269
+ kaven init my-app --skip-install
270
+ cd my-app && pnpm install
271
+ ```
237
272
 
238
- Clear the cache: `kaven cache clear`
273
+ **Prisma client out of sync**
274
+ ```bash
275
+ kaven module doctor --fix
276
+ # or manually:
277
+ npx prisma generate
278
+ ```
239
279
 
240
- ### Permission denied on ~/.kaven/
280
+ **Cache issues**
281
+ ```bash
282
+ kaven cache clear
283
+ ```
241
284
 
285
+ **Permission denied on `~/.kaven/`**
242
286
  ```bash
243
287
  chmod 700 ~/.kaven
244
- chmod 600 ~/.kaven/auth.json
288
+ chmod 600 ~/.kaven/auth.json ~/.kaven/signing-key.json
245
289
  ```
246
290
 
247
291
  ---
248
292
 
249
- ## Development
293
+ ## Contributing
250
294
 
251
295
  ```bash
252
296
  git clone https://github.com/kaven-co/kaven-cli
253
297
  cd kaven-cli
254
- pnpm install # or: npm install (with legacy-peer-deps)
255
- pnpm test # Run test suite
256
- pnpm run typecheck # TypeScript check
257
- pnpm run lint # ESLint
298
+ pnpm install
299
+ pnpm test # 310 tests
300
+ pnpm run typecheck
301
+ pnpm run lint
302
+ ```
303
+
304
+ **Commit convention:** this repo uses [Conventional Commits](https://www.conventionalcommits.org/).
305
+
306
+ ```bash
307
+ feat: add --with-squad flag to kaven init
308
+ fix: resolve cache corruption on concurrent writes
309
+ docs: update troubleshooting section
258
310
  ```
259
311
 
312
+ **Release flow:**
313
+ 1. Open a PR against `main`
314
+ 2. PR requires CI green (lint + typecheck + tests + build)
315
+ 3. Merge → Semantic Release automatically bumps version and publishes to npm (`@alpha` tag)
316
+
317
+ Types that trigger a release: `feat` (minor), `fix` / `perf` / `refactor` (patch), `BREAKING CHANGE` (major).
318
+ Types that do **not** trigger a release: `chore`, `docs`, `test`, `style`, `ci`.
319
+
320
+ See [`docs/releasing.md`](./docs/releasing.md) for the full release pipeline documentation.
321
+
260
322
  ---
261
323
 
262
324
  ## License
@@ -265,5 +327,6 @@ Apache 2.0 — see [LICENSE](LICENSE)
265
327
 
266
328
  ---
267
329
 
268
- Documentation: https://docs.kaven.sh/cli
330
+ Documentation: https://docs.kaven.site/cli
269
331
  GitHub: https://github.com/kaven-co/kaven-cli
332
+ npm: https://www.npmjs.com/package/kaven-cli