kaven-cli 0.4.0-alpha.1 → 0.4.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 +147 -84
- package/README.pt-BR.md +334 -0
- package/dist/commands/config/features.js +1 -34
- package/dist/commands/config/index.js +1 -34
- package/dist/commands/index.js +1 -0
- package/dist/commands/init/index.js +4 -37
- package/dist/commands/marketplace/browse.js +1 -34
- package/dist/commands/module/activate.js +7 -5
- package/dist/commands/module/publish.js +2 -35
- package/dist/commands/upgrade/index.js +6 -39
- package/dist/core/AuthService.js +2 -34
- package/dist/core/CacheManager.js +3 -0
- package/dist/core/ConfigManager.js +8 -7
- package/dist/core/ErrorRecovery.js +1 -0
- package/dist/core/LicenseService.js +3 -38
- package/dist/core/ModuleDoctor.js +3 -0
- package/dist/core/ModuleInstaller.js +5 -36
- package/dist/core/ProjectInitializer.js +26 -5
- package/dist/core/RegistryResolver.js +3 -2
- package/dist/core/SchemaActivator.js +21 -8
- package/dist/core/ScriptRunner.js +3 -2
- package/dist/core/index.js +1 -0
- package/dist/index.js +12 -7
- package/dist/infrastructure/Container.js +2 -4
- package/dist/infrastructure/MarketplaceClient.js +5 -3
- package/dist/infrastructure/TelemetryBuffer.js +3 -1
- package/dist/infrastructure/TransactionalFileSystem.js +4 -1
- package/dist/infrastructure/errors.js +2 -0
- package/dist/infrastructure/index.js +1 -0
- package/package.json +10 -3
- package/dist/commands/modules/add.js +0 -53
- package/dist/commands/modules/list.js +0 -40
- package/dist/commands/modules/remove.js +0 -54
- package/dist/core/api/KavenApiClient.js +0 -61
- package/dist/core/auth/AuthManager.js +0 -91
- package/dist/core/modules/Injector.js +0 -86
- package/dist/core/modules/ModuleInstaller.js +0 -63
- package/dist/core/modules/ModuleManager.js +0 -59
- package/dist/core/modules/ModuleRemover.js +0 -60
- package/dist/lib/config.js +0 -66
- package/dist/lib/errors.js +0 -32
- package/dist/lib/logger.js +0 -70
- package/dist/types/module.js +0 -49
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
|
+
[](https://www.npmjs.com/package/kaven-cli)
|
|
6
|
+
[](https://www.npmjs.com/package/kaven-cli)
|
|
3
7
|
[](https://opensource.org/licenses/Apache-2.0)
|
|
4
|
-
[](https://semver.org)
|
|
5
8
|
[](https://nodejs.org)
|
|
9
|
+
[](https://github.com/kaven-co/kaven-cli/actions/workflows/ci.yml)
|
|
6
10
|
|
|
7
|
-
The official command-line tool for the
|
|
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
|
|
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 (
|
|
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
|
|
58
|
-
--skip-install Skip
|
|
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
|
|
75
|
+
Manage authentication with the Kaven Marketplace.
|
|
71
76
|
|
|
72
77
|
```
|
|
73
78
|
Commands:
|
|
74
|
-
login Start device code
|
|
75
|
-
logout Clear the local
|
|
76
|
-
whoami Display
|
|
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
|
|
87
|
-
browse Interactive TUI
|
|
93
|
+
install Download and apply a module to the current project
|
|
94
|
+
browse Interactive TUI browser
|
|
88
95
|
|
|
89
|
-
Options
|
|
96
|
+
Options (list):
|
|
90
97
|
--category <cat> Filter by category
|
|
91
|
-
--sort <field>
|
|
98
|
+
--sort <field> newest (default) | popular | name
|
|
92
99
|
--page <n> Page number
|
|
93
|
-
--limit <n> Results per page (max
|
|
94
|
-
--json
|
|
100
|
+
--limit <n> Results per page (max 100)
|
|
101
|
+
--json Raw JSON output
|
|
95
102
|
|
|
96
|
-
Options
|
|
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
|
|
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
|
|
120
|
+
remove Uninstall an installed module
|
|
112
121
|
publish Publish a module to the marketplace
|
|
113
122
|
|
|
114
|
-
Options
|
|
115
|
-
--fix Auto-fix detected issues (pnpm install, prisma generate, env
|
|
116
|
-
--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
|
|
127
|
+
Exit codes (doctor):
|
|
119
128
|
0 All checks passed
|
|
120
|
-
1 One or more errors
|
|
121
|
-
2 Warnings only
|
|
129
|
+
1 One or more errors
|
|
130
|
+
2 Warnings only
|
|
122
131
|
|
|
123
|
-
Options
|
|
132
|
+
Options (publish):
|
|
124
133
|
--dry-run Validate and package without uploading
|
|
125
|
-
--changelog <
|
|
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
|
|
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
|
-
|
|
138
|
-
|
|
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
|
-
|
|
154
|
+
---
|
|
143
155
|
|
|
144
|
-
|
|
156
|
+
### `kaven license`
|
|
145
157
|
|
|
146
158
|
```
|
|
147
159
|
Commands:
|
|
148
|
-
status Show current license
|
|
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 (
|
|
167
|
+
Manage the local API response cache (`~/.kaven/cache`, max 50 MB).
|
|
154
168
|
|
|
155
169
|
```
|
|
156
170
|
Commands:
|
|
157
|
-
status Show cache
|
|
171
|
+
status Show cache stats (size, entries, age)
|
|
158
172
|
clear Delete all cached data
|
|
159
173
|
|
|
160
174
|
Cache TTLs:
|
|
161
|
-
Module listings
|
|
162
|
-
Module manifests
|
|
163
|
-
License status
|
|
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
|
-
|
|
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
|
-
|
|
173
|
-
|
|
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
|
-
|
|
210
|
+
All configuration lives in `~/.kaven/`:
|
|
181
211
|
|
|
182
212
|
```
|
|
183
213
|
~/.kaven/
|
|
184
|
-
auth.json
|
|
185
|
-
config.json
|
|
186
|
-
license.json
|
|
187
|
-
signing-key.json
|
|
188
|
-
cache/
|
|
189
|
-
telemetry.log
|
|
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
|
-
###
|
|
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
|
-
|
|
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
|
|
249
|
+
KAVEN_OFFLINE=1 kaven marketplace list
|
|
212
250
|
```
|
|
213
251
|
|
|
214
252
|
---
|
|
215
253
|
|
|
216
254
|
## Troubleshooting
|
|
217
255
|
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
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
|
-
|
|
261
|
+
**"module.json not found" on publish**
|
|
233
262
|
|
|
234
|
-
Run `kaven module
|
|
263
|
+
Run `kaven module publish` from inside the module directory (the one containing `module.json`).
|
|
235
264
|
|
|
236
|
-
|
|
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
|
-
|
|
273
|
+
**Prisma client out of sync**
|
|
274
|
+
```bash
|
|
275
|
+
kaven module doctor --fix
|
|
276
|
+
# or manually:
|
|
277
|
+
npx prisma generate
|
|
278
|
+
```
|
|
239
279
|
|
|
240
|
-
|
|
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
|
-
##
|
|
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
|
|
255
|
-
pnpm test
|
|
256
|
-
pnpm run typecheck
|
|
257
|
-
pnpm run lint
|
|
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.
|
|
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
|