exisjs 0.7.12 → 0.7.13

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.
Files changed (116) hide show
  1. package/README.md +195 -39
  2. package/dist/config/types.d.ts +2 -2
  3. package/dist/config/types.d.ts.map +1 -1
  4. package/dist/decorators/params.d.ts +21 -0
  5. package/dist/decorators/params.d.ts.map +1 -1
  6. package/dist/decorators/params.js +21 -1
  7. package/dist/decorators/params.js.map +1 -1
  8. package/dist/di/container.d.ts +15 -6
  9. package/dist/di/container.d.ts.map +1 -1
  10. package/dist/di/container.js +26 -3
  11. package/dist/di/container.js.map +1 -1
  12. package/dist/di/index.d.ts +1 -1
  13. package/dist/di/index.d.ts.map +1 -1
  14. package/dist/di/index.js.map +1 -1
  15. package/dist/di/inject.d.ts +2 -1
  16. package/dist/di/inject.d.ts.map +1 -1
  17. package/dist/di/inject.js +2 -1
  18. package/dist/di/inject.js.map +1 -1
  19. package/dist/docs/BENCHMARKS.md +4 -4
  20. package/dist/docs/content/README.md +43 -44
  21. package/dist/docs/content/boundaries.mdx +138 -61
  22. package/dist/docs/content/cli/commands.mdx +151 -128
  23. package/dist/docs/content/cli/overview.mdx +61 -47
  24. package/dist/docs/content/cli/usage.mdx +107 -30
  25. package/dist/docs/content/config.mdx +145 -158
  26. package/dist/docs/content/controllers.mdx +193 -464
  27. package/dist/docs/content/cron.mdx +183 -69
  28. package/dist/docs/content/decorators.mdx +449 -154
  29. package/dist/docs/content/errors.mdx +202 -305
  30. package/dist/docs/content/exisjs-mcp.mdx +59 -49
  31. package/dist/docs/content/installation.mdx +243 -157
  32. package/dist/docs/content/introduction.mdx +220 -48
  33. package/dist/docs/content/middleware.mdx +171 -497
  34. package/dist/docs/content/modules.mdx +141 -83
  35. package/dist/docs/content/providers.mdx +216 -180
  36. package/dist/docs/content/requests.mdx +168 -488
  37. package/dist/docs/content/responses.mdx +200 -533
  38. package/dist/docs/content/routing.mdx +235 -598
  39. package/dist/docs/content/security.mdx +233 -57
  40. package/dist/docs/content/structure.mdx +151 -240
  41. package/dist/docs/content/swagger.mdx +192 -91
  42. package/dist/docs/content/testing.mdx +205 -74
  43. package/dist/docs/content/validation.mdx +479 -341
  44. package/dist/docs/reference/README.md +34 -2
  45. package/dist/docs/reference/config.mdx +277 -75
  46. package/dist/docs/reference/context.mdx +197 -106
  47. package/dist/docs/reference/cron.mdx +266 -152
  48. package/dist/docs/reference/database.mdx +135 -53
  49. package/dist/docs/reference/decorators.mdx +234 -116
  50. package/dist/docs/reference/di.mdx +146 -112
  51. package/dist/docs/reference/error.mdx +155 -178
  52. package/dist/docs/reference/exis.mdx +141 -70
  53. package/dist/docs/reference/logger.mdx +110 -126
  54. package/dist/docs/reference/middleware.mdx +235 -158
  55. package/dist/docs/reference/plugin.mdx +136 -64
  56. package/dist/docs/reference/router.mdx +275 -293
  57. package/dist/docs/reference/sanitize.mdx +91 -87
  58. package/dist/docs/reference/swagger.mdx +280 -100
  59. package/dist/docs/reference/testing.mdx +223 -89
  60. package/dist/docs/reference/validator.mdx +194 -206
  61. package/dist/lib/start-server.js +3 -8
  62. package/dist/lib/start-server.js.map +1 -1
  63. package/dist/module/module.d.ts +6 -3
  64. package/dist/module/module.d.ts.map +1 -1
  65. package/dist/module/module.js +17 -3
  66. package/dist/module/module.js.map +1 -1
  67. package/dist/router/controller-registrar.d.ts.map +1 -1
  68. package/dist/router/controller-registrar.js +26 -4
  69. package/dist/router/controller-registrar.js.map +1 -1
  70. package/dist/server/app.d.ts +3 -1
  71. package/dist/server/app.d.ts.map +1 -1
  72. package/dist/server/app.js +24 -8
  73. package/dist/server/app.js.map +1 -1
  74. package/dist/server/request.d.ts +2 -0
  75. package/dist/server/request.d.ts.map +1 -1
  76. package/dist/server/request.js +11 -0
  77. package/dist/server/request.js.map +1 -1
  78. package/dist/swagger/generator.d.ts.map +1 -1
  79. package/dist/swagger/generator.js +130 -10
  80. package/dist/swagger/generator.js.map +1 -1
  81. package/dist/telemetry/index.d.ts +12 -0
  82. package/dist/telemetry/index.d.ts.map +1 -0
  83. package/dist/telemetry/index.js +121 -0
  84. package/dist/telemetry/index.js.map +1 -0
  85. package/dist/testing/client.d.ts +1 -0
  86. package/dist/testing/client.d.ts.map +1 -1
  87. package/dist/testing/client.js +4 -1
  88. package/dist/testing/client.js.map +1 -1
  89. package/dist/testing/index.d.ts.map +1 -1
  90. package/dist/testing/index.js +11 -4
  91. package/dist/testing/index.js.map +1 -1
  92. package/dist/validator/builder.d.ts +26 -1
  93. package/dist/validator/builder.d.ts.map +1 -1
  94. package/dist/validator/builder.js +31 -0
  95. package/dist/validator/builder.js.map +1 -1
  96. package/dist/validator/engine.d.ts +23 -0
  97. package/dist/validator/engine.d.ts.map +1 -1
  98. package/dist/validator/engine.js +228 -31
  99. package/dist/validator/engine.js.map +1 -1
  100. package/dist/validator/index.d.ts +8 -4
  101. package/dist/validator/index.d.ts.map +1 -1
  102. package/dist/validator/index.js +4 -1
  103. package/dist/validator/index.js.map +1 -1
  104. package/dist/validator/tex-types.d.ts +15 -0
  105. package/dist/validator/tex-types.d.ts.map +1 -1
  106. package/dist/validator/tex-types.js +102 -0
  107. package/dist/validator/tex-types.js.map +1 -1
  108. package/dist/validator/tex.d.ts +1 -1
  109. package/dist/validator/tex.d.ts.map +1 -1
  110. package/dist/validator/tex.js +3 -1
  111. package/dist/validator/tex.js.map +1 -1
  112. package/dist/validator/types.d.ts +1 -0
  113. package/dist/validator/types.d.ts.map +1 -1
  114. package/package.json +46 -14
  115. package/dist/docs/content/dataloader.mdx +0 -170
  116. package/dist/docs/reference/dataloader.mdx +0 -91
@@ -1,241 +1,264 @@
1
1
  ---
2
- nextUrl: "/docs"
3
- nextTitle: "Introduction"
2
+ title: "CLI Commands"
3
+ description: "Comprehensive command-line reference for all ExisJS development, build, diagnostic, and scaffolding commands."
4
+ nextUrl: "/docs/reference/config"
5
+ nextTitle: "Config Reference"
4
6
  ---
5
7
 
6
- # CLI Command Reference
8
+ # CLI Commands
7
9
 
8
- ### `exisjs dev`
10
+ The ExisJS CLI provides tools for local development, production compilation, scaffolding, testing, database scripting, and environment auditing.
9
11
 
10
- Starts the development server with live reload and automatic port collision avoidance.
12
+ ---
13
+
14
+ ## `exisjs dev`
15
+
16
+ Starts the development server with live file watching, TypeScript transpilation, and automatic port collision avoidance.
11
17
 
12
18
  ```bash
13
- $ npx exisjs dev [options]
19
+ npx exisjs dev [options]
14
20
  ```
15
21
 
16
- **Options**
22
+ ### Options
17
23
 
18
- | Option | Description |
19
- | :--- | :--- |
20
- | `-p, --port <port>` | Port to listen on (overrides `.env` and `exis.config.ts`). |
21
- | `-H, --host <host>` | Host to bind to (e.g. `0.0.0.0` or `localhost`). |
22
- | `-e, --entry <file>` | Custom entry file path (default: `src/http/server.ts`). |
24
+ | Option | Type | Default | Description |
25
+ | :--- | :--- | :--- | :--- |
26
+ | `-p, --port <port>` | `number` | `3000` | Port to listen on (overrides `.env` and `exis.config.ts`). |
27
+ | `-H, --host <host>` | `string` | `localhost` | Host address to bind to. |
28
+ | `-e, --entry <file>` | `string` | `src/http/server.ts` | Custom entry file path to bootstrap the application. |
23
29
 
24
- - **Automatic Port Collision Detection**: If the designated port is occupied, the CLI detects the conflict and increments to the next available port automatically.
25
- - **PID Lockfile**: Manages a `.exis/dev.pid` lockfile to prevent accidentally spawning duplicate dev servers in the same directory.
30
+ ### Behavior
31
+ - **Port Collision Detection**: If the specified port is in use, the CLI automatically increments to the next open port.
32
+ - **PID Lockfile**: Manages `.exis/dev.pid` to prevent duplicate dev server processes in the same workspace.
26
33
 
27
34
  ---
28
35
 
29
- ### `exisjs build`
36
+ ## `exisjs build`
30
37
 
31
- Compiles TypeScript to production JavaScript and produces route manifests.
38
+ Compiles the TypeScript application to production JavaScript, performs type-checking, and generates static route manifests.
32
39
 
33
40
  ```bash
34
- $ npx exisjs build [options]
41
+ npx exisjs build [options]
35
42
  ```
36
43
 
37
- **Options**
44
+ ### Options
38
45
 
39
- | Option | Description |
40
- | :--- | :--- |
41
- | `-o, --out-dir <dir>` | Output directory (default: `.exis/server` or `dist`). |
42
- | `--no-clean` | Skip cleaning the output directory before compilation. |
46
+ | Option | Type | Default | Description |
47
+ | :--- | :--- | :--- | :--- |
48
+ | `-o, --out-dir <dir>` | `string` | `.exis/server` | Output directory for compiled JavaScript assets. |
49
+ | `--no-clean` | `boolean` | `false` | Skip cleaning the output directory prior to compilation. |
50
+ | `--skip-env-check` | `boolean` | `false` | Skip build-time route and environment validation checks. |
51
+ | `--dry-run` | `boolean` | `false` | Compile and bundle without halting on missing environment variables. |
52
+ | `-m, --mode <mode>` | `string` | `production` | Environment mode to load (e.g. `production`, `staging`). |
43
53
 
44
- - **Type-Check**: Runs the TypeScript compiler in check-only mode (`noEmit`) to verify strict typing before compiling.
45
- - **Fast Bundling**: Emits JavaScript via esbuild.
46
- - **Route Manifest**: Generates `.exis/routes-manifest.js` to enable O(1) route discovery at runtime without filesystem directory walks.
54
+ ### Build Outputs
55
+ - Compiles application source code into the specified `outDir`.
56
+ - Emits pre-computed route manifests (`.exis/routes-manifest.js`) for O(1) route discovery at runtime.
57
+ - Generates TypeScript environment definitions (`.exis/exis.d.ts`).
47
58
 
48
59
  ---
49
60
 
50
- ### `exisjs start`
61
+ ## `exisjs clean`
51
62
 
52
- Starts the compiled production server.
63
+ Removes temporary build artifacts, compiled files, and cached manifests.
53
64
 
54
65
  ```bash
55
- $ npx exisjs start [options]
66
+ npx exisjs clean [options]
67
+ npx exisjs cl [options]
56
68
  ```
57
69
 
58
- **Options**
70
+ ### Options
59
71
 
60
- | Option | Description |
61
- | :--- | :--- |
62
- | `-p, --port <port>` | Port to listen on. |
63
- | `-H, --host <host>` | Host to bind to. |
64
- | `-e, --entry <file>` | Custom compiled entry file path. |
72
+ | Option | Type | Default | Description |
73
+ | :--- | :--- | :--- | :--- |
74
+ | `-a, --all` | `boolean` | `false` | In addition to `.exis/`, also remove the `dist/` directory. |
75
+
76
+ ---
77
+
78
+ ## `exisjs start`
79
+
80
+ Starts the compiled production server from the build output directory.
81
+
82
+ ```bash
83
+ npx exisjs start [options]
84
+ ```
85
+
86
+ ### Options
87
+
88
+ | Option | Type | Default | Description |
89
+ | :--- | :--- | :--- | :--- |
90
+ | `-p, --port <port>` | `number` | `3000` | Port to listen on. |
91
+ | `-H, --host <host>` | `string` | `0.0.0.0` | Host address to bind to. |
92
+ | `-e, --entry <file>` | `string` | `.exis/server/src/http/server.js` | Custom compiled entry file path. |
65
93
 
66
94
  ---
67
95
 
68
- ### `exisjs generate`
96
+ ## `exisjs generate`
69
97
 
70
- Scaffolds framework components and files according to ExisJS core conventions.
98
+ Scaffolds framework components and files according to ExisJS file conventions.
71
99
 
72
100
  ```bash
73
- $ npx exisjs generate <type> <name> [options]
74
- $ npx exisjs g <type> <name> [options]
101
+ npx exisjs generate <type> [name] [options]
102
+ npx exisjs g <type> [name] [options]
75
103
  ```
76
104
 
77
- **Arguments**
105
+ ### Arguments
78
106
 
79
107
  | Argument | Description |
80
108
  | :--- | :--- |
81
109
  | `<type>` | The schematic type to generate. |
82
- | `<name>` | The name of the feature / folder. |
110
+ | `[name]` | The name of the feature or folder (required for all types except `error`). |
83
111
 
84
- **Options**
112
+ ### Options
85
113
 
86
- | Option | Description |
87
- | :--- | :--- |
88
- | `-n, --named` | Names generated files using the feature prefix (e.g. `<name>.route.ts`, `<name>.schema.ts`, `<name>.service.ts`). |
89
- | `--oop` | Generates using Class-Based (OOP) decorators instead of Functional syntax. |
114
+ | Option | Type | Default | Description |
115
+ | :--- | :--- | :--- | :--- |
116
+ | `-n, --named` | `boolean` | `false` | Names generated files using the feature prefix (e.g. `user.route.ts`, `user.schema.ts`). |
117
+ | `--oop` | `boolean` | `false` | Generates using Class-Based (OOP) decorators instead of Functional syntax. |
90
118
 
91
- **Supported Schematics**
119
+ ### Supported Schematics
92
120
 
93
- | Schematic | Alias | Description | Output Path |
121
+ | Schematic | Alias | Description | Output Location |
94
122
  | :--- | :--- | :--- | :--- |
95
- | `crud` | `resource` | Full 4-file CRUD slice (`schema.ts`, `service.ts`, `route.ts`, and `model.ts` entity), 100% database-agnostic | `src/http/<name>/` & `src/models/` |
96
- | `model` | | Standalone database-agnostic TypeScript entity and input types | `src/models/<Name>.ts` |
97
- | `route` | `r`, `c`, `controller` | HTTP route file | `src/http/<name>/route.ts` |
98
- | `service` | `s` | Injectable service / business logic with pagination helpers | `src/http/<name>/service.ts` |
99
- | `schema` | `sc` | Validation schemas powered by `tex` (includes pagination) | `src/http/<name>/schema.ts` |
100
- | `boundary` | `b` | Folder-scoped configuration and request pipeline | `src/http/<name>/boundary.ts` |
101
- | `plugin` | `p` | Distributable plugin module | `src/plugins/<name>.ts` |
102
- | `middleware` | `m` | Standalone middleware handler | `src/middleware/<name>.ts` |
103
- | `test` | `t` | Native test suite | `tests/<name>.test.ts` |
123
+ | `crud` | `resource` | Generates full 4-file CRUD slice (`schema`, `service`, `route`, `model`). | `src/http/<name>/` & `src/models/` |
124
+ | `model` | | Standalone database-agnostic TypeScript entity interface. | `src/models/<Name>.ts` |
125
+ | `route` | `r`, `c`, `controller` | HTTP route endpoint definition. | `src/http/<name>/route.ts` |
126
+ | `service` | `s` | Injectable service with pagination utilities. | `src/http/<name>/service.ts` |
127
+ | `schema` | `sc` | Validation schemas with `tex` validators and pagination DTOs. | `src/http/<name>/schema.ts` |
128
+ | `boundary` | `b` | Folder-level boundary middleware configuration. | `src/http/<name>/boundary.ts` |
129
+ | `cron` | `job` | Scheduled cron background task. | `src/cron/<name>.ts` |
130
+ | `error` | `err` | Global error handler fallback. | `src/http/error.ts` |
131
+ | `plugin` | `p` | Reusable ExisJS plugin module. | `src/plugins/<name>.ts` |
132
+ | `middleware` | `m` | Standalone middleware handler function. | `src/middleware/<name>.ts` |
133
+ | `test` | `t` | Integration test file using `node:test` and `exisjs/testing`. | `tests/<name>.test.ts` |
104
134
 
105
135
  ---
106
136
 
107
- ### `exisjs routes`
137
+ ## `exisjs routes`
108
138
 
109
- Analyzes and prints the application routing table to the terminal in an interactive, formatted grid with method badges and dynamic parameter highlighting.
139
+ Inspects and displays the complete application routing table in formatted tabular output or raw JSON.
110
140
 
111
141
  ```bash
112
- $ npx exisjs routes [options]
142
+ npx exisjs routes [options]
113
143
  ```
114
144
 
115
- **Options**
145
+ ### Options
116
146
 
117
- | Option | Description |
118
- | :--- | :--- |
119
- | `-e, --entry <file>` | Custom entry file path to bootstrap the app from (default: `src/http/server.ts`). |
120
- | `-m, --method <method>` | Filter endpoints by HTTP method (e.g. `GET`, `POST`, `PUT`, `DELETE`). |
121
- | `-f, --filter <keyword>` | Filter endpoints matching path, method, or source file keyword. |
122
- | `--json` | Output the parsed routes and middleware metadata directly as structured JSON. |
123
-
124
- **Features**
125
- - **Method Badges**: Visually styled badges (`GET`, `POST`, `PUT`, `PATCH`, `DEL`, `ALL`).
126
- - **Parameter Highlighting**: Dynamically distinguishes path parameters (`:id`, `*slug`).
127
- - **Middleware Counting**: Displays total attached middleware / boundary steps.
128
- - **Source Resolution**: Displays relative file source path (e.g. `src/http/users/user.route.ts`).
129
- - **Summary Metrics**: Displays total endpoint counts and method breakdown.
147
+ | Option | Type | Default | Description |
148
+ | :--- | :--- | :--- | :--- |
149
+ | `-e, --entry <file>` | `string` | `src/http/server.ts` | Custom entry file path to discover routes from. |
150
+ | `-m, --method <method>` | `string` | None | Filter endpoints by HTTP method (e.g. `GET`, `POST`). |
151
+ | `-f, --filter <keyword>` | `string` | None | Filter endpoints by path, method, or source file keyword. |
152
+ | `--json` | `boolean` | `false` | Output routes and middleware metadata in JSON format. |
130
153
 
131
154
  ---
132
155
 
133
- ### `exisjs init`
156
+ ## `exisjs test`
134
157
 
135
- Initializes a new ExisJS project in the current directory using `create-exisjs`.
158
+ Runs the test suite using the integrated Node.js test runner (`node:test`).
136
159
 
137
160
  ```bash
138
- $ npx exisjs init
161
+ npx exisjs test [files...] [options]
139
162
  ```
140
163
 
164
+ ### Arguments & Options
165
+
166
+ | Argument / Option | Type | Description |
167
+ | :--- | :--- | :--- |
168
+ | `[files...]` | `string[]` | Specific test files or glob patterns to run. |
169
+ | `--watch` | `boolean` | Watch for file changes and re-execute tests automatically. |
170
+ | `-u, --update` | `boolean` | Update snapshot assertions. |
171
+ | `-e, --entry <file>` | `string` | Custom entry file path to bootstrap before test execution. |
172
+
141
173
  ---
142
174
 
143
- ### `exisjs test`
175
+ ## `exisjs run`
144
176
 
145
- Runs the native Node.js test runner (`node:test`) across the project.
177
+ Executes standalone scripts, migration utilities, or third-party CLI tools with ExisJS `.env` files automatically loaded into `process.env`.
146
178
 
147
179
  ```bash
148
- $ npx exisjs test [files...] [options]
180
+ npx exisjs run <scriptOrCmd> [args...] [options]
181
+ npx exisjs exec <scriptOrCmd> [args...] [options]
149
182
  ```
150
183
 
151
- **Options**
152
-
153
- | Option | Description |
154
- | :--- | :--- |
155
- | `--watch` | Watch for file changes and re-run tests. |
156
- | `-u, --update` | Update test snapshots. |
157
- | `-e, --entry <file>` | Custom entry file path to bootstrap before running tests. |
158
-
159
- ---
184
+ ### Options
160
185
 
161
- ### `exisjs run`
186
+ | Option | Type | Description |
187
+ | :--- | :--- | :--- |
188
+ | `-e, --env <file>` | `string` | Path to a specific environment file to load. |
189
+ | `-m, --mode <mode>` | `string` | Environment mode to load (e.g. `production`, `staging`, `development`). |
162
190
 
163
- Executes any standalone TypeScript script, migration runner, or external tool (e.g. `drizzle-kit`, `prisma`, `knex`) with ExisJS `.env` files automatically loaded into `process.env`.
191
+ ### Examples
164
192
 
165
193
  ```bash
166
- $ npx exisjs run <scriptOrCmd> [args...] [options]
167
- $ npx exisjs exec <scriptOrCmd> [args...] [options]
194
+ # Execute a TypeScript seed script
195
+ npx exisjs run src/database/seed.ts
196
+
197
+ # Run an external database CLI with ExisJS environment loaded
198
+ npx exisjs run prisma migrate deploy
199
+ npx exisjs run drizzle-kit push
168
200
  ```
169
201
 
170
- **Options**
202
+ ---
171
203
 
172
- | Option | Description |
173
- | :--- | :--- |
174
- | `-e, --env <file>` | Custom environment file to load. |
175
- | `-m, --mode <mode>` | Environment mode to load (e.g. `production`, `development`, `staging`). |
204
+ ## `exisjs console`
176
205
 
177
- **Examples**
206
+ Starts an interactive Node.js REPL environment loaded with the application context.
178
207
 
179
208
  ```bash
180
- # Run Drizzle migrations with auto-loaded .env database credentials
181
- $ npx exisjs run drizzle-kit push
209
+ npx exisjs console [options]
210
+ npx exisjs repl [options]
211
+ ```
182
212
 
183
- # Execute a TypeScript database seed script
184
- $ npx exisjs run src/database/seed.ts
213
+ ### Options
185
214
 
186
- # Run with a custom environment file
187
- $ npx exisjs run scripts/report.ts --env .env.staging
188
- ```
215
+ | Option | Type | Default | Description |
216
+ | :--- | :--- | :--- | :--- |
217
+ | `-e, --entry <file>` | `string` | `src/http/server.ts` | Custom entry file to bootstrap REPL context. |
189
218
 
190
219
  ---
191
220
 
192
- ### `exisjs repl`
221
+ ## `exisjs doctor`
193
222
 
194
- Starts an interactive Node.js REPL console loaded with your application context.
223
+ Runs an end-to-end diagnostic audit of the local project environment.
195
224
 
196
225
  ```bash
197
- $ npx exisjs repl [options]
198
- $ npx exisjs console [options]
226
+ npx exisjs doctor
199
227
  ```
200
228
 
201
- **Options**
202
-
203
- | Option | Description |
204
- | :--- | :--- |
205
- | `-e, --entry <file>` | Custom entry file path to bootstrap the REPL context. |
229
+ ### Diagnostic Checks
230
+ - **Runtime Environment**: Validates Node.js version compatibility (Node.js 18+).
231
+ - **Native Acceleration**: Checks whether `@exisjs/rs` compiled native binaries are active.
232
+ - **Project Structure**: Verifies `package.json`, `tsconfig.json`, and application entry points.
233
+ - **Route Integrity**: Audits `src/http/` directory for naming conventions and orphan files.
206
234
 
207
235
  ---
208
236
 
209
- ### `exisjs exports`
237
+ ## `exisjs info`
210
238
 
211
- Lists all available framework exports and public subpaths exposed by `exisjs/*`.
239
+ Prints runtime environment details, including ExisJS version, Node.js version, platform, and operating system architecture.
212
240
 
213
241
  ```bash
214
- $ npx exisjs exports
242
+ npx exisjs info
215
243
  ```
216
244
 
217
245
  ---
218
246
 
219
- ### `exisjs info`
247
+ ## `exisjs exports`
220
248
 
221
- Displays runtime environment, Node.js version, platform, architecture, and ExisJS version.
249
+ Lists all public subpath exports provided by the `exisjs` package.
222
250
 
223
251
  ```bash
224
- $ npx exisjs info
252
+ npx exisjs exports
225
253
  ```
226
254
 
227
255
  ---
228
256
 
229
- ### `exisjs doctor`
257
+ ## `exisjs init`
230
258
 
231
- Performs an end-to-end diagnostic audit of the local project environment, verifying Node.js version compatibility, native Rust hardware acceleration (`@exisjs/rs`), `tsconfig.json` strictness, entry-point resolution, route naming patterns, and file-system route counts.
259
+ Initializes a new ExisJS project interactively in the current working directory.
232
260
 
233
261
  ```bash
234
- $ npx exisjs doctor
262
+ npx exisjs init
235
263
  ```
236
264
 
237
- **Diagnostic Checks**
238
- - **Runtime**: Validates Node.js engine compatibility (v18+ recommended for N-API and worker thread pools).
239
- - **Native Engine**: Verifies `@exisjs/rs` compiled native binaries are active for hardware-accelerated radix tree traversal, off-heap caching, and native JSON serialization.
240
- - **Project Configuration**: Checks `package.json` root and `tsconfig.json` strict mode.
241
- - **Routes & Pipeline**: Confirms application entry point (`src/http/server.ts`), discovers active route slices, and flags non-standard or orphan file naming conventions.
@@ -1,84 +1,98 @@
1
1
  ---
2
+ title: "CLI Overview"
3
+ description: "Architecture, execution modes, and command structure of the ExisJS developer CLI."
2
4
  nextUrl: "/docs/cli/usage"
3
5
  nextTitle: "CLI Usage"
4
6
  ---
5
7
 
6
- # Overview
8
+ # CLI Overview
7
9
 
8
- The ExisJS CLI (`exis` / `exisjs`) is a developer tool that assists in initializing, developing, building, and running ExisJS applications.
10
+ The ExisJS CLI (`exisjs` or `exis`) is the command-line interface for developing, compiling, running, and diagnosing ExisJS applications.
9
11
 
10
- The CLI is engineered around ExisJS core conventions: file-system routing under `src/http/`, schema validation with `tex`, directory-scoped boundaries (`boundary.ts`), and high-performance production builds with route manifests.
12
+ The CLI is structured around ExisJS core conventions:
13
+ - File-system route discovery under `src/http/`.
14
+ - Schema compilation with `tex`.
15
+ - Pre-compiled route manifests (`.exis/routes-manifest.js`) for O(1) runtime lookup.
16
+ - Environment variable cascading (`.env`).
17
+ - Native test execution using `node:test`.
11
18
 
12
- ## Installation
19
+ ---
20
+
21
+ ## Installation & Execution
13
22
 
14
- The CLI can be run on-demand via `npx` or installed globally via npm:
23
+ ### On-Demand via `npx`
24
+
25
+ Run commands directly without global installation:
15
26
 
16
27
  ```bash
17
- # Run on-demand (recommended for scaffolding new projects)
18
- $ npx exisjs init my-api
28
+ # Initialize a new project in a directory
29
+ npx exisjs init
19
30
 
20
- # Or install globally
21
- $ npm install -g exisjs
31
+ # Start the dev server
32
+ npx exisjs dev
22
33
  ```
23
34
 
24
- Inside an initialized ExisJS project, the CLI is locally available and executed via `npx exisjs` or `npm run <script>`.
25
-
26
- ## Basic Workflow
35
+ ### Global Installation
27
36
 
28
- Once in your terminal, invoke CLI commands directly:
37
+ To install the `exisjs` / `exis` binary globally:
29
38
 
30
39
  ```bash
31
- # View help for all commands
32
- $ npx exisjs --help
33
-
34
- # View help for a specific command
35
- $ npx exisjs generate --help
40
+ npm install -g exisjs
36
41
  ```
37
42
 
38
- To create and run a new project:
43
+ ### Project-Local Execution
39
44
 
40
- ```bash
41
- $ npx exisjs init my-app
42
- $ cd my-app
43
- $ npm run dev
44
- ```
45
+ Inside an initialized ExisJS project, the CLI is available locally through `npm run` scripts or `npx exisjs`.
45
46
 
46
- Open `http://localhost:4000` (or the dynamically resolved available port) to access your running API.
47
+ ---
47
48
 
48
- ## CLI Command Syntax
49
+ ## Command Syntax
49
50
 
50
- All ExisJS CLI commands follow this standard structure:
51
+ All CLI commands adhere to the standard command structure:
51
52
 
52
53
  ```bash
53
54
  exisjs <command> [arguments] [options]
54
55
  ```
55
56
 
56
- For example:
57
+ Or using the shorter alias:
57
58
 
58
59
  ```bash
59
- # Scaffold a new route with functional syntax
60
- $ npx exisjs generate route users
60
+ exis <command> [arguments] [options]
61
+ ```
62
+
63
+ ### Examples
64
+
65
+ ```bash
66
+ # Start development server on port 5000
67
+ npx exisjs dev -p 5000
61
68
 
62
- # Scaffold with class-based (OOP) decorators
63
- $ npx exisjs generate route users --oop
69
+ # Scaffold an HTTP route in Functional paradigm
70
+ npx exisjs generate route users
64
71
 
65
- # Use the short alias
66
- $ npx exisjs g r users --oop
72
+ # Scaffold with Class-Based (OOP) decorators
73
+ npx exisjs generate route users --oop
74
+
75
+ # Print the application routing table
76
+ npx exisjs routes
67
77
  ```
68
78
 
69
- ## Command Overview
79
+ ---
80
+
81
+ ## Command Summary
70
82
 
71
83
  | Command | Alias | Description |
72
84
  | :--- | :--- | :--- |
73
- | `dev` | | Starts the development server with HMR and automatic port collision avoidance. |
74
- | `build` | | Type-checks and compiles TypeScript to production JavaScript with route manifest generation. |
75
- | `start` | | Runs the compiled production server. |
76
- | `routes` | | Prints the application routing table to the terminal. |
77
- | `generate` | `g` | Scaffolds framework slices (resource, route, service, schema, boundary, plugin, middleware, test). |
78
- | `test` | | Runs the native Node.js test suite (`node:test`) with custom Jest-style reporting. |
79
- | `run` | `exec` | Executes a script or external tool (e.g. `drizzle-kit`, `prisma`) with auto-loaded `.env`. |
80
- | `repl` | `console` | Starts an interactive Node.js REPL loaded with the application context. |
81
- | `exports` | | Displays all available `@exisjs` and `exisjs/*` subpath exports. |
82
- | `info` | | Displays system, Node.js, and ExisJS runtime information. |
83
- | `doctor` | | Performs system, native Rust acceleration, TypeScript, and routing diagnostics. |
84
- | `init` | | Initializes a new ExisJS application in the current directory. |
85
+ | `dev` | | Starts development server with file watching and automatic port collision avoidance. |
86
+ | `build` | | Type-checks and compiles TypeScript to JavaScript, generating route manifests. |
87
+ | `start` | | Starts the compiled production server. |
88
+ | `clean` | `cl` | Removes `.exis` build artifacts and cached manifests (`-a` to include `dist/`). |
89
+ | `routes` | | Analyzes and prints the application routing table to the terminal or JSON. |
90
+ | `generate` | `g` | Scaffolds framework components (`crud`, `model`, `route`, `service`, `schema`, `boundary`, `plugin`, `middleware`, `test`). |
91
+ | `test` | | Runs test suites using the native `node:test` runner. |
92
+ | `run` | `exec` | Executes a script or external command with ExisJS `.env` files pre-loaded. |
93
+ | `console` | `repl` | Launches an interactive Node.js REPL loaded with the application context. |
94
+ | `doctor` | | Audits project health, native Rust bindings, configuration, and route structure. |
95
+ | `info` | | Displays runtime environment, Node.js version, platform, and OS architecture. |
96
+ | `exports` | | Lists all framework public subpath export modules. |
97
+ | `init` | | Initializes an ExisJS application in the current working directory. |
98
+