rapidkit 0.25.6 → 0.26.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
@@ -2,8 +2,8 @@
2
2
 
3
3
  > RapidKit is an open-source workspace platform that standardizes how teams build, scale, and deploy backend services.
4
4
 
5
- FastAPI, NestJS, Go/Fiber, and Go/Gin scaffolding with production-ready defaults.
6
- **27+ plug-and-play modules** are available for FastAPI & NestJS projects.
5
+ FastAPI, NestJS, Spring Boot, Go/Fiber, and Go/Gin scaffolding with production-ready defaults.
6
+ **27+ plug-and-play modules** are available for FastAPI & NestJS projects. Spring Boot and Go kits run as npm-level generators.
7
7
  Clean architecture • Zero boilerplate • Instant deployment.
8
8
 
9
9
  > **💡 Recommended:** Install the [Workspai VS Code extension](https://github.com/getrapidkit/rapidkit-vscode) for AI-powered project creation, a visual workspace explorer, and context-aware coding assistance — all backed by this CLI.
@@ -17,7 +17,7 @@ Clean architecture • Zero boilerplate • Instant deployment.
17
17
  Official CLI for creating and operating RapidKit workspaces and projects.
18
18
 
19
19
  - Workspace-first lifecycle (`create workspace` → `bootstrap` → `setup` → `create project`)
20
- - Multi-runtime support (Python, Node.js, Go)
20
+ - Multi-runtime support (Python, Node.js, Java, Go)
21
21
  - Profile + policy enforcement (`warn` / `strict`)
22
22
  - Cache and mirror lifecycle commands for stable environments
23
23
 
@@ -38,6 +38,7 @@ It works alongside Workspai, which is a product developed by RapidKit.
38
38
 
39
39
  - Node.js `>= 20.19.6`
40
40
  - Python `>= 3.10` (for Python/Core workflows)
41
+ - Java 21+ and Maven 3.9+ (optional, for Spring Boot projects)
41
42
  - Go (optional, for Go projects)
42
43
 
43
44
  ## Install
@@ -69,6 +70,7 @@ cd my-workspace
69
70
  npx rapidkit bootstrap --profile polyglot
70
71
  npx rapidkit setup python
71
72
  npx rapidkit setup node --warm-deps
73
+ npx rapidkit setup java --warm-deps
72
74
  npx rapidkit setup go --warm-deps
73
75
  ```
74
76
 
@@ -76,7 +78,9 @@ npx rapidkit setup go --warm-deps
76
78
 
77
79
  ```bash
78
80
  npx rapidkit create project fastapi.standard my-api --yes --skip-install
81
+ npx rapidkit create project fastapi.ddd my-api --yes --skip-install
79
82
  npx rapidkit create project nestjs.standard my-nest --yes --skip-install
83
+ npx rapidkit create project springboot.standard my-spring --yes --skip-install
80
84
  npx rapidkit create project gofiber.standard my-fiber --yes --skip-install
81
85
  ```
82
86
 
@@ -88,7 +92,7 @@ npx rapidkit create project gofiber.standard my-fiber --yes --skip-install
88
92
  npx rapidkit create # Prompts: workspace | project
89
93
  npx rapidkit create workspace <name> [--profile <profile>] [--author <name>] [--yes]
90
94
  npx rapidkit bootstrap [--profile <profile>] [--json]
91
- npx rapidkit setup <python|node|go> [--warm-deps]
95
+ npx rapidkit setup <python|node|go|java> [--warm-deps]
92
96
  npx rapidkit workspace policy show
93
97
  npx rapidkit workspace policy set <key> <value>
94
98
  npx rapidkit doctor
@@ -138,10 +142,11 @@ npx rapidkit mirror <status|sync|verify|rotate>
138
142
  ## Profiles
139
143
 
140
144
  - `minimal` — baseline workspace scaffolding
145
+ - `java-only` — Java-focused workspace
141
146
  - `python-only` — Python-focused workspace
142
147
  - `node-only` — Node.js-focused workspace
143
148
  - `go-only` — Go-focused workspace
144
- - `polyglot` — Python + Node.js + Go
149
+ - `polyglot` — Python + Node.js + Go + Java
145
150
  - `enterprise` — polyglot + governance-oriented checks
146
151
 
147
152
  ## Policy Modes
@@ -0,0 +1,160 @@
1
+ import {promises}from'fs';import r from'path';var g="1.24",i="github.com/air-verse/air@v1.52.3",a="github.com/swaggo/swag/cmd/swag@v1.16.3",n="main.go -d cmd/server,internal/handlers,internal/apierr -o docs --parseDependency";function u(e){return e.split(/[-_\s]+/).map(t=>t.charAt(0).toUpperCase()+t.slice(1)).join("")}async function $(e,t){await promises.mkdir(r.dirname(e),{recursive:true}),await promises.writeFile(e,t,"utf8");}function h(e){let t=e.includeLintAndFmt?`
2
+ lint:
3
+ @command -v golangci-lint >/dev/null 2>&1 || (echo "golangci-lint not found. Install: https://golangci-lint.run/usage/install/" && exit 1)
4
+ golangci-lint run ./...
5
+
6
+ fmt:
7
+ gofmt -w .
8
+ `:"";return `.PHONY: dev run build test cover${e.includeLintAndFmt?" lint fmt":""} tidy docs docker-up docker-down
9
+
10
+ # Build-time metadata
11
+ VERSION ?= $(shell git describe --tags --always --dirty 2>/dev/null || echo "dev")
12
+ COMMIT ?= $(shell git rev-parse --short HEAD 2>/dev/null || echo "none")
13
+ DATE ?= $(shell date -u +"%Y-%m-%dT%H:%M:%SZ")
14
+ LDFLAGS = -ldflags "-s -w -X main.version=$(VERSION) -X main.commit=$(COMMIT) -X main.date=$(DATE)"
15
+ # Go tool binaries are installed to GOPATH/bin; include it so \`air\` and \`swag\` are found.
16
+ GOBIN ?= $(shell go env GOPATH)/bin
17
+
18
+ # Hot reload \u2014 installs pinned air version on first use
19
+ dev:
20
+ @test -x "$(GOBIN)/air" || go install ${i}
21
+ ${e.devCommand}
22
+
23
+ run:
24
+ ${e.runCommand}
25
+
26
+ build:
27
+ go build $(LDFLAGS) -o bin/${e.projectName} ./cmd/server
28
+
29
+ test:
30
+ ${e.testCommand}
31
+
32
+ cover:
33
+ ${e.testCommand.replace("./... -v -race","./... -race -coverprofile=coverage.out").replace("GIN_MODE=test ","GIN_MODE=test ")}
34
+ go tool cover -html=coverage.out -o coverage.html
35
+ @echo "Coverage report: coverage.html"
36
+
37
+ # Generate Swagger docs \u2014 installs pinned swag version on first use
38
+ docs:
39
+ @test -x "$(GOBIN)/swag" || go install ${a}
40
+ $(GOBIN)/swag init -g ${n}${t}
41
+ tidy:
42
+ go mod tidy
43
+
44
+ docker-up:
45
+ go mod tidy
46
+ docker compose up --build \\
47
+ --build-arg VERSION=$(VERSION) \\
48
+ --build-arg COMMIT=$(COMMIT) \\
49
+ --build-arg DATE=$(DATE) \\
50
+ -d
51
+
52
+ docker-down:
53
+ docker compose down
54
+ `}function p(e){return `#!/usr/bin/env sh
55
+ # RapidKit ${e.runtimeLabel} project launcher \u2014 generated by RapidKit CLI
56
+ # https://getrapidkit.com
57
+
58
+ SCRIPT_DIR=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd)
59
+ CMD="\${1:-}"
60
+ shift 2>/dev/null || true
61
+
62
+ case "$CMD" in
63
+ init)
64
+ cd "$SCRIPT_DIR"
65
+ echo "\u{1F439} Initializing ${e.runtimeLabel} project\u2026"
66
+ GOBIN="$(go env GOPATH)/bin"
67
+ echo " \u2192 installing air (hot reload)\u2026"
68
+ go install ${i} 2>/dev/null && echo " \u2713 air" || echo " \u26A0 air install failed (run: go install ${i})"
69
+ echo " \u2192 installing swag (swagger)\u2026"
70
+ go install ${a} 2>/dev/null && echo " \u2713 swag" || echo " \u26A0 swag install failed (run: go install ${a})"
71
+ if [ ! -f ".env" ] && [ -f ".env.example" ]; then
72
+ cp .env.example .env && echo " \u2713 .env created from .env.example"
73
+ fi
74
+ go mod tidy && echo " \u2713 go mod tidy"
75
+ echo " \u2192 generating swagger docs (first build)\u2026"
76
+ "$(go env GOPATH)/bin/swag" init -g ${n} 2>/dev/null \\
77
+ && echo " \u2713 swagger docs generated" \\
78
+ || echo " \u26A0 swagger docs skipped (run: rapidkit docs)"
79
+ echo "\u2705 Ready \u2014 run: rapidkit dev"
80
+ ;;
81
+ dev)
82
+ cd "$SCRIPT_DIR"
83
+ echo "\u{1F4D6} Syncing swagger docs\u2026"
84
+ "$(go env GOPATH)/bin/swag" init -g ${n} 2>/dev/null || true
85
+ if [ -f "$SCRIPT_DIR/Makefile" ]; then
86
+ exec make -C "$SCRIPT_DIR" dev "$@"
87
+ else
88
+ ${e.fallbackDevCommand}
89
+ fi
90
+ ;;
91
+ start)
92
+ BIN="$SCRIPT_DIR/bin/${e.projectName}"
93
+ if [ ! -f "$BIN" ]; then
94
+ make -C "$SCRIPT_DIR" build
95
+ fi
96
+ exec "$BIN" "$@"
97
+ ;;
98
+ build)
99
+ exec make -C "$SCRIPT_DIR" build "$@"
100
+ ;;
101
+ test)
102
+ exec make -C "$SCRIPT_DIR" test "$@"
103
+ ;;
104
+ lint)
105
+ exec make -C "$SCRIPT_DIR" lint "$@"
106
+ ;;
107
+ format|fmt)
108
+ exec make -C "$SCRIPT_DIR" fmt "$@"
109
+ ;;
110
+ docs)
111
+ exec make -C "$SCRIPT_DIR" docs "$@"
112
+ ;;
113
+ help|--help|-h)
114
+ echo "RapidKit \u2014 ${e.runtimeLabel} project: ${e.projectName}"
115
+ echo ""
116
+ echo "Usage: rapidkit <command>"
117
+ echo ""
118
+ echo " init Install tools + create .env (air, swag, go mod tidy)"
119
+ echo " dev Hot reload dev server (make dev \u2014 requires air)"
120
+ echo " start Run compiled binary (make build + bin)"
121
+ echo " build Build binary (make build)"
122
+ echo " docs Generate Swagger docs (make docs \u2014 requires swag)"
123
+ echo " test Run tests (make test)"
124
+ echo " lint Run linter (make lint)"
125
+ echo " format Format code (make fmt)"
126
+ ;;
127
+ *)
128
+ if [ -n "$CMD" ]; then
129
+ echo "rapidkit: unknown command: $CMD" >&2
130
+ fi
131
+ echo "Available: init, dev, start, build, docs, test, lint, format" >&2
132
+ exit 1
133
+ ;;
134
+ esac
135
+ `}function v(e){return `@echo off
136
+ rem RapidKit ${e.runtimeLabel} project launcher \u2014 Windows
137
+ set CMD=%1
138
+ if "%CMD%"=="" goto usage
139
+ shift
140
+
141
+ if "%CMD%"=="init" (
142
+ echo Initializing ${e.runtimeLabel} project...
143
+ go install ${i}
144
+ go install ${a}
145
+ if not exist .env if exist .env.example copy .env.example .env
146
+ go mod tidy
147
+ exit /b %ERRORLEVEL%
148
+ )
149
+ if "%CMD%"=="dev" ( make dev %* & exit /b %ERRORLEVEL% )
150
+ if "%CMD%"=="build" ( make build %* & exit /b %ERRORLEVEL% )
151
+ if "%CMD%"=="test" ( make test %* & exit /b %ERRORLEVEL% )
152
+ if "%CMD%"=="lint" ( make lint %* & exit /b %ERRORLEVEL% )
153
+ if "%CMD%"=="format" ( make fmt %* & exit /b %ERRORLEVEL% )
154
+ if "%CMD%"=="docs" ( make docs %* & exit /b %ERRORLEVEL% )
155
+ if "%CMD%"=="start" ( bin\\${e.projectName}.exe %* & exit /b %ERRORLEVEL% )
156
+
157
+ :usage
158
+ echo Available: init, dev, start, build, docs, test, lint, format
159
+ exit /b 1
160
+ `}export{g as a,u as b,$ as c,h as d,p as e,v as f};
@@ -1,4 +1,4 @@
1
- import {i,d as d$2,l,k,f as f$1,g,h}from'./chunk-ZAZJEYYT.js';import {a as a$2,e,d as d$1,f,c,k as k$1}from'./chunk-Z5LKRG57.js';import {a,d,b as b$1}from'./chunk-RV6HBTFC.js';import {b}from'./chunk-Q7ULIFQA.js';import {a as a$1}from'./chunk-VM2TOHNX.js';import {promises}from'fs';import*as v from'fs-extra';import m from'path';import U from'inquirer';import o from'chalk';import z from'ora';import {execa}from'execa';function C(){return c()}async function et(t,n,e,r){let s=d(n,b(),e);r&&(s.metadata||(s.metadata={}),s.metadata.python={version:r}),await b$1(t,s);}async function H(t){await v.outputFile(m.join(t,".gitignore"),`.venv/
1
+ import {i,d as d$2,l,k,f as f$1,g,h}from'./chunk-ZAZJEYYT.js';import {a,d,b as b$1}from'./chunk-RV6HBTFC.js';import {a as a$2,e,d as d$1,f,c,k as k$1}from'./chunk-Z5LKRG57.js';import {b}from'./chunk-Q7ULIFQA.js';import {a as a$1}from'./chunk-VM2TOHNX.js';import {promises}from'fs';import*as v from'fs-extra';import m from'path';import U from'inquirer';import o from'chalk';import z from'ora';import {execa}from'execa';function C(){return c()}async function et(t,n,e,r){let s=d(n,b(),e);r&&(s.metadata||(s.metadata={}),s.metadata.python={version:r}),await b$1(t,s);}async function H(t){await v.outputFile(m.join(t,".gitignore"),`.venv/
2
2
  __pycache__/
3
3
  *.pyc
4
4
  .env
@@ -20,7 +20,7 @@ rapidkit-core = "*"
20
20
  [build-system]
21
21
  requires = ["poetry-core"]
22
22
  build-backend = "poetry.core.masonry.api"
23
- `,"utf-8");}function mt(t,n,e,r){return JSON.stringify({schema_version:"1.0",workspace_name:t,rapidkit_version:b(),created_at:new Date().toISOString(),created_by:"rapidkit-npm",profile:r||"minimal",engine:{install_method:n,python_version:e||null}},null,2)}function yt(t,n,e,r){return JSON.stringify({schema_version:"1.0",generated_by:"rapidkit-npm",generated_at:new Date().toISOString(),runtime:{python:{version:n||null,install_method:t},node:{version:e||process.version},go:{version:r||null}}},null,2)}function gt(){return `version: "1.0"
23
+ `,"utf-8");}function mt(t,n,e,r){return JSON.stringify({schema_version:"1.0",workspace_name:t,rapidkit_version:b(),created_at:new Date().toISOString(),created_by:"rapidkit-npm",profile:r||"minimal",engine:{install_method:n,python_version:e||null}},null,2)}function yt(t,n,e,r){return JSON.stringify({schema_version:"1.0",generated_by:"rapidkit-npm",generated_at:new Date().toISOString(),runtime:{python:{version:n||null,install_method:t},node:{version:e||process.version},go:{version:r||null},java:{version:null,build_tool:null,build_tool_version:null}}},null,2)}function gt(){return `version: "1.0"
24
24
  mode: warn # "warn" or "strict"
25
25
  dependency_sharing_mode: isolated # "isolated" or "shared-runtime-caches" or "shared-node-deps"
26
26
  # change profile (recommended): npx rapidkit bootstrap --profile polyglot
@@ -40,7 +40,7 @@ cache:
40
40
 
41
41
  Try reopening your terminal or run: ${e} -m pipx ensurepath`))}}async function F(t,n){return t.kind==="binary"?execa("pipx",n):execa(t.pythonCmd,["-m","pipx",...n])}function Et(t){let n=t.match(/^(\d+)\.(\d+)/);return n?`${n[1]}.${n[2]}`:null}function ut(t){if(!t)return null;let n=t.match(/Python\s+(\d+)\.(\d+)(?:\.\d+)?/i);return n?`${n[1]}.${n[2]}`:null}function it(t,n){let[e,r]=t.split(".").map(u=>Number(u)),[s,d]=n.split(".").map(u=>Number(u));return e!==s?e-s:r-d}function K(t,n){return it(t,n)>=0}async function Ct(t){let n=new Set,e$1=e(14,10);for(let i of e$1)try{let a=await execa(i.command,i.args,{timeout:2500}),p=ut(`${a.stdout||""}
42
42
  ${a.stderr||""}`);p&&K(p,A)&&n.add(p);}catch{}let r=null;try{let i=await execa(C(),["--version"],{timeout:2500}),a=ut(`${i.stdout||""}
43
- ${i.stderr||""}`);a&&K(a,A)&&(r=a,n.add(a));}catch{}let s=ft.filter(i=>K(i,A)),d=new Set([...s,...n]),u=Array.from(d).sort((i,a)=>it(a,i)),g=t?Et(t):null,y=g&&K(g,A)?g:r||u[0]||A;return d.has(y)||d.add(y),{choices:Array.from(d).sort((i,a)=>it(a,i)).map(i=>{let a=[];return i===r&&a.push("current system"),i===A&&a.push("minimum supported"),n.has(i)&&i!==r&&a.push("detected"),{name:a.length>0?`${i} (${a.join(", ")})`:i,value:i}}),defaultValue:y}}async function $t(){D();let t=false,n=false;try{await execa("poetry",["--version"],{timeout:2500}),t=true;}catch{t=false;}try{await execa("pipx",["--version"],{timeout:2500}),n=true;}catch{let e=c();try{await execa(e,["-m","pipx","--version"],{timeout:2500}),n=true;}catch{n=false;}}return {poetry:t,pipx:n}}async function wt(){D();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function Mt(t,n){return t==="poetry"&&n.poetry?"poetry":t==="pipx"&&n.pipx?"pipx":t==="venv"?"venv":n.poetry?"poetry":"venv"}async function St(t,n){D(),t.start("Checking Poetry installation");try{await execa("poetry",["--version"]),t.succeed("Poetry found");return}catch{}if(n)throw new g;let{installPoetry:e}=await U.prompt([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!e)throw new g;let r=await q(t,n);t.start("Installing Poetry with pipx");try{await F(r,["install","poetry"]);}catch(s){let d=s,u=String(d?.stderr||d?.shortMessage||d?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(u))try{await F(r,["upgrade","poetry"]);}catch{}else throw new k("Install Poetry with pipx",s instanceof Error?s:new Error(u))}t.succeed("Poetry installed"),D();try{await execa("poetry",["--version"]);}catch(s){let d=s,u=String(d?.stderr||d?.shortMessage||d?.message||"Poetry not found on PATH");throw new k("Verify Poetry after pipx install",new Error(`${u}
43
+ ${i.stderr||""}`);a&&K(a,A)&&(r=a,n.add(a));}catch{}let s=ft.filter(i=>K(i,A)),d=new Set([...s,...n]),u=Array.from(d).sort((i,a)=>it(a,i)),g=t?Et(t):null,y=g&&K(g,A)?g:r||u[0]||A;return d.has(y)||d.add(y),{choices:Array.from(d).sort((i,a)=>it(a,i)).map(i=>{let a=[];return i===r&&a.push("current system"),i===A&&a.push("minimum supported"),n.has(i)&&i!==r&&a.push("detected"),{name:a.length>0?`${i} (${a.join(", ")})`:i,value:i}}),defaultValue:y}}async function $t(){D();let t=false,n=false;try{await execa("poetry",["--version"],{timeout:2500}),t=true;}catch{t=false;}try{await execa("pipx",["--version"],{timeout:2500}),n=true;}catch{let e=c();try{await execa(e,["-m","pipx","--version"],{timeout:2500}),n=true;}catch{n=false;}}return {poetry:t,pipx:n}}async function wt(){D();try{return await execa("poetry",["--version"],{timeout:2500}),true}catch{return false}}function St(t,n){return t==="poetry"&&n.poetry?"poetry":t==="pipx"&&n.pipx?"pipx":t==="venv"?"venv":n.poetry?"poetry":"venv"}async function Mt(t,n){D(),t.start("Checking Poetry installation");try{await execa("poetry",["--version"]),t.succeed("Poetry found");return}catch{}if(n)throw new g;let{installPoetry:e}=await U.prompt([{type:"confirm",name:"installPoetry",message:"Poetry is not installed. Install it now using pipx?",default:true}]);if(!e)throw new g;let r=await q(t,n);t.start("Installing Poetry with pipx");try{await F(r,["install","poetry"]);}catch(s){let d=s,u=String(d?.stderr||d?.shortMessage||d?.message||"");if(/already\s+installed|already\s+seems\s+to\s+be\s+installed|exists/i.test(u))try{await F(r,["upgrade","poetry"]);}catch{}else throw new k("Install Poetry with pipx",s instanceof Error?s:new Error(u))}t.succeed("Poetry installed"),D();try{await execa("poetry",["--version"]);}catch(s){let d=s,u=String(d?.stderr||d?.shortMessage||d?.message||"Poetry not found on PATH");throw new k("Verify Poetry after pipx install",new Error(`${u}
44
44
 
45
45
  Poetry may be installed but not on PATH yet. Try reopening your terminal or run: pipx ensurepath`))}}function At(t){let n=t==="poetry";return `#!/usr/bin/env sh
46
46
  set -eu
@@ -80,7 +80,7 @@ if %ERRORLEVEL%==0 if exist "%SCRIPT_DIR%\\pyproject.toml" (
80
80
  `:""}echo RapidKit launcher could not find a local Python CLI. 1>&2
81
81
  echo Tip: run .venv\\Scripts\\rapidkit.exe --help 1>&2
82
82
  exit /b 1
83
- `}async function vt(t,n){await v.outputFile(m.join(t,"rapidkit"),At(n),{encoding:"utf-8",mode:493}),await v.outputFile(m.join(t,"rapidkit.cmd"),Dt(n),"utf-8");}async function oe(t,n){let{skipGit:e=false,testMode:r=false,demoMode:s=false,dryRun:d=false,yes:u=false,userConfig:g={},installMethod:y,profile:h}=n,c=t||"rapidkit",i$1=m.resolve(process.cwd(),c);if(await v.pathExists(i$1))throw new i(c);if(d){await Ft(i$1,c,s,g);return}if(s){await Kt(i$1,c,e);return}let a=new Set(["python-only","polyglot","enterprise"]),p=h||"";if(!u&&!h){let{selectedProfile:f}=await U.prompt([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"polyglot \u2014 Python + Node.js + Go multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);p=f;}else p||(p="minimal");let b=!u&&a.has(p),E=typeof g.pythonVersion=="string"&&g.pythonVersion.trim().length>0?g.pythonVersion.trim():void 0,M=y||g.defaultInstallMethod||"poetry",I=b?await $t():{poetry:true,pipx:true},T=b?await Ct(E):{choices:ft.map(f=>({name:f,value:f})),defaultValue:A},Y=Mt(M,I),It=[{name:I.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env)":"\u{1F3AF} Poetry (Recommended - includes virtual env) \u2014 not detected (we can install it)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard, zero extra tools)",value:"venv"},{name:I.pipx?"\u{1F527} pipx (Global isolated install)":"\u{1F527} pipx (Global isolated install) \u2014 not detected (we can install it)",value:"pipx"}],x=b?await U.prompt([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:T.choices,default:T.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:It,default:Y}]):await(async()=>{let f=y||g.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:g.pythonVersion||"3.10",installMethod:f}})();if(new Set(["go-only","node-only","minimal"]).has(p)){let f=z("Creating workspace").start();try{await v.ensureDir(i$1),f.succeed("Directory created"),await et(i$1,c,"venv",void 0),await nt(i$1,c,"venv",void 0,p),await H(i$1),await ot(i$1,c);let R={"go-only":"Go-only","node-only":"Node.js-only",minimal:"Minimal"};if(await v.outputFile(m.join(i$1,"README.md"),`# ${c}
83
+ `}async function vt(t,n){await v.outputFile(m.join(t,"rapidkit"),At(n),{encoding:"utf-8",mode:493}),await v.outputFile(m.join(t,"rapidkit.cmd"),Dt(n),"utf-8");}async function oe(t,n){let{skipGit:e=false,testMode:r=false,demoMode:s=false,dryRun:d=false,yes:u=false,userConfig:g={},installMethod:y,profile:h}=n,c=t||"rapidkit",i$1=m.resolve(process.cwd(),c);if(await v.pathExists(i$1))throw new i(c);if(d){await Ft(i$1,c,s,g);return}if(s){await Kt(i$1,c,e);return}let a=new Set(["python-only","polyglot","enterprise"]),p=h||"";if(!u&&!h){let{selectedProfile:f}=await U.prompt([{type:"rawlist",name:"selectedProfile",message:"Select workspace profile:",choices:[{name:"minimal \u2014 Foundation files only (fastest bootstrap, mixed projects)",value:"minimal"},{name:"java-only \u2014 Java runtime (Spring Boot services)",value:"java-only"},{name:"python-only \u2014 Python + Poetry (FastAPI, Django, ML pipelines)",value:"python-only"},{name:"node-only \u2014 Node.js runtime (NestJS, Express, Next.js)",value:"node-only"},{name:"go-only \u2014 Go runtime (Fiber, Gin, gRPC, microservices)",value:"go-only"},{name:"polyglot \u2014 Python + Node.js + Go + Java multi-runtime workspace",value:"polyglot"},{name:"enterprise \u2014 Polyglot + governance + Sigstore verification",value:"enterprise"}],default:1}]);p=f;}else p||(p="minimal");let b=!u&&a.has(p),E=typeof g.pythonVersion=="string"&&g.pythonVersion.trim().length>0?g.pythonVersion.trim():void 0,S=y||g.defaultInstallMethod||"poetry",I=b?await $t():{poetry:true,pipx:true},T=b?await Ct(E):{choices:ft.map(f=>({name:f,value:f})),defaultValue:A},Y=St(S,I),It=[{name:I.poetry?"\u{1F3AF} Poetry (Recommended - includes virtual env)":"\u{1F3AF} Poetry (Recommended - includes virtual env) \u2014 not detected (we can install it)",value:"poetry"},{name:"\u{1F4E6} pip with venv (Standard, zero extra tools)",value:"venv"},{name:I.pipx?"\u{1F527} pipx (Global isolated install)":"\u{1F527} pipx (Global isolated install) \u2014 not detected (we can install it)",value:"pipx"}],x=b?await U.prompt([{type:"rawlist",name:"pythonVersion",message:"Select Python version for RapidKit:",choices:T.choices,default:T.defaultValue},{type:"rawlist",name:"installMethod",message:"How would you like to manage the workspace environment?",choices:It,default:Y}]):await(async()=>{let f=y||g.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})();return {pythonVersion:g.pythonVersion||"3.10",installMethod:f}})();if(new Set(["go-only","java-only","node-only","minimal"]).has(p)){let f=z("Creating workspace").start();try{await v.ensureDir(i$1),f.succeed("Directory created"),await et(i$1,c,"venv",void 0),await nt(i$1,c,"venv",void 0,p),await H(i$1),await ot(i$1,c);let R={"go-only":"Go-only","java-only":"Java-only","node-only":"Node.js-only",minimal:"Minimal"};if(await v.outputFile(m.join(i$1,"README.md"),`# ${c}
84
84
 
85
85
  RapidKit **${R[p]}** workspace.
86
86
 
@@ -91,6 +91,10 @@ RapidKit **${R[p]}** workspace.
91
91
  cd my-api
92
92
  npx rapidkit init
93
93
  npx rapidkit dev
94
+ `:p==="java-only"?`npx rapidkit create project springboot.standard my-service
95
+ cd my-service
96
+ npx rapidkit init
97
+ npx rapidkit dev
94
98
  `:p==="node-only"?`npx rapidkit create project nestjs.standard my-app
95
99
  cd my-app
96
100
  npx rapidkit init
@@ -99,28 +103,29 @@ npx rapidkit dev
99
103
  cd <project-name>
100
104
  npx rapidkit init
101
105
  npx rapidkit dev
102
- `)+"```\n","utf-8"),!e){f.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:i$1}),f.succeed("Git repository initialized");}catch{f.warn("Could not initialize git repository");}}try{let{registerWorkspace:k}=await import('./workspace-VXNLNKCM.js');await k(i$1,c);}catch{}if(console.log(o.green(`
106
+ `)+"```\n","utf-8"),!e){f.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:i$1}),f.succeed("Git repository initialized");}catch{f.warn("Could not initialize git repository");}}try{let{registerWorkspace:k}=await import('./workspace-VN3VF62I.js');await k(i$1,c);}catch{}if(console.log(o.green(`
103
107
  \u2728 Workspace created!
104
108
  `)),console.log(o.cyan("\u{1F4C2} Location:"),o.white(i$1)),console.log(o.cyan(`
105
109
  \u{1F680} Get started:
106
110
  `)),console.log(o.white(` cd ${c}`)),p==="go-only"){console.log(o.white(" npx rapidkit create project gofiber.standard my-api")),console.log(o.white(" cd my-api")),console.log(o.white(" npx rapidkit init")),console.log(o.white(` npx rapidkit dev
107
- `)),console.log(o.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:k}=await execa("go",["version"],{timeout:3e3}),_=k.match(/go version go(\d+\.\d+(?:\.\d+)?)/),S=_?_[1]:"unknown";console.log(o.gray(`\u{1F439} Go ${S} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(o.yellow(`
108
- \u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else p==="node-only"?(console.log(o.white(" npx rapidkit create project nestjs.standard my-app")),console.log(o.white(" cd my-app")),console.log(o.white(" npx rapidkit init")),console.log(o.white(` npx rapidkit dev
111
+ `)),console.log(o.gray("\u{1F4A1} No Python required \u2014 Go kits run entirely through the npm package."));try{let{stdout:k}=await execa("go",["version"],{timeout:3e3}),_=k.match(/go version go(\d+\.\d+(?:\.\d+)?)/),M=_?_[1]:"unknown";console.log(o.gray(`\u{1F439} Go ${M} detected \u2014 ready for gofiber.standard / gogin.standard projects`));}catch{console.log(o.yellow(`
112
+ \u26A0\uFE0F Go is not installed \u2014 install it from https://go.dev/dl/`));}}else p==="java-only"?(console.log(o.white(" npx rapidkit create project springboot.standard my-service")),console.log(o.white(" cd my-service")),console.log(o.white(" npx rapidkit init")),console.log(o.white(` npx rapidkit dev
113
+ `)),console.log(o.gray("\u{1F4A1} No Python required \u2014 Spring Boot kit runs through the npm package with Java tooling."))):p==="node-only"?(console.log(o.white(" npx rapidkit create project nestjs.standard my-app")),console.log(o.white(" cd my-app")),console.log(o.white(" npx rapidkit init")),console.log(o.white(` npx rapidkit dev
109
114
  `)),console.log(o.gray("\u{1F4A1} Python engine will be installed automatically on first `create project nestjs.standard`."))):(console.log(o.white(" npx rapidkit create project")),console.log(o.white(" cd <project-name>")),console.log(o.white(" npx rapidkit init")),console.log(o.white(` npx rapidkit dev
110
- `)),console.log(o.gray("\u{1F4A1} Bootstrap a specific runtime any time: rapidkit bootstrap --profile python-only|node-only|go-only")));console.log("");}catch(R){throw f.fail("Failed to create workspace"),console.error(o.red(`
115
+ `)),console.log(o.gray("\u{1F4A1} Bootstrap a specific runtime any time: rapidkit bootstrap --profile java-only|python-only|node-only|go-only")));console.log("");}catch(R){throw f.fail("Failed to create workspace"),console.error(o.red(`
111
116
  \u274C Error:`),R),R}return}{let f=C(),R=false;try{await execa(f,["--version"],{timeout:5e3}),R=true;}catch{try{await execa("python",["--version"],{timeout:5e3}),R=true;}catch{R=false;}}R||(console.log(o.red(`
112
117
  \u274C Python 3.10+ is required for the "${p}" profile.
113
118
  `)),console.log(o.cyan(`\u{1F4A1} How to install Python:
114
119
  `)),console.log(o.white(" Ubuntu / Debian: sudo apt install python3.10")),console.log(o.white(" macOS (Homebrew): brew install python@3.10")),console.log(o.white(` Windows: https://python.org/downloads
115
120
  `)),console.log(o.gray(` After installing Python, run: npx rapidkit ${c}
116
- `)),process.exit(1));}a$1.step(1,3,"Setting up RapidKit environment");let P=z("Creating directory").start();try{await v.ensureDir(i$1),P.succeed("Directory created"),P.start("Detecting Python version");let f=null,R=await kt(x.pythonVersion);if(R)f=await pt(R),f?(a$1.info(` Detected Python ${f}`),P.succeed(`Python ${f} detected`)):P.warn("Could not detect exact Python version");else {let k=C();f=await pt(k),f?P.succeed(`Python ${f} detected`):P.warn("Could not detect Python version, proceeding with defaults");}if(x.installMethod==="poetry"&&!await wt()&&(P.warn("Poetry not found \u2014 auto-fallback to pip + venv"),x.installMethod="venv"),await et(i$1,c,x.installMethod,f||void 0),f&&await jt(i$1,f),await nt(i$1,c,x.installMethod,f||x.pythonVersion,p||h),await H(i$1),await ot(i$1,c),x.installMethod==="poetry")try{await bt(i$1,x.pythonVersion,P,r,g,u);}catch(k){let _=k?.details||k?.message||String(k);if(_.includes("pyenv")||_.includes("exit status 127")||_.includes("returned non-zero exit status 127")){P.warn("Poetry encountered Python discovery issues, trying venv method"),a$1.debug(`Poetry error (attempting venv fallback): ${_}`);try{await rt(i$1,x.pythonVersion,P,r,g),x.installMethod="venv";}catch(at){throw at}}else throw k}else x.installMethod==="venv"?await rt(i$1,x.pythonVersion,P,r,g):await Pt(i$1,P,r,g,u);if(await vt(i$1,x.installMethod),await xt(i$1,x.installMethod),P.succeed("RapidKit environment ready!"),!n.skipGit){P.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit environment"],{cwd:i$1}),P.succeed("Git repository initialized");}catch{P.warn("Could not initialize git repository");}}try{let{registerWorkspace:k}=await import('./workspace-VXNLNKCM.js');await k(i$1,c);}catch{console.warn(o.gray("Note: Could not register workspace in shared registry"));}if(console.log(o.green(`
121
+ `)),process.exit(1));}a$1.step(1,3,"Setting up RapidKit environment");let P=z("Creating directory").start();try{await v.ensureDir(i$1),P.succeed("Directory created"),P.start("Detecting Python version");let f=null,R=await kt(x.pythonVersion);if(R)f=await pt(R),f?(a$1.info(` Detected Python ${f}`),P.succeed(`Python ${f} detected`)):P.warn("Could not detect exact Python version");else {let k=C();f=await pt(k),f?P.succeed(`Python ${f} detected`):P.warn("Could not detect Python version, proceeding with defaults");}if(x.installMethod==="poetry"&&!await wt()&&(P.warn("Poetry not found \u2014 auto-fallback to pip + venv"),x.installMethod="venv"),await et(i$1,c,x.installMethod,f||void 0),f&&await jt(i$1,f),await nt(i$1,c,x.installMethod,f||x.pythonVersion,p||h),await H(i$1),await ot(i$1,c),x.installMethod==="poetry")try{await bt(i$1,x.pythonVersion,P,r,g,u);}catch(k){let _=k?.details||k?.message||String(k);if(_.includes("pyenv")||_.includes("exit status 127")||_.includes("returned non-zero exit status 127")){P.warn("Poetry encountered Python discovery issues, trying venv method"),a$1.debug(`Poetry error (attempting venv fallback): ${_}`);try{await rt(i$1,x.pythonVersion,P,r,g),x.installMethod="venv";}catch(at){throw at}}else throw k}else x.installMethod==="venv"?await rt(i$1,x.pythonVersion,P,r,g):await Pt(i$1,P,r,g,u);if(await vt(i$1,x.installMethod),await xt(i$1,x.installMethod),P.succeed("RapidKit environment ready!"),!n.skipGit){P.start("Initializing git repository");try{await execa("git",["init"],{cwd:i$1}),await execa("git",["add","."],{cwd:i$1}),await execa("git",["commit","-m","Initial commit: RapidKit environment"],{cwd:i$1}),P.succeed("Git repository initialized");}catch{P.warn("Could not initialize git repository");}}try{let{registerWorkspace:k}=await import('./workspace-VN3VF62I.js');await k(i$1,c);}catch{console.warn(o.gray("Note: Could not register workspace in shared registry"));}if(console.log(o.green(`
117
122
  \u2728 RapidKit environment created successfully!
118
123
  `)),console.log(o.cyan("\u{1F4C2} Location:"),o.white(i$1)),console.log(o.cyan(`\u{1F680} Get started:
119
- `)),console.log(o.white(` cd ${c}`)),x.installMethod==="poetry"){let k="source $(poetry env info --path)/bin/activate";try{D();let{stdout:_}=await execa("poetry",["--version"]),S=_.match(/Poetry.*?(\d+)\.(\d+)/);S&&(parseInt(S[1])>=2?k="source $(poetry env info --path)/bin/activate":k="poetry shell");}catch{}console.log(o.white(` ${k} # Or: poetry run rapidkit`)),console.log(o.white(" rapidkit create # Interactive mode")),console.log(o.white(" cd <project-name>")),console.log(o.white(" rapidkit init")),console.log(o.white(" rapidkit dev"));}else x.installMethod==="venv"?(console.log(o.white(" source .venv/bin/activate # On Windows: .venv\\Scripts\\activate")),console.log(o.white(" rapidkit create # Interactive mode")),console.log(o.white(" cd <project-name>")),console.log(o.white(" rapidkit init")),console.log(o.white(" rapidkit dev"))):(console.log(o.white(" rapidkit create # Interactive mode")),console.log(o.white(" cd <project-name>")),console.log(o.white(" rapidkit init")),console.log(o.white(" rapidkit dev")));console.log(o.white(`
124
+ `)),console.log(o.white(` cd ${c}`)),x.installMethod==="poetry"){let k="source $(poetry env info --path)/bin/activate";try{D();let{stdout:_}=await execa("poetry",["--version"]),M=_.match(/Poetry.*?(\d+)\.(\d+)/);M&&(parseInt(M[1])>=2?k="source $(poetry env info --path)/bin/activate":k="poetry shell");}catch{}console.log(o.white(` ${k} # Or: poetry run rapidkit`)),console.log(o.white(" rapidkit create # Interactive mode")),console.log(o.white(" cd <project-name>")),console.log(o.white(" rapidkit init")),console.log(o.white(" rapidkit dev"));}else x.installMethod==="venv"?(console.log(o.white(" source .venv/bin/activate # On Windows: .venv\\Scripts\\activate")),console.log(o.white(" rapidkit create # Interactive mode")),console.log(o.white(" cd <project-name>")),console.log(o.white(" rapidkit init")),console.log(o.white(" rapidkit dev"))):(console.log(o.white(" rapidkit create # Interactive mode")),console.log(o.white(" cd <project-name>")),console.log(o.white(" rapidkit init")),console.log(o.white(" rapidkit dev")));console.log(o.white(`
120
125
  \u{1F4A1} For more information, check the README.md file.`)),console.log(o.cyan(`
121
126
  \u{1F4DA} RapidKit commands:`)),console.log(o.white(" rapidkit create - Create a new project (interactive)")),console.log(o.white(" rapidkit dev - Run development server")),console.log(o.white(" rapidkit add module <name> - Add a module (e.g., settings)")),console.log(o.white(" rapidkit list - List available kits")),console.log(o.white(" rapidkit modules - List available modules")),console.log(o.white(` rapidkit --help - Show all commands
122
- `));try{let{stdout:k}=await execa("go",["version"],{timeout:3e3}),_=k.match(/go version go(\d+\.\d+(?:\.\d+)?)/),S=_?_[1]:"unknown";console.log(o.gray(`\u{1F439} Go toolchain: Go ${S} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(o.yellow("\u26A0\uFE0F Go toolchain not installed \u2014 needed for gofiber.standard projects")),console.log(o.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(f){P.fail("Failed to create RapidKit environment"),console.error(o.red(`
123
- \u274C Error:`),f);try{await v.remove(i$1);}catch{}throw f}}async function kt(t){let n=[];if(!a$2())try{let{stdout:d}=await execa("pyenv",["which","python"]),u=d.trim();u&&n.push(u);}catch{}let e$1=Number(t.split(".")[1]),r=e(e$1,10).map(d=>d.command).filter(Boolean);n.push(`python${t}`,...r,...d$1());let s=[...new Set(n)];for(let d of s)try{let u=d==="py"?["-3","--version"]:["--version"],g=d==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:y}=await execa(d,u,{timeout:2e3}),h=y.match(/Python (\d+\.\d+)/)?.[1];if(h&&K(h,t))return await execa(d,g,{timeout:2e3}),d}catch{continue}return null}async function bt(t,n,e,r,s,d=false){await St(e,d),e.start("Finding Python interpreter");let u=await kt(n);u?(a$1.debug(`Found working Python: ${u}`),e.succeed("Python found")):e.warn("Could not verify Python path, proceeding with default"),e.start("Initializing Poetry project");let g=m.join(t,"pyproject.toml"),h=(await v.pathExists(g)?await promises.readFile(g,"utf-8"):"").includes("rapidkit-core");if(h)e.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${n}`],{cwd:t}),e.succeed("Poetry project initialized");let p=await promises.readFile(g,"utf-8");p.includes("[tool.poetry]")?p=p.replace("[tool.poetry]",`[tool.poetry]
127
+ `));try{let{stdout:k}=await execa("go",["version"],{timeout:3e3}),_=k.match(/go version go(\d+\.\d+(?:\.\d+)?)/),M=_?_[1]:"unknown";console.log(o.gray(`\u{1F439} Go toolchain: Go ${M} detected \u2014 ready for gofiber.standard projects`));}catch{console.log(o.yellow("\u26A0\uFE0F Go toolchain not installed \u2014 needed for gofiber.standard projects")),console.log(o.gray(" Install: https://go.dev/dl/"));}console.log("");}catch(f){P.fail("Failed to create RapidKit environment"),console.error(o.red(`
128
+ \u274C Error:`),f);try{await v.remove(i$1);}catch{}throw f}}async function kt(t){let n=[];if(!a$2())try{let{stdout:d}=await execa("pyenv",["which","python"]),u=d.trim();u&&n.push(u);}catch{}let e$1=Number(t.split(".")[1]),r=e(e$1,10).map(d=>d.command).filter(Boolean);n.push(`python${t}`,...r,...d$1());let s=[...new Set(n)];for(let d of s)try{let u=d==="py"?["-3","--version"]:["--version"],g=d==="py"?["-3","-c","import sys; sys.exit(0)"]:["-c","import sys; sys.exit(0)"],{stdout:y}=await execa(d,u,{timeout:2e3}),h=y.match(/Python (\d+\.\d+)/)?.[1];if(h&&K(h,t))return await execa(d,g,{timeout:2e3}),d}catch{continue}return null}async function bt(t,n,e,r,s,d=false){await Mt(e,d),e.start("Finding Python interpreter");let u=await kt(n);u?(a$1.debug(`Found working Python: ${u}`),e.succeed("Python found")):e.warn("Could not verify Python path, proceeding with default"),e.start("Initializing Poetry project");let g=m.join(t,"pyproject.toml"),h=(await v.pathExists(g)?await promises.readFile(g,"utf-8"):"").includes("rapidkit-core");if(h)e.succeed("Poetry project initialized");else {await execa("poetry",["init","--no-interaction","--python",`^${n}`],{cwd:t}),e.succeed("Poetry project initialized");let p=await promises.readFile(g,"utf-8");p.includes("[tool.poetry]")?p=p.replace("[tool.poetry]",`[tool.poetry]
124
129
  package-mode = false`):p.includes("[project]")&&(p.includes("[build-system]")?p=p.replace("[build-system]",`
125
130
  [tool.poetry]
126
131
  package-mode = false
@@ -129,13 +134,13 @@ package-mode = false
129
134
 
130
135
  [tool.poetry]
131
136
  package-mode = false
132
- `),await promises.writeFile(g,p,"utf-8");}e.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:t}),e.succeed("Poetry configured");}catch{e.warn("Could not configure Poetry virtualenvs.in-project");}e.start("Creating virtualenv");let c=u||C(),i=f(m.join(t,".venv"));try{await execa(c,["-m","venv",".venv"],{cwd:t,timeout:6e4}),e.succeed("Virtualenv created");}catch(a){a$1.debug(`python -m venv failed: ${a}`),e.warn("Could not pre-create virtualenv, Poetry will try"),i=u||C();}try{await execa("poetry",["env","use",i||C()],{cwd:t}),a$1.debug(`Poetry env set to: ${i}`);}catch(a){a$1.debug(`Could not set Poetry env: ${a}`);}if(e.start("Installing RapidKit"),h&&!r){let a=d$2(s||{}),p=a?await v.pathExists(a):false,b=p&&a?a:"rapidkit-core";a&&!p&&a$1.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${a}. Falling back to PyPI.`),e.text=p?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let E=false,M=null;for(let I=1;I<=3;I++)try{await execa(i,["-m","pip","install",b,"--quiet"],{cwd:t,timeout:18e4}),E=true;break}catch(T){M=T,a$1.debug(`pip install rapidkit-core attempt ${I} failed: ${T}`),I<3&&(e.text=`Retrying installation (attempt ${I+1}/3)`,await new Promise(Y=>setTimeout(Y,2e3)));}if(!E){let I=M?.stderr||M?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${I}`),I.includes("Could not find")||I.includes("No matching distribution")?new l:new k("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
137
+ `),await promises.writeFile(g,p,"utf-8");}e.start("Configuring Poetry");try{await execa("poetry",["config","virtualenvs.in-project","true","--local"],{cwd:t}),e.succeed("Poetry configured");}catch{e.warn("Could not configure Poetry virtualenvs.in-project");}e.start("Creating virtualenv");let c=u||C(),i=f(m.join(t,".venv"));try{await execa(c,["-m","venv",".venv"],{cwd:t,timeout:6e4}),e.succeed("Virtualenv created");}catch(a){a$1.debug(`python -m venv failed: ${a}`),e.warn("Could not pre-create virtualenv, Poetry will try"),i=u||C();}try{await execa("poetry",["env","use",i||C()],{cwd:t}),a$1.debug(`Poetry env set to: ${i}`);}catch(a){a$1.debug(`Could not set Poetry env: ${a}`);}if(e.start("Installing RapidKit"),h&&!r){let a=d$2(s||{}),p=a?await v.pathExists(a):false,b=p&&a?a:"rapidkit-core";a&&!p&&a$1.warn(`RAPIDKIT_DEV_PATH is set but path does not exist: ${a}. Falling back to PyPI.`),e.text=p?"Installing RapidKit from local path":"Installing RapidKit from PyPI";let E=false,S=null;for(let I=1;I<=3;I++)try{await execa(i,["-m","pip","install",b,"--quiet"],{cwd:t,timeout:18e4}),E=true;break}catch(T){S=T,a$1.debug(`pip install rapidkit-core attempt ${I} failed: ${T}`),I<3&&(e.text=`Retrying installation (attempt ${I+1}/3)`,await new Promise(Y=>setTimeout(Y,2e3)));}if(!E){let I=S?.stderr||S?.message||"Unknown error";throw a$1.debug(`All pip install attempts failed. Last error: ${I}`),I.includes("Could not find")||I.includes("No matching distribution")?new l:new k("Install rapidkit-core with pip",new Error(`Failed to install rapidkit-core after 3 attempts.
133
138
  Error: ${I}
134
139
 
135
140
  Possible solutions:
136
141
  1. Check your internet connection
137
142
  2. Try installing manually: cd ${m.basename(t)} && poetry add rapidkit-core
138
- 3. Use venv method instead: npx rapidkit ${m.basename(t)} --install-method=venv`))}}else {e.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:12e4}),e.succeed("Poetry environment synced");}catch(a){a$1.debug(`poetry install --no-root failed: ${a}`),e.warn("Could not sync Poetry environment, proceeding with add command");}if(e.start("Installing RapidKit"),r){let a=d$2(s||{});if(!a)throw new k("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${a}`),e.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",a],{cwd:t});}else {e.text="Installing RapidKit from PyPI";let a=false,p=null;for(let b=1;b<=3;b++)try{await execa("poetry",["add","rapidkit-core"],{cwd:t,timeout:6e4*b}),a=true;break}catch(E){p=E,a$1.debug(`Poetry add attempt ${b} failed: ${E}`),b<3&&(e.text=`Retrying installation (attempt ${b+1}/3)`,await new Promise(M=>setTimeout(M,2e3)));}if(!a){let b=p?.stderr||p?.message||"Unknown error";throw a$1.debug(`All Poetry install attempts failed. Last error: ${b}`),b.includes("Could not find")||b.includes("No matching distribution")?new l:new k("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
143
+ 3. Use venv method instead: npx rapidkit ${m.basename(t)} --install-method=venv`))}}else {e.text="Syncing Poetry environment";try{await execa("poetry",["install","--no-root"],{cwd:t,timeout:12e4}),e.succeed("Poetry environment synced");}catch(a){a$1.debug(`poetry install --no-root failed: ${a}`),e.warn("Could not sync Poetry environment, proceeding with add command");}if(e.start("Installing RapidKit"),r){let a=d$2(s||{});if(!a)throw new k("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${a}`),e.text="Installing RapidKit from local path (test mode)",await execa("poetry",["add",a],{cwd:t});}else {e.text="Installing RapidKit from PyPI";let a=false,p=null;for(let b=1;b<=3;b++)try{await execa("poetry",["add","rapidkit-core"],{cwd:t,timeout:6e4*b}),a=true;break}catch(E){p=E,a$1.debug(`Poetry add attempt ${b} failed: ${E}`),b<3&&(e.text=`Retrying installation (attempt ${b+1}/3)`,await new Promise(S=>setTimeout(S,2e3)));}if(!a){let b=p?.stderr||p?.message||"Unknown error";throw a$1.debug(`All Poetry install attempts failed. Last error: ${b}`),b.includes("Could not find")||b.includes("No matching distribution")?new l:new k("Install rapidkit-core with Poetry",new Error(`Failed to install rapidkit-core after 3 attempts.
139
144
  Error: ${b}
140
145
 
141
146
  Possible solutions:
@@ -154,7 +159,7 @@ Possible solutions:
154
159
  1. Check your internet connection
155
160
  2. Try installing manually: cd ${m.basename(t)} && ${f(".venv")} -m pip install rapidkit-core
156
161
  3. Use Poetry instead: npx rapidkit ${m.basename(t)} --install-method=poetry`))}}e.succeed("RapidKit installed in project virtualenv");try{let{checkRapidkitCoreAvailable:y}=await import('./pythonRapidkitExec-K2SFGAYJ.js');if(!await y()&&!r){e.start("Checking optional global pipx installation");let c=await q(e,true);try{e.start("Installing RapidKit globally with pipx for CLI access"),await F(c,["install","rapidkit-core"]),e.succeed("RapidKit installed globally");}catch(i){e.warn("Could not install globally (non-fatal, project virtualenv has RapidKit)"),a$1.debug(`pipx install failed: ${i}`);}}}catch(y){e.succeed("Skipped optional global pipx installation"),a$1.debug(`Global install check skipped: ${y}`);}}async function Pt(t,n,e,r,s=false){let d=await q(n,s);if(n.start("Installing RapidKit globally with pipx"),e){let u=d$2(r||{});if(!u)throw new k("Test mode installation",new Error("No local RapidKit path configured. Set RAPIDKIT_DEV_PATH environment variable."));a$1.debug(`Installing from local path: ${u}`),n.text="Installing RapidKit from local path (test mode)",await F(d,["install","-e",u]);}else {n.text="Installing RapidKit from PyPI";try{await F(d,["install","rapidkit-core"]);}catch{throw new l}}n.succeed("RapidKit installed globally"),await v.outputFile(m.join(t,".rapidkit-global"),`RapidKit installed globally with pipx
157
- `,"utf-8");}async function ne(t,n){let{skipGit:e=false,testMode:r=false,userConfig:s={},yes:d=false,installMethod:u,pythonVersion:g="3.10"}=n||{},y=u||s.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),h=y==="poetry"&&!await wt()?"venv":y;await et(t,m.basename(t),h),await H(t),await nt(t,m.basename(t),h,g,n?.profile);let c=z("Registering workspace").start();try{h==="poetry"?(await ot(t,m.basename(t)),await bt(t,g,c,r,s,d)):h==="venv"?await rt(t,g,c,r,s):await Pt(t,c,r,s,d),await vt(t,h),await xt(t,h),c.succeed("Workspace registered");try{let{registerWorkspace:i}=await import('./workspace-VXNLNKCM.js');await i(t,m.basename(t));}catch{}if(!e){c.start("Initializing git repository");try{await execa("git",["init"],{cwd:t}),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:t}),c.succeed("Git repository initialized");}catch{c.warn("Could not initialize git repository");}}}catch(i){throw c.fail("Failed to register workspace"),i}}async function xt(t,n){let e=n==="poetry"?`source $(poetry env info --path)/bin/activate
162
+ `,"utf-8");}async function ne(t,n){let{skipGit:e=false,testMode:r=false,userConfig:s={},yes:d=false,installMethod:u,pythonVersion:g="3.10"}=n||{},y=u||s.defaultInstallMethod||await(async()=>{try{return await execa("poetry",["--version"],{timeout:3e3}),"poetry"}catch{return a$1.warn("Poetry not found \u2014 auto-selecting venv. Pass --install-method poetry to override."),"venv"}})(),h=y==="poetry"&&!await wt()?"venv":y;await et(t,m.basename(t),h),await H(t),await nt(t,m.basename(t),h,g,n?.profile);let c=z("Registering workspace").start();try{h==="poetry"?(await ot(t,m.basename(t)),await bt(t,g,c,r,s,d)):h==="venv"?await rt(t,g,c,r,s):await Pt(t,c,r,s,d),await vt(t,h),await xt(t,h),c.succeed("Workspace registered");try{let{registerWorkspace:i}=await import('./workspace-VN3VF62I.js');await i(t,m.basename(t));}catch{}if(!e){c.start("Initializing git repository");try{await execa("git",["init"],{cwd:t}),await execa("git",["add","."],{cwd:t}),await execa("git",["commit","-m","Initial commit: RapidKit workspace"],{cwd:t}),c.succeed("Git repository initialized");}catch{c.warn("Could not initialize git repository");}}}catch(i){throw c.fail("Failed to register workspace"),i}}async function xt(t,n){let e=n==="poetry"?`source $(poetry env info --path)/bin/activate
158
163
  # Or simply use: poetry run rapidkit <command>`:n==="venv"?"source .venv/bin/activate # On Windows: .venv\\Scripts\\activate":"N/A (globally installed)",r=n==="poetry"?`# No activation needed (recommended):
159
164
  ./rapidkit --help
160
165
  # or:
@@ -0,0 +1,141 @@
1
+ import {b}from'./chunk-Q7ULIFQA.js';import {promises}from'fs';import a from'path';import E from'nunjucks';import t from'chalk';import _ from'ora';import {fileURLToPath}from'url';import {execa}from'execa';import N from'crypto';var P=fileURLToPath(import.meta.url),K=a.dirname(P);function T(i=32){let e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",v=N.randomBytes(i),r="";for(let p=0;p<i;p++)r+=e[v[p]%e.length];return r}async function U(i,e){let r=(e.template||"fastapi")==="fastapi",p=r?"FastAPI":"NestJS",d=e.kit_name||(r?"fastapi.standard":"nestjs.standard"),I=d.replace(".","/"),h=_(`Generating ${p} project...`).start();try{let u=a.resolve(K,".."),l;d==="fastapi.ddd"?l="fastapi-ddd":d.startsWith("fastapi")?l="fastapi-standard":l="nestjs-standard";let k=a.join(u,"templates","kits",l),w=E.configure(k,{autoescape:false,trimBlocks:true,lstripBlocks:true});w.addFilter("generate_secret",function(n,o=32){return T(o)});let S={project_name:e.project_name,author:e.author||"RapidKit User",description:e.description||(r?"FastAPI service generated with RapidKit":"NestJS application generated with RapidKit"),app_version:e.app_version||"0.1.0",license:e.license||"MIT",package_manager:e.package_manager||"npm",node_version:e.node_version||"20.0.0",database_type:e.database_type||"postgresql",include_caching:e.include_caching||false,created_at:new Date().toISOString(),rapidkit_version:b()},j;r?j=["src/main.py.j2","src/__init__.py.j2","src/cli.py.j2","src/routing/__init__.py.j2","src/routing/health.py.j2","src/modules/__init__.py.j2","tests/__init__.py.j2","README.md.j2","pyproject.toml.j2","Makefile.j2",".rapidkit/__init__.py.j2",".rapidkit/project.json.j2",".rapidkit/cli.py.j2",".rapidkit/rapidkit.j2",".rapidkit/activate.j2","rapidkit.j2","rapidkit.cmd.j2"]:j=["src/main.ts.j2","src/app.module.ts.j2","src/app.controller.ts.j2","src/app.service.ts.j2","src/config/configuration.ts.j2","src/config/validation.ts.j2","src/config/index.ts.j2","src/modules/index.ts.j2","src/examples/examples.module.ts.j2","src/examples/examples.controller.ts.j2","src/examples/examples.service.ts.j2","src/examples/dto/create-note.dto.ts.j2","test/app.controller.spec.ts.j2","test/examples.controller.spec.ts.j2","test/app.e2e-spec.ts.j2","test/jest-e2e.json.j2","package.json.j2","tsconfig.json.j2","tsconfig.build.json.j2","nest-cli.json.j2","jest.config.ts.j2","eslint.config.cjs.j2",".env.example.j2","docker-compose.yml.j2","Dockerfile.j2","README.md.j2",".rapidkit/project.json.j2",".rapidkit/rapidkit.j2",".rapidkit/rapidkit.cmd.j2",".rapidkit/activate.j2","rapidkit.j2","rapidkit.cmd.j2"];for(let n of j){let o=a.join(k,n);try{await promises.access(o);}catch{continue}let y=await promises.readFile(o,"utf-8"),m;try{m=w.renderString(y,S);}catch(R){throw console.error(`Failed to render template: ${n}`),R}let c=n.replace(/\.j2$/,""),f=a.join(i,c);await promises.mkdir(a.dirname(f),{recursive:true}),await promises.writeFile(f,m),(c.endsWith(".rapidkit/rapidkit")||c.endsWith(".rapidkit/cli.py")||c.endsWith(".rapidkit/activate")||c==="rapidkit")&&await promises.chmod(f,493);}if(r){let n=a.join(k,".rapidkit","context.json"),o=a.join(i,".rapidkit","context.json");try{await promises.mkdir(a.join(i,".rapidkit"),{recursive:true}),await promises.copyFile(n,o);}catch{await promises.mkdir(a.join(i,".rapidkit"),{recursive:true});let m=e.engine||"pip";await promises.writeFile(o,JSON.stringify({engine:m,created_by:"rapidkit-npm-fallback"},null,2));}}let x=a.join(i,".rapidkit");await promises.mkdir(x,{recursive:true});let F=a.join(x,"project.json"),A={kit_name:d,profile:I,created_at:new Date().toISOString(),created_by:"rapidkit-npm-fallback",runtime:r?"python":"node"};await promises.writeFile(F,JSON.stringify(A,null,2),"utf-8");let D=r?`# Python
2
+ __pycache__/
3
+ *.py[cod]
4
+ *$py.class
5
+ *.so
6
+ .Python
7
+ build/
8
+ develop-eggs/
9
+ dist/
10
+ downloads/
11
+ eggs/
12
+ .eggs/
13
+ lib/
14
+ lib64/
15
+ parts/
16
+ sdist/
17
+ var/
18
+ wheels/
19
+ *.egg-info/
20
+ .installed.cfg
21
+ *.egg
22
+
23
+ # Virtual environments
24
+ .venv/
25
+ venv/
26
+ ENV/
27
+ env/
28
+
29
+ # IDEs
30
+ .vscode/
31
+ .idea/
32
+ *.swp
33
+ *.swo
34
+ *~
35
+
36
+ # OS
37
+ .DS_Store
38
+ Thumbs.db
39
+
40
+ # Project specific
41
+ .env
42
+ .env.local
43
+ `:`# Node artifacts
44
+ node_modules/
45
+ dist/
46
+ .tmp/
47
+ .env
48
+ .env.*
49
+ !.env.example
50
+
51
+ # Logs
52
+ logs/
53
+ *.log
54
+ npm-debug.log*
55
+ yarn-debug.log*
56
+ yarn-error.log*
57
+ pnpm-debug.log*
58
+
59
+ # OS
60
+ .DS_Store
61
+ Thumbs.db
62
+
63
+ # IDEs
64
+ .idea/
65
+ .vscode/
66
+
67
+ # Coverage
68
+ coverage/
69
+ `;if(await promises.writeFile(a.join(i,".gitignore"),D),h.succeed(`${p} project generated!`),!e.skipGit){let n=_("Initializing git repository...").start();try{await execa("git",["init"],{cwd:i}),await execa("git",["add","."],{cwd:i}),await execa("git",["commit","-m",`Initial commit: ${p} project via RapidKit`],{cwd:i}),n.succeed("Git repository initialized");}catch{n.warn("Could not initialize git repository");}}if(!r&&!e.skipInstall){let n=e.package_manager||"npm",o=_(`Installing dependencies with ${n}...`).start();try{await execa(n,n==="yarn"?["install"]:n==="pnpm"?["install"]:["install"],{cwd:i}),o.succeed("Dependencies installed");}catch{o.warn(`Could not install dependencies. Run '${n} install' manually.`);}}let $=a.basename(i);console.log(`
70
+ ${t.yellow("\u26A0\uFE0F Limited offline mode:")} This project was created using basic templates.
71
+ ${t.gray("For full kit features, install Python 3.10+ and rapidkit-core:")}
72
+ ${t.cyan(" sudo apt install python3 python3-pip python3-venv")}
73
+ ${t.cyan(" pip install rapidkit-core")}
74
+ `),console.log(r?`
75
+ ${t.green("\u2728 FastAPI project created successfully!")}
76
+
77
+ ${t.bold("\u{1F4C2} Project structure:")}
78
+ ${i}/
79
+ \u251C\u2500\u2500 .rapidkit/ # RapidKit CLI module
80
+ \u251C\u2500\u2500 src/
81
+ \u2502 \u251C\u2500\u2500 main.py # FastAPI application
82
+ \u2502 \u251C\u2500\u2500 cli.py # CLI commands
83
+ \u2502 \u251C\u2500\u2500 routing/ # API routes
84
+ \u2502 \u2514\u2500\u2500 modules/ # Module system
85
+ \u251C\u2500\u2500 tests/ # Test suite
86
+ \u251C\u2500\u2500 pyproject.toml # Poetry configuration
87
+ \u2514\u2500\u2500 README.md
88
+
89
+ ${t.bold("\u{1F680} Get started:")}
90
+ ${t.cyan(`cd ${$}`)}
91
+ ${t.cyan("npx rapidkit init")} ${t.gray("# Install dependencies")}
92
+ ${t.cyan("npx rapidkit dev")} ${t.gray("# Start dev server")}
93
+
94
+ ${t.bold("\u{1F4DA} Available commands:")}
95
+ npx rapidkit init # Install dependencies (poetry install)
96
+ npx rapidkit dev # Start dev server with hot reload
97
+ npx rapidkit start # Start production server
98
+ npx rapidkit test # Run tests
99
+ npx rapidkit lint # Lint code
100
+ npx rapidkit format # Format code
101
+
102
+ ${t.gray("Alternative: make dev, ./rapidkit dev, poetry run dev")}
103
+ ${t.gray("\u{1F4A1} Tip: Install globally (npm i -g rapidkit) to use without npx")}
104
+ `:`
105
+ ${t.green("\u2728 NestJS project created successfully!")}
106
+
107
+ ${t.bold("\u{1F4C2} Project structure:")}
108
+ ${i}/
109
+ \u251C\u2500\u2500 .rapidkit/ # RapidKit CLI module
110
+ \u251C\u2500\u2500 src/
111
+ \u2502 \u251C\u2500\u2500 main.ts # Application entry point
112
+ \u2502 \u251C\u2500\u2500 app.module.ts # Root module
113
+ \u2502 \u251C\u2500\u2500 config/ # Configuration
114
+ \u2502 \u2514\u2500\u2500 examples/ # Example module
115
+ \u251C\u2500\u2500 test/ # Test files
116
+ \u251C\u2500\u2500 package.json # Dependencies
117
+ \u2514\u2500\u2500 README.md
118
+
119
+ ${t.bold("\u{1F680} Get started:")}
120
+ ${t.cyan(`cd ${$}`)}
121
+ ${t.cyan("npx rapidkit init")} ${t.gray("# Install dependencies")}
122
+ ${t.cyan("cp .env.example .env")}
123
+ ${t.cyan("npx rapidkit dev")} ${t.gray("# Start dev server")}
124
+
125
+ ${t.bold("\u{1F4DA} Available commands:")}
126
+ npx rapidkit init # Install dependencies
127
+ npx rapidkit dev # Start dev server with hot reload
128
+ npx rapidkit start # Start production server
129
+ npx rapidkit build # Build for production
130
+ npx rapidkit test # Run tests
131
+ npx rapidkit lint # Lint code
132
+ npx rapidkit format # Format code
133
+
134
+ ${t.bold("\u{1F310} API endpoints:")}
135
+ http://localhost:8000/health # Health check
136
+ http://localhost:8000/docs # Swagger docs
137
+ http://localhost:8000/examples/notes # Example API
138
+
139
+ ${t.gray("Alternative: npm run start:dev, ./rapidkit dev")}
140
+ ${t.gray("\u{1F4A1} Tip: Install globally (npm i -g rapidkit) to use without npx")}
141
+ `);}catch(u){throw h.fail(`Failed to generate ${p} project`),u}}export{U as generateDemoKit};