kavoru 0.9.0 → 0.9.3

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,100 +1,102 @@
1
- # kavoru (CLI)
2
-
3
- Scaffold a new [Kavoru](https://github.com/mertthesamael/Kavoru) backend — ElysiaJS, Bun, TypeScript, Prisma, and the full production starter stack.
4
-
5
- ## Usage
6
-
7
- After publishing to npm:
8
-
9
- ```bash
10
- bunx kavoru@latest my-api
11
- cd my-api
12
- bun run dev
13
- ```
14
-
15
- Always use `@latest` so you get the newest published CLI. Equivalent to `bunx --bun kavoru@latest`.
16
-
17
- **Stale CLI after a new publish?** Bun caches `bunx` installs under `%TEMP%\bunx-*-kavoru@latest` and does not auto-refresh. Clear the cache, then run `@latest` again:
18
-
19
- ```powershell
20
- Remove-Item -Recurse -Force "$env:TEMP\bunx-*-kavoru*"
21
- bunx kavoru@latest my-api
22
- ```
23
-
24
- ```bash
25
- rm -rf "${TMPDIR:-/tmp}"/bunx-*-kavoru*
26
- bunx kavoru@latest my-api
27
- ```
28
-
29
- ### Options
30
-
31
- | Flag | Description |
32
- | ------------------- | -------------------------------------------------------- |
33
- | `-h, --help` | Show help |
34
- | `-V, --version` | Show CLI version |
35
- | `-f, --force` | Scaffold into a non-empty directory |
36
- | `--no-install` | Skip `bun install` |
37
- | `--repo owner/name` | Override template repo (default: `mertthesamael/Kavoru`) |
38
- | `--branch name` | Template branch (default: `master`) |
39
- | `--minimal` | Core only health, OpenAPI, response envelope |
40
- | `--features list` | Comma-separated features to include |
41
- | `--no-features list`| Comma-separated features to exclude (default: all on) |
42
-
43
- ### Optional features
44
-
45
- During setup you can pick which integrations to scaffold. Core is always included: health routes, OpenAPI at `/help`, CORS, and the JSON response envelope.
46
-
47
- | ID | Feature |
48
- | ----------- | ---------------------- |
49
- | `auth` | JWT authentication |
50
- | `postgres` | PostgreSQL + Prisma (includes Docker Postgres) |
51
- | `otel` | OpenTelemetry |
52
- | `sentry` | Sentry + Spotlight |
53
- | `kafka` | Kafka producer/consumer|
54
- | `websocket` | WebSocket realtime |
55
- | `resend` | Resend email |
56
- | `cron` | Cron jobs |
57
- | `docker` | Dockerfile + Compose |
58
- | `cli` | Project CLI (`kavoru module`, bin, root shims) |
59
-
60
- Interactive mode (TTY) shows a checkbox menu (↑↓ move, Space toggle, Enter confirm). Non-interactive runs use the full stack unless you pass flags.
61
-
62
- ### Examples
63
-
64
- ```bash
65
- # Interactive (prompts for project name + feature toggles)
66
- bunx kavoru@latest
67
-
68
- # Current directory
69
- bunx kavoru@latest .
70
-
71
- # Minimal API skeleton
72
- bunx kavoru@latest my-api --minimal
73
-
74
- # Pick specific features
75
- bunx kavoru@latest my-api --features auth,postgres,otel,sentry
76
-
77
- # Full stack minus Kafka and Docker
78
- bunx kavoru@latest my-api --no-features kafka,docker
79
-
80
- # Custom template fork (local dev)
81
- bunx kavoru@latest demo --repo your-user/Kavoru --no-install
82
- ```
83
-
84
- ## Development
85
-
86
- ```bash
87
- cd elysia-template-initializer
88
- bun install
89
- bun test
90
-
91
- # Run locally without publishing
92
- bun run src/index.ts my-test-app
93
- # or
94
- bun link
95
- bunx kavoru@latest my-test-app
96
- ```
97
-
98
- ## License
99
-
100
- MIT
1
+ # kavoru (CLI)
2
+
3
+ Scaffold a new [Kavoru](https://kavoru.com) backend — ElysiaJS, Bun, TypeScript, Prisma, and the full production starter stack.
4
+
5
+ ## Usage
6
+
7
+ After publishing to npm:
8
+
9
+ ```bash
10
+ bunx kavoru@latest my-api
11
+ cd my-api
12
+ docker compose up --build
13
+ ```
14
+
15
+ Always use `@latest` so you get the newest published CLI. Equivalent to `bunx --bun kavoru@latest`.
16
+
17
+ Every scaffold includes **Docker Compose** (`docker-compose.yaml` + `docker/app/`). Infra services (Postgres, Kafka, Redis, OTEL, Spotlight) are added when you select those features — the app service is always present.
18
+
19
+ **Stale CLI after a new publish?** Bun caches `bunx` installs under `%TEMP%\bunx-*-kavoru@latest` and does not auto-refresh. Clear the cache, then run `@latest` again:
20
+
21
+ ```powershell
22
+ Remove-Item -Recurse -Force "$env:TEMP\bunx-*-kavoru*"
23
+ bunx kavoru@latest my-api
24
+ ```
25
+
26
+ ```bash
27
+ rm -rf "${TMPDIR:-/tmp}"/bunx-*-kavoru*
28
+ bunx kavoru@latest my-api
29
+ ```
30
+
31
+ ### Options
32
+
33
+ | Flag | Description |
34
+ | ------------------- | -------------------------------------------------------- |
35
+ | `-h, --help` | Show help |
36
+ | `-V, --version` | Show CLI version |
37
+ | `-f, --force` | Scaffold into a non-empty directory |
38
+ | `--no-install` | Skip `bun install` |
39
+ | `--repo owner/name` | Override template repo (default: `mertthesamael/Kavoru`) |
40
+ | `--branch name` | Template branch (default: `master`) |
41
+ | `--minimal` | Core only health, OpenAPI, response envelope |
42
+ | `--features list` | Comma-separated features to include |
43
+ | `--no-features list`| Comma-separated features to exclude (default: all on) |
44
+
45
+ ### Optional features
46
+
47
+ During setup you can pick which integrations to scaffold. **Docker Compose is always included** (app image + compose file). Core is always included: health routes, OpenAPI at `/help`, CORS, and the JSON response envelope.
48
+
49
+ | ID | Feature |
50
+ | ----------- | ---------------------- |
51
+ | `auth` | JWT authentication |
52
+ | `postgres` | PostgreSQL + Prisma (includes Docker Postgres) |
53
+ | `otel` | OpenTelemetry |
54
+ | `sentry` | Sentry + Spotlight |
55
+ | `kafka` | Kafka producer/consumer|
56
+ | `redis` | Redis cache + CRUD API |
57
+ | `websocket` | WebSocket realtime |
58
+ | `resend` | Resend email |
59
+ | `cron` | Cron jobs |
60
+ | `cli` | Project CLI (`kavoru module`, bin, root shims) |
61
+
62
+ Interactive mode (TTY) shows a checkbox menu (↑↓ move, Space toggle, Enter confirm). Non-interactive runs use the full stack unless you pass flags.
63
+
64
+ ### Examples
65
+
66
+ ```bash
67
+ # Interactive (prompts for project name + feature toggles)
68
+ bunx kavoru@latest
69
+
70
+ # Current directory
71
+ bunx kavoru@latest .
72
+
73
+ # Minimal API skeleton
74
+ bunx kavoru@latest my-api --minimal
75
+
76
+ # Pick specific features
77
+ bunx kavoru@latest my-api --features auth,postgres,otel,sentry
78
+
79
+ # Full stack minus Kafka and Resend
80
+ bunx kavoru@latest my-api --no-features kafka,resend
81
+
82
+ # Custom template fork (local dev)
83
+ bunx kavoru@latest demo --repo your-user/Kavoru --no-install
84
+ ```
85
+
86
+ ## Development
87
+
88
+ ```bash
89
+ cd elysia-template-initializer
90
+ bun install
91
+ bun test
92
+
93
+ # Run locally without publishing
94
+ bun run src/index.ts my-test-app
95
+ # or
96
+ bun link
97
+ bunx kavoru@latest my-test-app
98
+ ```
99
+
100
+ ## License
101
+
102
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kavoru",
3
- "version": "0.9.0",
3
+ "version": "0.9.3",
4
4
  "description": "Scaffold a new Kavoru (Elysia + Bun) backend from the official template",
5
5
  "type": "module",
6
6
  "bin": {
@@ -28,7 +28,7 @@
28
28
  "type": "git",
29
29
  "url": "git+https://github.com/mertthesamael/kavoru-cli.git"
30
30
  },
31
- "homepage": "https://github.com/mertthesamael/Kavoru",
31
+ "homepage": "https://kavoru.com",
32
32
  "bugs": {
33
33
  "url": "https://github.com/mertthesamael/Kavoru/issues"
34
34
  },
package/src/args.ts CHANGED
@@ -1,143 +1,144 @@
1
- import { PACKAGE_VERSION } from "./constants";
2
-
3
- export type CliOptions = {
4
- targetDir: string | undefined;
5
- help: boolean;
6
- version: boolean;
7
- install: boolean;
8
- force: boolean;
9
- repo: string;
10
- branch: string;
11
- minimal: boolean;
12
- features: string | undefined;
13
- noFeatures: string[];
14
- };
15
-
16
- const HELP = `\
17
- Usage: kavoru [options] [directory]
18
- kavoru module <module-name> [options]
19
-
20
- Create a new project from the Kavoru Elysia + Bun template.
21
-
22
- Commands:
23
- module <name> Generate src/modules/<name> (routes, service, types)
24
-
25
- Arguments:
26
- directory Project folder (use "." for current directory)
27
-
28
- Options:
29
- -h, --help Show help
30
- -V, --version Show version
31
- -f, --force Overwrite / use a non-empty target directory
32
- --no-install Skip "bun install" after scaffolding
33
- --repo <owner/name> GitHub template repo (default: mertthesamael/Kavoru)
34
- --branch <name> Template branch (default: master)
35
- --minimal Core only (health, OpenAPI, response envelope)
36
- --features <list> Comma-separated features to include (default: all)
37
- --no-features <list> Comma-separated features to exclude
38
-
39
- Features:
40
- auth, postgres, otel, sentry, kafka, websocket, resend, cron, docker, cli
41
- (prisma is accepted as an alias for postgres; kavoru-cli for cli)
42
-
43
- Examples:
44
- bunx kavoru@latest my-api
45
- bunx kavoru@latest my-api --minimal
46
- bunx kavoru@latest my-api --features auth,postgres,otel
47
- bunx kavoru@latest my-api --no-features kafka,docker,resend
48
- bunx kavoru@latest module users
49
- `;
50
-
51
- export function parseArgs(argv: string[]): CliOptions {
52
- const options: CliOptions = {
53
- targetDir: undefined,
54
- help: false,
55
- version: false,
56
- install: true,
57
- force: false,
58
- repo: "mertthesamael/Kavoru",
59
- branch: "master",
60
- minimal: false,
61
- features: undefined,
62
- noFeatures: [],
63
- };
64
-
65
- const positional: string[] = [];
66
-
67
- for (let i = 0; i < argv.length; i++) {
68
- const arg = argv[i];
69
- if (!arg) continue;
70
-
71
- switch (arg) {
72
- case "-h":
73
- case "--help":
74
- options.help = true;
75
- break;
76
- case "-V":
77
- case "--version":
78
- options.version = true;
79
- break;
80
- case "-f":
81
- case "--force":
82
- options.force = true;
83
- break;
84
- case "--no-install":
85
- options.install = false;
86
- break;
87
- case "--minimal":
88
- options.minimal = true;
89
- break;
90
- case "--features": {
91
- const value = argv[++i];
92
- if (!value) throw new Error("--features requires a comma-separated list.");
93
- options.features = value;
94
- break;
95
- }
96
- case "--no-features": {
97
- const value = argv[++i];
98
- if (!value) {
99
- throw new Error("--no-features requires a comma-separated list.");
100
- }
101
- options.noFeatures.push(
102
- ...value.split(",").map((part) => part.trim()).filter(Boolean),
103
- );
104
- break;
105
- }
106
- case "--repo": {
107
- const value = argv[++i];
108
- if (!value) throw new Error("--repo requires a value (owner/name).");
109
- options.repo = value;
110
- break;
111
- }
112
- case "--branch": {
113
- const value = argv[++i];
114
- if (!value) throw new Error("--branch requires a value.");
115
- options.branch = value;
116
- break;
117
- }
118
- default:
119
- if (arg.startsWith("-")) {
120
- throw new Error(`Unknown option: ${arg}`);
121
- }
122
- positional.push(arg);
123
- }
124
- }
125
-
126
- if (positional[0]) {
127
- options.targetDir = positional[0];
128
- }
129
-
130
- if (options.minimal && options.features) {
131
- throw new Error("Use either --minimal or --features, not both.");
132
- }
133
-
134
- return options;
135
- }
136
-
137
- export function printHelp(): void {
138
- console.log(HELP.trim());
139
- }
140
-
141
- export function printVersion(): void {
142
- console.log(PACKAGE_VERSION);
143
- }
1
+ import { PACKAGE_VERSION } from "./constants";
2
+
3
+ export type CliOptions = {
4
+ targetDir: string | undefined;
5
+ help: boolean;
6
+ version: boolean;
7
+ install: boolean;
8
+ force: boolean;
9
+ repo: string;
10
+ branch: string;
11
+ minimal: boolean;
12
+ features: string | undefined;
13
+ noFeatures: string[];
14
+ };
15
+
16
+ const HELP = `\
17
+ Usage: kavoru [options] [directory]
18
+ kavoru module <module-name> [options]
19
+
20
+ Create a new project from the Kavoru Elysia + Bun template.
21
+
22
+ Commands:
23
+ module <name> Generate src/modules/<name> (routes, service, types)
24
+
25
+ Arguments:
26
+ directory Project folder (use "." for current directory)
27
+
28
+ Options:
29
+ -h, --help Show help
30
+ -V, --version Show version
31
+ -f, --force Overwrite / use a non-empty target directory
32
+ --no-install Skip "bun install" after scaffolding
33
+ --repo <owner/name> GitHub template repo (default: mertthesamael/Kavoru)
34
+ --branch <name> Template branch (default: master)
35
+ --minimal Core only (health, OpenAPI, response envelope)
36
+ --features <list> Comma-separated features to include (default: all)
37
+ --no-features <list> Comma-separated features to exclude
38
+
39
+ Features:
40
+ auth, postgres, otel, sentry, kafka, redis, websocket, resend, cron, cli
41
+ (prisma is accepted as an alias for postgres; kavoru-cli for cli)
42
+ Docker Compose is always included — not a toggle.
43
+
44
+ Examples:
45
+ bunx kavoru@latest my-api
46
+ bunx kavoru@latest my-api --minimal
47
+ bunx kavoru@latest my-api --features auth,postgres,otel
48
+ bunx kavoru@latest my-api --no-features kafka,resend
49
+ bunx kavoru@latest module users
50
+ `;
51
+
52
+ export function parseArgs(argv: string[]): CliOptions {
53
+ const options: CliOptions = {
54
+ targetDir: undefined,
55
+ help: false,
56
+ version: false,
57
+ install: true,
58
+ force: false,
59
+ repo: "mertthesamael/Kavoru",
60
+ branch: "master",
61
+ minimal: false,
62
+ features: undefined,
63
+ noFeatures: [],
64
+ };
65
+
66
+ const positional: string[] = [];
67
+
68
+ for (let i = 0; i < argv.length; i++) {
69
+ const arg = argv[i];
70
+ if (!arg) continue;
71
+
72
+ switch (arg) {
73
+ case "-h":
74
+ case "--help":
75
+ options.help = true;
76
+ break;
77
+ case "-V":
78
+ case "--version":
79
+ options.version = true;
80
+ break;
81
+ case "-f":
82
+ case "--force":
83
+ options.force = true;
84
+ break;
85
+ case "--no-install":
86
+ options.install = false;
87
+ break;
88
+ case "--minimal":
89
+ options.minimal = true;
90
+ break;
91
+ case "--features": {
92
+ const value = argv[++i];
93
+ if (!value) throw new Error("--features requires a comma-separated list.");
94
+ options.features = value;
95
+ break;
96
+ }
97
+ case "--no-features": {
98
+ const value = argv[++i];
99
+ if (!value) {
100
+ throw new Error("--no-features requires a comma-separated list.");
101
+ }
102
+ options.noFeatures.push(
103
+ ...value.split(",").map((part) => part.trim()).filter(Boolean),
104
+ );
105
+ break;
106
+ }
107
+ case "--repo": {
108
+ const value = argv[++i];
109
+ if (!value) throw new Error("--repo requires a value (owner/name).");
110
+ options.repo = value;
111
+ break;
112
+ }
113
+ case "--branch": {
114
+ const value = argv[++i];
115
+ if (!value) throw new Error("--branch requires a value.");
116
+ options.branch = value;
117
+ break;
118
+ }
119
+ default:
120
+ if (arg.startsWith("-")) {
121
+ throw new Error(`Unknown option: ${arg}`);
122
+ }
123
+ positional.push(arg);
124
+ }
125
+ }
126
+
127
+ if (positional[0]) {
128
+ options.targetDir = positional[0];
129
+ }
130
+
131
+ if (options.minimal && options.features) {
132
+ throw new Error("Use either --minimal or --features, not both.");
133
+ }
134
+
135
+ return options;
136
+ }
137
+
138
+ export function printHelp(): void {
139
+ console.log(HELP.trim());
140
+ }
141
+
142
+ export function printVersion(): void {
143
+ console.log(PACKAGE_VERSION);
144
+ }