rapidkit 0.15.1 → 0.16.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,13 +1,1057 @@
1
- # RapidKit CLI
1
+ <div align="center">
2
+
3
+ # 🚀 RapidKit CLI
4
+
5
+ **Build Modern Applications at Warp Speed**
6
+
7
+ An open-source framework that helps developers build, scale, and deploy production-ready APIs — faster. Clean architecture, modular design, and automation-first workflows for FastAPI & NestJS.
2
8
 
3
9
  [![npm version](https://img.shields.io/npm/v/rapidkit.svg?style=flat-square)](https://www.npmjs.com/package/rapidkit)
4
- [![npm downloads](https://img.shields.io/npm/dm/rapidkit.svg?style=flat-square)](https://www.npmjs.com/package/rapidkit)
10
+ [![Downloads](https://img.shields.io/npm/dm/rapidkit.svg?style=flat-square)](https://www.npmjs.com/package/rapidkit)
5
11
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg?style=flat-square)](https://opensource.org/licenses/MIT)
6
12
  [![GitHub Stars](https://img.shields.io/github/stars/getrapidkit/rapidkit-npm.svg?style=flat-square)](https://github.com/getrapidkit/rapidkit-npm/stargazers)
7
13
 
8
- This is the official RapidKit CLI on npm.
14
+ [Quick Start](#-quick-start) [Features](#-features) [Docs](https://getrapidkit.com) [VS Code Extension](https://marketplace.visualstudio.com/items?itemName=rapidkit.rapidkit-vscode)
15
+
16
+ </div>
17
+
18
+ ---
19
+
20
+ ## 🎯 What is RapidKit?
21
+
22
+ RapidKit is a professional project scaffolding CLI for FastAPI and NestJS that delivers production-ready applications in seconds. Built on a powerful Python core engine, it provides:
23
+
24
+ - 🏗️ **Instant Scaffolding** - Generate production-ready projects with best practices baked in
25
+ - 🧩 **27+ Free Modules** - Plug-and-play modules for auth, databases, caching, monitoring, and more
26
+ - 🎨 **Consistent Architecture** - Maintain the same structure across all your projects and teams
27
+ - 🔄 **Workspace Management** - Organize multiple microservices in one environment
28
+ - 🤖 **VS Code Integration** - Visual interface for creating projects and managing modules
29
+
30
+ **Perfect for:**
31
+ - Starting new microservices quickly
32
+ - Maintaining architectural consistency across teams
33
+ - Rapid prototyping with production-ready structure
34
+ - Learning best practices for FastAPI/NestJS development
35
+
36
+ ---
37
+
38
+ ## 📦 Table of Contents
39
+
40
+ - [What is RapidKit?](#-what-is-rapidkit)
41
+ - [Features](#-features)
42
+ - [Quick Start](#-quick-start)
43
+ - [Standalone Project](#standalone-project)
44
+ - [Workspace Mode](#workspace-mode-recommended)
45
+ - [Workspace vs Standalone](#-workspace-vs-standalone)
46
+ - [Available Commands](#-available-commands)
47
+ - [Project Commands](#project-commands)
48
+ - [Global Commands](#global-commands)
49
+ - [Workspace Commands](#workspace-commands)
50
+ - [Module System](#-module-system)
51
+ - [Architecture](#-architecture)
52
+ - [Workspace Management](#-workspace-management)
53
+ - [Project Structure](#-project-structure)
54
+ - [Requirements](#-requirements)
55
+ - [CLI Options](#-cli-options)
56
+ - [Troubleshooting](#-troubleshooting)
57
+ - [FAQs](#-faqs)
58
+ - [Development](#-development)
59
+ - [Contributing](#-contributing)
60
+ - [Related Projects](#-related-projects)
61
+ - [License](#-license)
62
+ - [Support](#-support)
63
+
64
+ ---
65
+
66
+ ## ✨ Features
67
+
68
+ <table>
69
+ <tr>
70
+ <td width="50%">
71
+
72
+ ### 🚀 **Instant Scaffolding**
73
+ - FastAPI DDD & Standard kits
74
+ - NestJS Standard kit
75
+ - Production-ready project structure
76
+ - Docker & CI/CD configuration included
77
+ - Best practices baked in
78
+
79
+ </td>
80
+ <td width="50%">
81
+
82
+ ### 🧩 **Modular Architecture**
83
+ - 27+ free plug-and-play modules
84
+ - Authentication (JWT, OAuth, WebAuthn)
85
+ - Databases (PostgreSQL, MongoDB, Redis)
86
+ - Monitoring, logging, and tracing
87
+ - Caching and message queues
88
+
89
+ </td>
90
+ </tr>
91
+ <tr>
92
+ <td width="50%">
93
+
94
+ ### 🎯 **Workspace Management**
95
+ - Organize multiple projects
96
+ - Shared Python environment
97
+ - Auto-tracking in registry
98
+ - VS Code Extension integration
99
+ - Cross-tool compatibility
100
+
101
+ </td>
102
+ <td width="50%">
103
+
104
+ ### 🔧 **Developer Experience**
105
+ - Interactive TUI wizard
106
+ - Hot reload development
107
+ - Built-in testing & linting
108
+ - Comprehensive CLI commands
109
+ - One-command project setup
110
+
111
+ </td>
112
+ </tr>
113
+ </table>
114
+
115
+ ---
116
+
117
+ ## 🚀 Quick Start
118
+
119
+ ### Standalone Project
120
+
121
+ Perfect for single projects or trying out RapidKit:
122
+
123
+ **FastAPI:**
124
+ ```bash
125
+ npx rapidkit create project fastapi.standard my-api
126
+ cd my-api
127
+ npx rapidkit init # Install dependencies
128
+ npx rapidkit dev # Start dev server at http://localhost:8000
129
+ ```
130
+
131
+ **NestJS:**
132
+ ```bash
133
+ npx rapidkit create project nestjs.standard my-service
134
+ cd my-service
135
+ npx rapidkit init # Install dependencies
136
+ npx rapidkit dev # Start dev server at http://localhost:3000
137
+ ```
138
+
139
+ ### Workspace Mode (Recommended)
140
+
141
+ For teams, microservices, or multiple projects:
142
+
143
+ ```bash
144
+ # 1. Create workspace
145
+ npx rapidkit my-workspace
146
+ cd my-workspace
147
+
148
+ # 2. Activate environment (choose one method):
149
+
150
+ # Method A: Activate virtualenv (once per terminal session)
151
+ source "$(poetry env info --path)/bin/activate"
152
+
153
+ # Method B: Use poetry run prefix (every command)
154
+ poetry run rapidkit create
155
+
156
+ # Method C: Create alias (recommended - add to ~/.bashrc or ~/.zshrc)
157
+ alias rapidkit="poetry run rapidkit"
158
+
159
+ # 3. Create projects interactively
160
+ rapidkit create # Interactive wizard
161
+
162
+ # Or create directly
163
+ rapidkit create project fastapi.standard api-gateway
164
+ rapidkit create project nestjs.standard user-service
165
+ rapidkit create project fastapi.ddd order-service
166
+
167
+ # 4. View all projects
168
+ rapidkit workspace list
169
+ ```
170
+
171
+ **Why use workspace mode?**
172
+ - ✅ One shared Python environment for all projects
173
+ - ✅ All projects auto-tracked in `~/.rapidkit/workspaces.json`
174
+ - ✅ VS Code Extension auto-discovers your projects
175
+ - ✅ Consistent RapidKit Core version across projects
176
+ - ✅ Easier dependency management
177
+
178
+ ---
179
+
180
+ ## 🆚 Workspace vs Standalone
181
+
182
+ Choose the right mode for your use case:
183
+
184
+ <table>
185
+ <thead>
186
+ <tr>
187
+ <th width="25%">Feature</th>
188
+ <th width="37.5%">Workspace Mode</th>
189
+ <th width="37.5%">Standalone</th>
190
+ </tr>
191
+ </thead>
192
+ <tbody>
193
+ <tr>
194
+ <td><strong>Best for</strong></td>
195
+ <td>✅ Teams, microservices, multiple projects</td>
196
+ <td>⚡ Single project, quick prototyping</td>
197
+ </tr>
198
+ <tr>
199
+ <td><strong>Python Environment</strong></td>
200
+ <td>✅ Shared across all projects (~150MB once)</td>
201
+ <td>⚠️ Separate per project (150MB each)</td>
202
+ </tr>
203
+ <tr>
204
+ <td><strong>Project Registry</strong></td>
205
+ <td>✅ Auto-tracked in <code>~/.rapidkit/workspaces.json</code></td>
206
+ <td>❌ Not tracked</td>
207
+ </tr>
208
+ <tr>
209
+ <td><strong>VS Code Extension</strong></td>
210
+ <td>✅ Auto-discovers all projects</td>
211
+ <td>⚠️ Manual discovery</td>
212
+ </tr>
213
+ <tr>
214
+ <td><strong>Setup Time</strong></td>
215
+ <td>⏱️ ~2 minutes (once)</td>
216
+ <td>⏱️ ~30 seconds</td>
217
+ </tr>
218
+ <tr>
219
+ <td><strong>Disk Usage</strong></td>
220
+ <td>✅ Efficient (one venv)</td>
221
+ <td>⚠️ Higher (multiple venvs)</td>
222
+ </tr>
223
+ <tr>
224
+ <td><strong>Dependency Management</strong></td>
225
+ <td>✅ Centralized Core version</td>
226
+ <td>⚠️ Independent per project</td>
227
+ </tr>
228
+ <tr>
229
+ <td><strong>Use Case</strong></td>
230
+ <td>Production teams, long-term projects</td>
231
+ <td>Quick demos, learning, single services</td>
232
+ </tr>
233
+ </tbody>
234
+ </table>
235
+
236
+ ---
237
+
238
+ ## 🎯 Architecture
239
+
240
+ ```
241
+ ┌──────────────────────────────────────────────────────────────┐
242
+ │ RapidKit CLI (npm) │
243
+ │ • Command routing & delegation │
244
+ │ • Workspace management & registry │
245
+ │ • VS Code Extension integration │
246
+ │ • Python Core bridge & bootstrapping │
247
+ └────────────────────────┬─────────────────────────────────────┘
248
+
249
+ ┌──────────┴──────────┐
250
+ │ │
251
+ ▼ ▼
252
+ ┌──────────────────────┐ ┌──────────────────────────┐
253
+ │ Project Local CLI │ │ RapidKit Core │
254
+ │ Launcher │ │ (Python Engine) │
255
+ ├──────────────────────┤ ├──────────────────────────┤
256
+ │ • init │ │ • create │
257
+ │ • dev │ │ • add module │
258
+ │ • test │ │ • list kits/modules │
259
+ │ • build │ │ • info │
260
+ │ • lint │ │ • doctor │
261
+ │ • format │ │ • upgrade │
262
+ │ • start │ │ • TUI wizard │
263
+ └──────────────────────┘ └──────────────────────────┘
264
+ │ │
265
+ └──────────┬───────────────┘
266
+
267
+ ┌────────────────────┐
268
+ │ Generated Project │
269
+ │ (FastAPI/NestJS) │
270
+ └────────────────────┘
271
+ ```
272
+
273
+ **How it works:**
274
+
275
+ 1. **Inside a project:** Commands like `init`, `dev`, `test` are delegated to the project-local launcher
276
+ 2. **Outside a project:** Commands like `create`, `list`, `add` are forwarded to RapidKit Core (Python)
277
+ 3. **Workspace mode:** Python Core is installed in workspace venv via Poetry/pipx
278
+ 4. **Standalone mode:** Each project manages its own environment
279
+
280
+ ---
281
+
282
+ ## 💻 Available Commands
283
+
284
+ ### Project Commands
285
+
286
+ Run these inside a RapidKit project:
287
+
288
+ ```bash
289
+ npx rapidkit init # Install dependencies (auto-activates environment)
290
+ npx rapidkit dev # Start dev server with hot reload
291
+ npx rapidkit start # Start production server
292
+ npx rapidkit build # Build for production
293
+ npx rapidkit test # Run tests with coverage
294
+ npx rapidkit lint # Run linting checks
295
+ npx rapidkit format # Format code automatically
296
+ npx rapidkit --help # Show all commands
297
+ ```
298
+
299
+ ### Global Commands
300
+
301
+ Run these anywhere:
302
+
303
+ ```bash
304
+ # Project creation
305
+ npx rapidkit create # Interactive wizard
306
+ npx rapidkit create project <kit> <name> # Direct creation
307
+
308
+ # Information
309
+ npx rapidkit list # List available kits
310
+ npx rapidkit list modules # List available modules
311
+ npx rapidkit info kit <name> # Kit details
312
+ npx rapidkit info module <name> # Module details
313
+
314
+ # System
315
+ npx rapidkit doctor # Diagnose environment
316
+ npx rapidkit --version # Show version
317
+ npx rapidkit --tui # Launch interactive TUI
318
+
319
+ # Workspace management
320
+ npx rapidkit workspace list # List workspaces
321
+ npx rapidkit workspace sync # Sync projects
322
+ ```
323
+
324
+ ### Workspace Commands
325
+
326
+ ```bash
327
+ # List all registered workspaces
328
+ rapidkit workspace list
329
+
330
+ # Sync current workspace (scan for new projects)
331
+ rapidkit workspace sync
332
+ ```
333
+
334
+ ---
335
+
336
+ ---
337
+
338
+ ## 🧩 Module System
339
+
340
+ RapidKit's modular architecture lets you extend your project with pre-built modules.
341
+
342
+ ### Adding Modules
343
+
344
+ ```bash
345
+ # Add single module
346
+ rapidkit add module <module-slug>
347
+
348
+ # Examples
349
+ rapidkit add module auth # Authentication
350
+ rapidkit add module db_postgres # PostgreSQL
351
+ rapidkit add module redis # Redis caching
352
+ rapidkit add module monitoring # Monitoring & metrics
353
+ ```
354
+
355
+ ### List Available Modules
356
+
357
+ ```bash
358
+ rapidkit list modules # Human-readable list
359
+ rapidkit list modules --json # JSON format
360
+ ```
361
+
362
+ ### Module Information
363
+
364
+ ```bash
365
+ rapidkit info module auth # View module details
366
+ rapidkit info module db_postgres # Dependencies, config, etc.
367
+ ```
368
+
369
+ ### Available Modules (27 Total)
370
+
371
+ #### 🔐 Authentication & Authorization (5)
372
+
373
+ | Module | Slug | Description |
374
+ |--------|------|-------------|
375
+ | **Authentication Core** | `auth` | Opinionated password hashing, token signing, and runtime auth |
376
+ | **API Keys** | `api_keys` | API key issuance, verification, and auditing |
377
+ | **OAuth Providers** | `oauth` | Lightweight OAuth 2.0 scaffolding with provider registry |
378
+ | **Passwordless Authentication** | `passwordless` | Magic link and one-time code authentication helpers |
379
+ | **Session Management** | `session` | Opinionated session management with signed cookies |
380
+
381
+ #### 💳 Billing & E-commerce (3)
382
+
383
+ | Module | Slug | Description |
384
+ |--------|------|-------------|
385
+ | **Cart** | `cart` | Shopping cart service for checkout flows |
386
+ | **Inventory** | `inventory` | Inventory and pricing service backing Cart + Stripe |
387
+ | **Stripe Payment** | `stripe` | Stripe payments and subscriptions |
388
+
389
+ #### 🗄️ Database (3)
390
+
391
+ | Module | Slug | Description |
392
+ |--------|------|-------------|
393
+ | **PostgreSQL** | `db_postgres` | SQLAlchemy async+sync Postgres with clean DI, healthcheck |
394
+ | **MongoDB** | `db_mongo` | MongoDB integration with async driver support, health diagnostics |
395
+ | **SQLite** | `db_sqlite` | SQLite database integration for development |
396
+
397
+ #### 🔒 Security (3)
398
+
399
+ | Module | Slug | Description |
400
+ |--------|------|-------------|
401
+ | **CORS** | `cors` | Cross-Origin Resource Sharing security module |
402
+ | **Rate Limiting** | `rate_limiting` | Production request throttling with configurable rules |
403
+ | **Security Headers** | `security_headers` | Harden HTTP responses with industry-standard security headers |
404
+
405
+ #### 📧 Communication (2)
406
+
407
+ | Module | Slug | Description |
408
+ |--------|------|-------------|
409
+ | **Email** | `email` | Email sending capabilities |
410
+ | **Unified Notifications** | `notifications` | Email-first notification runtime with SMTP delivery |
411
+
412
+ #### 👥 User Management (2)
413
+
414
+ | Module | Slug | Description |
415
+ |--------|------|-------------|
416
+ | **Users Core** | `users` | Opinionated user management backbone with immutable user records |
417
+ | **Users Profiles** | `users_profiles` | Extends Users Core with rich profile modeling |
418
+
419
+ #### ⚙️ Essentials (4)
420
+
421
+ | Module | Slug | Description |
422
+ |--------|------|-------------|
423
+ | **Application Settings** | `settings` | Centralized modular configuration management using Pydantic |
424
+ | **Middleware** | `middleware` | HTTP middleware pipeline with FastAPI and NestJS support |
425
+ | **Structured Logging** | `logging` | Structured logging runtime with correlation IDs, multi-sink output |
426
+ | **Deployment Toolkit** | `deployment` | Portable Docker, Compose, Makefile, and CI assets for RapidKit |
427
+
428
+ #### 📊 Observability (1)
429
+
430
+ | Module | Slug | Description |
431
+ |--------|------|-------------|
432
+ | **Observability Core** | `observability` | Cohesive metrics, tracing, and structured logging foundation |
433
+
434
+ #### 💾 Caching (1)
435
+
436
+ | Module | Slug | Description |
437
+ |--------|------|-------------|
438
+ | **Redis Cache** | `redis` | Production Redis runtime with async and sync client support |
439
+
440
+ #### 🤖 AI (1)
441
+
442
+ | Module | Slug | Description |
443
+ |--------|------|-------------|
444
+ | **AI Assistant** | `ai_assistant` | AI assistant integration capabilities |
445
+
446
+ #### ⚡ Tasks (1)
447
+
448
+ | Module | Slug | Description |
449
+ |--------|------|-------------|
450
+ | **Celery** | `celery` | Production Celery task orchestration for asynchronous workflows |
451
+
452
+ #### 💼 Business (1)
453
+
454
+ | Module | Slug | Description |
455
+ |--------|------|-------------|
456
+ | **Storage** | `storage` | File Storage & Media Management - Upload, store, and retrieve files |
457
+
458
+ > **💡 Tip:** Use `rapidkit modules list` to see all modules with versions and status, or install the [RapidKit VS Code Extension](https://marketplace.visualstudio.com/items?itemName=rapidkit.rapidkit-vscode) to browse and install modules visually!
459
+
460
+ ---
461
+
462
+ ## 🗂️ Workspace Management
463
+
464
+ RapidKit maintains a shared workspace registry at `~/.rapidkit/workspaces.json` for cross-tool compatibility with the VS Code Extension.
465
+
466
+ ### List Registered Workspaces
467
+
468
+ ```bash
469
+ rapidkit workspace list
470
+ ```
471
+
472
+ **Example output:**
473
+ ```
474
+ 📦 Registered RapidKit Workspaces:
475
+
476
+ my-workspace
477
+ Path: /home/user/projects/my-workspace
478
+ Projects: 3
479
+
480
+ microservices
481
+ Path: /home/user/work/microservices
482
+ Projects: 7
483
+
484
+ Total: 2 workspace(s)
485
+ ```
486
+
487
+ ### Sync Workspace Projects
488
+
489
+ Projects are automatically tracked when created. Manual sync is available if needed:
490
+
491
+ ```bash
492
+ cd my-workspace
493
+ rapidkit workspace sync
494
+ ```
495
+
496
+ This scans the workspace directory and registers all RapidKit projects (directories with `.rapidkit/context.json` or `.rapidkit/project.json`).
497
+
498
+ **When to use manual sync:**
499
+ - Manually moved/copied projects into workspace
500
+ - Created projects before sync feature existed
501
+ - Registry got out of sync
502
+ - Want to refresh after external changes
503
+
504
+ ### Registry Format
505
+
506
+ The registry stores workspace and project metadata:
507
+
508
+ ```json
509
+ {
510
+ "workspaces": [
511
+ {
512
+ "name": "my-workspace",
513
+ "path": "/home/user/projects/my-workspace",
514
+ "mode": "full",
515
+ "projects": [
516
+ {
517
+ "name": "api-gateway",
518
+ "path": "/home/user/projects/my-workspace/api-gateway"
519
+ },
520
+ {
521
+ "name": "user-service",
522
+ "path": "/home/user/projects/my-workspace/user-service"
523
+ }
524
+ ]
525
+ }
526
+ ]
527
+ }
528
+ ```
529
+
530
+ **Auto-registration:**
531
+ - Workspaces registered when created via `npx rapidkit <name>` or VS Code Extension
532
+ - Projects registered when created via `rapidkit create project ...` inside workspace
533
+ - VS Code Extension and npm CLI share the same registry
534
+
535
+ ---
536
+
537
+ ## 📁 Project Structure
538
+
539
+ ### FastAPI Project
540
+
541
+ ```
542
+ my-api/
543
+ ├── .rapidkit/
544
+ │ ├── activate # Environment activation script
545
+ │ ├── cli.py # Python CLI module
546
+ │ ├── rapidkit # Bash wrapper
547
+ │ └── context.json # Project metadata
548
+ ├── rapidkit # Main CLI entry point
549
+ ├── src/
550
+ │ ├── main.py # FastAPI application
551
+ │ ├── cli.py # CLI commands
552
+ │ ├── routing/ # API routes
553
+ │ │ ├── __init__.py
554
+ │ │ ├── health.py
555
+ │ │ └── examples.py
556
+ │ └── modules/ # Module system
557
+ │ └── __init__.py
558
+ ├── tests/ # Test suite
559
+ │ ├── __init__.py
560
+ │ ├── test_health.py
561
+ │ └── test_examples.py
562
+ ├── pyproject.toml # Poetry configuration
563
+ ├── Makefile # Make commands
564
+ ├── Dockerfile # Docker configuration
565
+ ├── docker-compose.yml # Docker Compose
566
+ ├── .env.example # Environment template
567
+ ├── .gitignore
568
+ └── README.md
569
+ ```
570
+
571
+ ### NestJS Project
572
+
573
+ ```
574
+ my-service/
575
+ ├── .rapidkit/
576
+ │ ├── activate # Environment activation script
577
+ │ ├── rapidkit # Bash CLI wrapper
578
+ │ └── context.json # Project metadata
579
+ ├── rapidkit # Main CLI entry point
580
+ ├── src/
581
+ │ ├── main.ts # Application entry point
582
+ │ ├── app.module.ts # Root module
583
+ │ ├── app.controller.ts # Root controller
584
+ │ ├── app.service.ts # Root service
585
+ │ ├── config/ # Configuration
586
+ │ │ ├── configuration.ts
587
+ │ │ └── validation.ts
588
+ │ └── examples/ # Example module
589
+ │ ├── examples.module.ts
590
+ │ ├── examples.controller.ts
591
+ │ └── examples.service.ts
592
+ ├── test/ # Test files
593
+ │ ├── app.e2e-spec.ts
594
+ │ └── jest-e2e.json
595
+ ├── package.json # Dependencies
596
+ ├── tsconfig.json # TypeScript config
597
+ ├── nest-cli.json # NestJS CLI config
598
+ ├── Dockerfile # Docker configuration
599
+ ├── docker-compose.yml # Docker Compose
600
+ ├── .env.example # Environment template
601
+ └── README.md
602
+ ```
603
+
604
+ ---
605
+
606
+ ## 📋 Requirements
607
+
608
+ ### System Requirements
609
+
610
+ - **Node.js**: 20.19.6+ LTS (20.x or 22.x recommended)
611
+ - **Python**: 3.10+ (required for RapidKit Core)
612
+ - **Git**: For version control
613
+
614
+ ### Framework-Specific Requirements
615
+
616
+ **FastAPI Projects:**
617
+ - Python 3.10+
618
+ - Poetry (auto-installed if missing)
619
+
620
+ **NestJS Projects:**
621
+ - Node.js 20.19.6+
622
+ - Package manager (npm/yarn/pnpm)
623
+
624
+ ### Optional Tools
625
+
626
+ - **Docker**: For containerized development
627
+ - **VS Code**: For Extension integration
628
+ - **Make**: For Makefile commands (usually pre-installed on Unix)
629
+
630
+ > 💡 **Tip:** Use [RapidKit VS Code Extension](https://marketplace.visualstudio.com/items?itemName=rapidkit.rapidkit-vscode) which includes a system checker to verify all requirements!
631
+
632
+ ---
633
+
634
+ ## ⚙️ CLI Options
635
+
636
+ ```bash
637
+ npx rapidkit [workspace-name] [options]
638
+ npx rapidkit workspace <action>
639
+ ```
640
+
641
+ ### Arguments
642
+
643
+ - `workspace-name` - Name of workspace directory to create
644
+ - `action` - For workspace commands: `list` or `sync`
645
+
646
+ ### Workspace Creation Options
647
+
648
+ - `-y, --yes` - Skip prompts and use defaults
649
+ - `--skip-git` - Skip git initialization
650
+ - `--debug` - Enable verbose debug logging
651
+ - `--dry-run` - Preview what would be created without creating it
652
+ - `--no-update-check` - Skip checking for newer versions
653
+ - `--help` - Display help information
654
+ - `--version` - Show version number
655
+
656
+ ### Project Creation Flags
657
+
658
+ - `--output <dir>` - Specify output directory (default: current)
659
+ - `--create-workspace` - Auto-create workspace if outside one
660
+ - `--no-workspace` - Don't create workspace if outside one
661
+
662
+ ### Examples
9
663
 
10
- > 🔮 **Coming Soon:** AI-powered module recommendations when Core modules are released!
664
+ ```bash
665
+ # Create workspace with defaults
666
+ npx rapidkit my-workspace --yes --skip-git
667
+
668
+ # Create project in specific location
669
+ npx rapidkit create project fastapi.standard api --output ./services
670
+
671
+ # Preview workspace creation
672
+ npx rapidkit test-workspace --dry-run
673
+
674
+ # Skip update check
675
+ npx rapidkit create --no-update-check
676
+ ```
677
+
678
+ ---
679
+
680
+ ## 🔧 Troubleshooting
681
+
682
+ ### Common Issues
683
+
684
+ <details>
685
+ <summary><strong>❌ BRIDGE_VENV_BOOTSTRAP_FAILED</strong></summary>
686
+
687
+ **Problem:** Python core can't run in workspace.
688
+
689
+ **Cause:** Poetry virtualenv not activated or workspace environment issue.
690
+
691
+ **Solutions:**
692
+
693
+ ```bash
694
+ # Solution 1: Use poetry run prefix
695
+ poetry run rapidkit create
696
+
697
+ # Solution 2: Activate environment
698
+ source "$(poetry env info --path)/bin/activate"
699
+ rapidkit create
700
+
701
+ # Solution 3: Use non-interactive mode (always works without workspace)
702
+ rapidkit create project fastapi.standard my-api
703
+
704
+ # Solution 4: Recreate workspace
705
+ cd ..
706
+ rm -rf old-workspace
707
+ npx rapidkit new-workspace
708
+ ```
709
+ </details>
710
+
711
+ <details>
712
+ <summary><strong>🔍 Workspace not detected</strong></summary>
713
+
714
+ **Problem:** CLI doesn't recognize you're in a workspace.
715
+
716
+ **Check:**
717
+ ```bash
718
+ # Verify workspace marker exists
719
+ ls -la .rapidkit-workspace
720
+
721
+ # Check workspace is registered
722
+ rapidkit workspace list
723
+ ```
724
+
725
+ **Solution:**
726
+ ```bash
727
+ # Manual sync
728
+ rapidkit workspace sync
729
+ ```
730
+ </details>
731
+
732
+ <details>
733
+ <summary><strong>📋 Project not auto-registered</strong></summary>
734
+
735
+ **Problem:** New project not showing in `workspace list`.
736
+
737
+ **Solution:**
738
+ ```bash
739
+ cd my-workspace
740
+ rapidkit workspace sync
741
+ ```
742
+
743
+ Projects created with `rapidkit create project` should auto-register. If not, sync manually.
744
+ </details>
745
+
746
+ <details>
747
+ <summary><strong>🐍 Python version mismatch</strong></summary>
748
+
749
+ **Problem:** Python 3.10+ required but not found.
750
+
751
+ **Solution:**
752
+
753
+ ```bash
754
+ # Ubuntu/Debian
755
+ sudo apt install python3.10 python3.10-venv
756
+
757
+ # macOS (Homebrew)
758
+ brew install python@3.10
759
+
760
+ # Verify installation
761
+ python3.10 --version
762
+ ```
763
+ </details>
764
+
765
+ <details>
766
+ <summary><strong>📦 Poetry not found</strong></summary>
767
+
768
+ **Problem:** Poetry installation missing or not in PATH.
769
+
770
+ **Solution:**
771
+
772
+ ```bash
773
+ # Install Poetry
774
+ curl -sSL https://install.python-poetry.org | python3 -
775
+
776
+ # Add to PATH (add to ~/.bashrc or ~/.zshrc)
777
+ export PATH="$HOME/.local/bin:$PATH"
778
+
779
+ # Verify
780
+ poetry --version
781
+ ```
782
+ </details>
783
+
784
+ <details>
785
+ <summary><strong>🔄 Workspace environment corrupt</strong></summary>
786
+
787
+ **Problem:** Workspace `.venv` or Poetry environment is broken.
788
+
789
+ **Solution:**
790
+
791
+ ```bash
792
+ # For Poetry workspace
793
+ cd my-workspace
794
+ poetry env remove python
795
+ poetry install
796
+
797
+ # For venv workspace
798
+ rm -rf .venv
799
+ python3 -m venv .venv
800
+ source .venv/bin/activate
801
+ pip install rapidkit-core
802
+ ```
803
+ </details>
804
+
805
+ ### Getting Help
806
+
807
+ If you encounter issues not covered here:
808
+
809
+ 1. **Check the documentation:** https://getrapidkit.com
810
+ 2. **Search existing issues:** https://github.com/getrapidkit/rapidkit-npm/issues
811
+ 3. **Run diagnostics:** `rapidkit doctor`
812
+ 4. **Open a new issue:** Include `rapidkit --version`, OS, Node.js version, and error output
813
+
814
+ ---
815
+
816
+ ## ❓ FAQs
817
+
818
+ <details>
819
+ <summary><strong>Do I need Python installed?</strong></summary>
820
+
821
+ Yes, Python 3.10+ is required for RapidKit Core (the engine). The npm package will bootstrap it into a workspace venv if needed, but having Python system-wide is recommended.
822
+ </details>
823
+
824
+ <details>
825
+ <summary><strong>Can I use this without npm?</strong></summary>
826
+
827
+ Yes! Install globally: `npm i -g rapidkit`, then use `rapidkit` directly without `npx`. Note: You'll still need Node.js installed.
828
+ </details>
829
+
830
+ <details>
831
+ <summary><strong>What's the difference from cookiecutter?</strong></summary>
832
+
833
+ RapidKit provides:
834
+ - **Living templates** that receive updates
835
+ - **Module system** (27+ free plug-and-play modules)
836
+ - **Workspace management** for organizing multiple projects
837
+ - **VS Code integration** with visual interface
838
+ - **Interactive TUI** wizard
839
+ - **Built-in CLI** commands (dev, test, lint, etc.)
840
+
841
+ Cookiecutter is great for one-time scaffolding, but RapidKit is a complete development platform.
842
+ </details>
843
+
844
+ <details>
845
+ <summary><strong>Do I need the VS Code Extension?</strong></summary>
846
+
847
+ No, but it's highly recommended! The Extension provides:
848
+ - Visual interface for creating projects
849
+ - One-click module installation
850
+ - Workspace browser
851
+ - System requirements checker
852
+ - Integrated terminal commands
853
+
854
+ CLI is fully functional standalone.
855
+ </details>
856
+
857
+ <details>
858
+ <summary><strong>Can I use venv instead of Poetry?</strong></summary>
859
+
860
+ Yes! During workspace creation, you can choose:
861
+ - **Poetry** (recommended - better dependency management)
862
+ - **venv** (standard Python virtualenv)
863
+ - **pipx** (global user install)
864
+
865
+ All options work, but Poetry provides the best experience.
866
+ </details>
867
+
868
+ <details>
869
+ <summary><strong>How do I upgrade RapidKit?</strong></summary>
870
+
871
+ ```bash
872
+ # For global install
873
+ npm update -g rapidkit
874
+
875
+ # For npx usage (automatic)
876
+ npx rapidkit@latest create
877
+
878
+ # For workspace Python Core
879
+ cd my-workspace
880
+ poetry update rapidkit-core
881
+ # OR
882
+ pip install --upgrade rapidkit-core
883
+ ```
884
+ </details>
885
+
886
+ <details>
887
+ <summary><strong>Can I customize generated projects?</strong></summary>
888
+
889
+ Yes! After generation:
890
+ 1. Modify files as needed - they're yours
891
+ 2. Add/remove modules: `rapidkit add module <name>`
892
+ 3. Update dependencies in `pyproject.toml` or `package.json`
893
+ 4. RapidKit won't overwrite your changes
894
+
895
+ For template-level changes, consider:
896
+ - Creating custom kits (see Core docs)
897
+ - Using RapidKit as a starting point
898
+ </details>
899
+
900
+ <details>
901
+ <summary><strong>Is there a Docker workflow?</strong></summary>
902
+
903
+ Yes! All projects include:
904
+ - `Dockerfile` for production builds
905
+ - `docker-compose.yml` for development
906
+ - `.dockerignore` for optimization
907
+
908
+ ```bash
909
+ # Development
910
+ docker-compose up
911
+
912
+ # Production
913
+ docker build -t my-service .
914
+ docker run -p 8000:8000 my-service
915
+ ```
916
+ </details>
917
+
918
+ <details>
919
+ <summary><strong>How does workspace registry work with teams?</strong></summary>
920
+
921
+ The registry (`~/.rapidkit/workspaces.json`) is **user-local**, not project-local:
922
+ - Each developer has their own registry
923
+ - Workspaces are auto-discovered when cloned
924
+ - VS Code Extension syncs automatically
925
+ - Git doesn't track the registry (it's in `~/.rapidkit/`)
926
+
927
+ For team sharing:
928
+ - Commit workspace code to Git
929
+ - Each developer runs `rapidkit workspace sync` after clone
930
+ - Or let VS Code Extension auto-discover
931
+ </details>
932
+
933
+ ---
934
+
935
+ ## 🛠️ Development
936
+
937
+ ### Setup
938
+
939
+ ```bash
940
+ # Clone the repository
941
+ git clone https://github.com/getrapidkit/rapidkit-npm.git
942
+ cd rapidkit-npm
943
+
944
+ # Install dependencies
945
+ npm install
946
+
947
+ # Build
948
+ npm run build
949
+
950
+ # Run tests
951
+ npm test
952
+
953
+ # Watch mode for development
954
+ npm run dev
955
+ ```
956
+
957
+ ### Local Testing
958
+
959
+ ```bash
960
+ # Build and link locally
961
+ npm run install:local
962
+
963
+ # Now rapidkit command uses your local build
964
+ rapidkit --version
965
+
966
+ # Uninstall local version
967
+ npm run uninstall:local
968
+ ```
969
+
970
+ ### Project Scripts
971
+
972
+ ```json
973
+ {
974
+ "dev": "tsup --watch",
975
+ "build": "tsup",
976
+ "test": "vitest run",
977
+ "test:watch": "vitest",
978
+ "lint": "eslint src",
979
+ "install:local": "npm unlink -g rapidkit 2>/dev/null || true && npm run build && npm link",
980
+ "uninstall:local": "npm unlink -g rapidkit"
981
+ }
982
+ ```
983
+
984
+ ---
985
+
986
+ ## 🤝 Contributing
987
+
988
+ We welcome contributions! See [CONTRIBUTING.md](CONTRIBUTING.md) for guidelines.
989
+
990
+ ### Ways to Contribute
991
+
992
+ - 🐛 [Report bugs](https://github.com/getrapidkit/rapidkit-npm/issues)
993
+ - 💡 [Request features](https://github.com/getrapidkit/rapidkit-npm/issues)
994
+ - 📖 [Improve documentation](https://github.com/getrapidkit/rapidkit-npm/pulls)
995
+ - 🔧 [Submit pull requests](https://github.com/getrapidkit/rapidkit-npm/pulls)
996
+
997
+ ### Development Guidelines
998
+
999
+ 1. Fork the repository
1000
+ 2. Create a feature branch: `git checkout -b feature/my-feature`
1001
+ 3. Make your changes with tests
1002
+ 4. Run tests: `npm test`
1003
+ 5. Commit: `git commit -m "feat: add awesome feature"`
1004
+ 6. Push: `git push origin feature/my-feature`
1005
+ 7. Open a Pull Request
1006
+
1007
+ ---
1008
+
1009
+ ## 🔗 Related Projects
1010
+
1011
+ - **[RapidKit Core (Python)](https://pypi.org/project/rapidkit-core/)** - The engine powering RapidKit
1012
+ - **[RapidKit VS Code Extension](https://marketplace.visualstudio.com/items?itemName=rapidkit.rapidkit-vscode)** - Visual interface
1013
+ - **[RapidKit Documentation](https://getrapidkit.com)** - Full documentation
1014
+ - **[GitHub Organization](https://github.com/getrapidkit)** - All repositories
1015
+
1016
+ ---
1017
+
1018
+ ## 📄 License
1019
+
1020
+ MIT License - see [LICENSE](LICENSE) for details.
1021
+
1022
+ ---
1023
+
1024
+ ## 🌟 Support
1025
+
1026
+ <div align="center">
1027
+
1028
+ ### Show Your Support
1029
+
1030
+ ⭐ Star this repo if you find it helpful!
1031
+
1032
+ ### Stay Connected
1033
+
1034
+ 🐦 Follow [@getrapidkit](https://twitter.com/getrapidkit) for updates
1035
+
1036
+ 💬 Join our [Discord community](https://discord.gg/rapidkit)
1037
+
1038
+ 📚 Read the [full documentation](https://getrapidkit.com)
1039
+
1040
+ ### Get Help
1041
+
1042
+ 🐛 [Report Issues](https://github.com/getrapidkit/rapidkit-npm/issues)
1043
+
1044
+ 💡 [Request Features](https://github.com/getrapidkit/rapidkit-npm/issues)
1045
+
1046
+ 📖 [Browse Docs](https://getrapidkit.com)
1047
+
1048
+ ---
1049
+
1050
+ **Made with ❤️ by the RapidKit team**
1051
+
1052
+ [Website](https://getrapidkit.com) • [GitHub](https://github.com/getrapidkit) • [Twitter](https://twitter.com/getrapidkit) • [Discord](https://discord.gg/rapidkit)
1053
+
1054
+ </div>
11
1055
  >
12
1056
  > _Note: The AI recommender feature is complete in the `feature/ai-recommender` branch but not yet released. We will announce it when Core module support is available._
13
1057
 
@@ -40,13 +1084,45 @@ npx rapidkit init # Install dependencies
40
1084
  npx rapidkit dev # Start dev server at http://localhost:8000
41
1085
  ```
42
1086
 
1087
+ ### Create a Workspace (Recommended)
1088
+
1089
+ For organizing multiple projects:
1090
+
1091
+ ```bash
1092
+ npx rapidkit my-workspace # Create workspace with Poetry
1093
+ cd my-workspace
1094
+
1095
+ # Activate environment (choose one):
1096
+ source "$(poetry env info --path)/bin/activate"
1097
+ # OR use poetry run prefix for all commands
1098
+ alias rapidkit="poetry run rapidkit"
1099
+
1100
+ # Create projects
1101
+ rapidkit create # Interactive mode
1102
+ rapidkit create project fastapi.standard my-api --output .
1103
+ cd my-api
1104
+ rapidkit init && rapidkit dev
1105
+ ```
1106
+
1107
+ **Why use a workspace?**
1108
+ - ✅ Centralized Python environment for all projects
1109
+ - ✅ Auto-tracks all projects in registry (`~/.rapidkit/workspaces.json`)
1110
+ - ✅ VS Code Extension auto-discovers your projects
1111
+ - ✅ Easier dependency management across projects
1112
+
43
1113
  ### Interactive mode (recommended)
44
1114
 
45
1115
  ```bash
1116
+ # Outside workspace
46
1117
  npx rapidkit create
1118
+
1119
+ # Inside workspace (after activation)
1120
+ rapidkit create
1121
+ # OR
1122
+ poetry run rapidkit create
47
1123
  ```
48
1124
 
49
- This runs the RapidKit Core wizard (`python -m rapidkit create`) and guides you through kit selection and project creation.
1125
+ This runs the RapidKit Core wizard and guides you through kit selection and project creation.
50
1126
 
51
1127
  ## Two Modes of Operation
52
1128
 
@@ -59,29 +1135,34 @@ npx rapidkit create project fastapi.standard my-api --output .
59
1135
  npx rapidkit create project nestjs.standard my-api --output .
60
1136
  ```
61
1137
 
62
- ### 2. RapidKit Environment Mode (without `--template`)
1138
+ ### 2. RapidKit Workspace Mode
63
1139
 
64
1140
  Create a workspace to organize multiple projects:
65
1141
 
66
1142
  ```bash
67
- npx rapidkit my-workspace # Create a RapidKit environment (installs python core)
1143
+ npx rapidkit my-workspace # Create a RapidKit workspace
68
1144
  cd my-workspace
69
1145
 
70
- # Interactive project creation (recommended)
71
- rapidkit create
1146
+ # Activate the environment (Poetry installs to cache, not .venv)
1147
+ source "$(poetry env info --path)/bin/activate"
72
1148
 
73
- # Or non-interactive via kit slug
74
- rapidkit create project fastapi.standard my-api --output .
75
- rapidkit create project nestjs.standard admin-api --output .
1149
+ # Or use poetry run prefix
1150
+ poetry run rapidkit create # Interactive project creation
1151
+ poetry run rapidkit create project fastapi.standard my-api --output .
76
1152
  ```
77
1153
 
78
- This mode creates a "RapidKit environment" directory (Poetry/venv/pipx) and installs the Python Core there, so you can create/manage projects from the same CLI.
1154
+ This mode creates a "RapidKit workspace" directory and installs the Python Core there via Poetry/venv/pipx, so you can create/manage multiple projects from the same environment.
79
1155
 
80
- Note: when you choose Poetry, the virtualenv is typically created in Poetry's cache (not as a local `.venv` folder). Activate it via:
1156
+ **Important:** When using Poetry (recommended), the virtualenv is created in Poetry's cache, not as a local `.venv` folder. You must either:
1157
+ - Activate the environment: `source "$(poetry env info --path)/bin/activate"`
1158
+ - Use `poetry run` prefix: `poetry run rapidkit create`
1159
+ - Create an alias: `alias rapidkit="poetry run rapidkit"`
81
1160
 
82
- ```bash
83
- source "$(poetry env info --path)/bin/activate"
84
- ```
1161
+ **Workspace Features:**
1162
+ - All projects are automatically tracked in `~/.rapidkit/workspaces.json`
1163
+ - VS Code Extension auto-discovers workspace projects
1164
+ - Use `rapidkit workspace list` to see all workspaces and projects
1165
+ - Use `rapidkit workspace sync` to update project registry
85
1166
 
86
1167
  ## Kits / Templates
87
1168
 
@@ -170,6 +1251,82 @@ Notes:
170
1251
  - To emulate a clean system in CI/QA, ensure `rapidkit-core` is not installed in the global/system Python before running the workspace creation script.
171
1252
  - If you prefer Poetry to create in-project virtualenvs (`.venv`), enable it via `poetry config virtualenvs.in-project true` or let the workspace installer configure Poetry for you.
172
1253
 
1254
+ ## Workspace Management
1255
+
1256
+ RapidKit maintains a shared workspace registry at `~/.rapidkit/workspaces.json` for cross-tool compatibility with the VS Code Extension.
1257
+
1258
+ ### List Registered Workspaces
1259
+
1260
+ ```bash
1261
+ npx rapidkit workspace list
1262
+ ```
1263
+
1264
+ This shows all workspaces created via npm package or VS Code Extension, including:
1265
+ - Workspace name and path
1266
+ - Number of projects in each workspace
1267
+ - Validation status (path exists/missing)
1268
+
1269
+ **Example output:**
1270
+ ```
1271
+ 📦 Registered RapidKit Workspaces:
1272
+
1273
+ my-workspace
1274
+ Path: /home/user/projects/my-workspace
1275
+ Projects: 3
1276
+
1277
+ Total: 1 workspace(s)
1278
+ ```
1279
+
1280
+ ### Sync Workspace Projects
1281
+
1282
+ When you create projects inside a workspace, they are automatically tracked. If needed, you can manually sync:
1283
+
1284
+ ```bash
1285
+ cd my-workspace
1286
+ rapidkit workspace sync
1287
+ ```
1288
+
1289
+ This command scans the workspace directory and registers all RapidKit projects (directories with `.rapidkit/context.json` or `.rapidkit/project.json`) in the registry.
1290
+
1291
+ **Note:** Project registration happens automatically when you create projects with `rapidkit create project ...` inside a workspace. Manual sync is only needed if you:
1292
+ - Manually moved/copied projects into the workspace
1293
+ - Created projects before the sync feature was added
1294
+ - Want to refresh the registry after external changes
1295
+
1296
+ ### Workspace Registry Format
1297
+
1298
+ The registry stores workspace metadata:
1299
+
1300
+ ```json
1301
+ {
1302
+ "workspaces": [
1303
+ {
1304
+ "name": "my-workspace",
1305
+ "path": "/home/user/projects/my-workspace",
1306
+ "mode": "full",
1307
+ "projects": [
1308
+ {
1309
+ "name": "my-api",
1310
+ "path": "/home/user/projects/my-workspace/my-api"
1311
+ },
1312
+ {
1313
+ "name": "admin-api",
1314
+ "path": "/home/user/projects/my-workspace/admin-api"
1315
+ }
1316
+ ]
1317
+ }
1318
+ ]
1319
+ }
1320
+ ```
1321
+
1322
+ Workspaces are automatically registered when created via:
1323
+ - `npx rapidkit <workspace-name>`
1324
+ - VS Code Extension "Create Workspace" command
1325
+
1326
+ Projects are automatically registered when created via:
1327
+ - `rapidkit create project ...` (inside a workspace)
1328
+ - VS Code Extension "Create Project" command
1329
+
173
1330
  ## CLI Options
174
1331
 
175
1332
  ```bash
@@ -179,6 +1336,12 @@ npx rapidkit [project-name] [options]
179
1336
  ### Arguments
180
1337
 
181
1338
  - `project-name` - Name of project/workspace directory to create
1339
+ - `action` - For workspace commands: `list` or `sync`
1340
+
1341
+ ### Workspace Commands
1342
+
1343
+ - `rapidkit workspace list` - List all registered workspaces and their projects
1344
+ - `rapidkit workspace sync` - Scan current workspace and register all projects
182
1345
 
183
1346
  ### Options
184
1347
 
@@ -333,6 +1496,25 @@ This CLI runs a Node entrypoint (`dist/index.js`) that makes these decisions:
333
1496
  - Cache location: `XDG_CACHE_HOME=...`
334
1497
  - Upgrade pip during bootstrap (optional): `RAPIDKIT_BRIDGE_UPGRADE_PIP=1`
335
1498
 
1499
+ ### Workspace Markers
1500
+
1501
+ Workspaces created by the npm package include a `.rapidkit-workspace` marker file:
1502
+
1503
+ ```json
1504
+ {
1505
+ "signature": "RAPIDKIT_WORKSPACE",
1506
+ "createdBy": "rapidkit-npm",
1507
+ "version": "0.15.1",
1508
+ "createdAt": "2026-02-01T...",
1509
+ "name": "my-workspace"
1510
+ }
1511
+ ```
1512
+
1513
+ This marker enables:
1514
+ - Workspace auto-detection by VS Code Extension
1515
+ - Cross-tool workspace compatibility
1516
+ - Workspace validation and version tracking
1517
+
336
1518
  ## Development
337
1519
 
338
1520
  ```bash