exisjs 0.7.12 → 0.7.14
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 +195 -39
- package/dist/cli/commands/run.d.ts.map +1 -1
- package/dist/cli/commands/run.js +3 -1
- package/dist/cli/commands/run.js.map +1 -1
- package/dist/config/types.d.ts +2 -2
- package/dist/config/types.d.ts.map +1 -1
- package/dist/decorators/params.d.ts +21 -0
- package/dist/decorators/params.d.ts.map +1 -1
- package/dist/decorators/params.js +21 -1
- package/dist/decorators/params.js.map +1 -1
- package/dist/di/container.d.ts +15 -6
- package/dist/di/container.d.ts.map +1 -1
- package/dist/di/container.js +26 -3
- package/dist/di/container.js.map +1 -1
- package/dist/di/index.d.ts +1 -1
- package/dist/di/index.d.ts.map +1 -1
- package/dist/di/index.js.map +1 -1
- package/dist/di/inject.d.ts +2 -1
- package/dist/di/inject.d.ts.map +1 -1
- package/dist/di/inject.js +2 -1
- package/dist/di/inject.js.map +1 -1
- package/dist/docs/ARCHITECTURE.md +130 -78
- package/dist/docs/BENCHMARKS.md +4 -4
- package/dist/docs/content/README.md +43 -44
- package/dist/docs/content/boundaries.mdx +138 -61
- package/dist/docs/content/cli/commands.mdx +151 -128
- package/dist/docs/content/cli/overview.mdx +61 -47
- package/dist/docs/content/cli/usage.mdx +107 -30
- package/dist/docs/content/config.mdx +145 -158
- package/dist/docs/content/controllers.mdx +193 -464
- package/dist/docs/content/cron.mdx +183 -69
- package/dist/docs/content/decorators.mdx +449 -154
- package/dist/docs/content/errors.mdx +202 -305
- package/dist/docs/content/exisjs-mcp.mdx +59 -49
- package/dist/docs/content/installation.mdx +243 -157
- package/dist/docs/content/introduction.mdx +220 -48
- package/dist/docs/content/middleware.mdx +171 -497
- package/dist/docs/content/modules.mdx +141 -83
- package/dist/docs/content/providers.mdx +216 -180
- package/dist/docs/content/requests.mdx +168 -488
- package/dist/docs/content/responses.mdx +200 -533
- package/dist/docs/content/routing.mdx +235 -598
- package/dist/docs/content/security.mdx +233 -57
- package/dist/docs/content/structure.mdx +151 -240
- package/dist/docs/content/swagger.mdx +192 -91
- package/dist/docs/content/testing.mdx +205 -74
- package/dist/docs/content/validation.mdx +479 -341
- package/dist/docs/reference/README.md +34 -2
- package/dist/docs/reference/config.mdx +277 -75
- package/dist/docs/reference/context.mdx +197 -106
- package/dist/docs/reference/cron.mdx +266 -152
- package/dist/docs/reference/database.mdx +135 -53
- package/dist/docs/reference/decorators.mdx +234 -116
- package/dist/docs/reference/di.mdx +146 -112
- package/dist/docs/reference/error.mdx +155 -178
- package/dist/docs/reference/exis.mdx +141 -70
- package/dist/docs/reference/logger.mdx +110 -126
- package/dist/docs/reference/middleware.mdx +235 -158
- package/dist/docs/reference/plugin.mdx +136 -64
- package/dist/docs/reference/router.mdx +275 -293
- package/dist/docs/reference/sanitize.mdx +91 -87
- package/dist/docs/reference/swagger.mdx +280 -100
- package/dist/docs/reference/testing.mdx +223 -89
- package/dist/docs/reference/validator.mdx +194 -206
- package/dist/lib/start-server.js +22 -8
- package/dist/lib/start-server.js.map +1 -1
- package/dist/module/module.d.ts +6 -3
- package/dist/module/module.d.ts.map +1 -1
- package/dist/module/module.js +17 -3
- package/dist/module/module.js.map +1 -1
- package/dist/router/controller-registrar.d.ts.map +1 -1
- package/dist/router/controller-registrar.js +26 -4
- package/dist/router/controller-registrar.js.map +1 -1
- package/dist/router/scanner/fs-scanner.d.ts.map +1 -1
- package/dist/router/scanner/fs-scanner.js +22 -0
- package/dist/router/scanner/fs-scanner.js.map +1 -1
- package/dist/router/types.d.ts +6 -4
- package/dist/router/types.d.ts.map +1 -1
- package/dist/server/app.d.ts +3 -1
- package/dist/server/app.d.ts.map +1 -1
- package/dist/server/app.js +24 -8
- package/dist/server/app.js.map +1 -1
- package/dist/server/bootstrapper.d.ts.map +1 -1
- package/dist/server/bootstrapper.js +19 -0
- package/dist/server/bootstrapper.js.map +1 -1
- package/dist/server/request.d.ts +2 -0
- package/dist/server/request.d.ts.map +1 -1
- package/dist/server/request.js +11 -0
- package/dist/server/request.js.map +1 -1
- package/dist/server/response.d.ts +10 -5
- package/dist/server/response.d.ts.map +1 -1
- package/dist/server/response.js +65 -18
- package/dist/server/response.js.map +1 -1
- package/dist/swagger/generator.d.ts.map +1 -1
- package/dist/swagger/generator.js +130 -10
- package/dist/swagger/generator.js.map +1 -1
- package/dist/telemetry/index.d.ts +12 -0
- package/dist/telemetry/index.d.ts.map +1 -0
- package/dist/telemetry/index.js +121 -0
- package/dist/telemetry/index.js.map +1 -0
- package/dist/testing/client.d.ts +1 -0
- package/dist/testing/client.d.ts.map +1 -1
- package/dist/testing/client.js +4 -1
- package/dist/testing/client.js.map +1 -1
- package/dist/testing/index.d.ts.map +1 -1
- package/dist/testing/index.js +11 -4
- package/dist/testing/index.js.map +1 -1
- package/dist/validator/builder.d.ts +26 -1
- package/dist/validator/builder.d.ts.map +1 -1
- package/dist/validator/builder.js +31 -0
- package/dist/validator/builder.js.map +1 -1
- package/dist/validator/engine.d.ts +23 -0
- package/dist/validator/engine.d.ts.map +1 -1
- package/dist/validator/engine.js +228 -31
- package/dist/validator/engine.js.map +1 -1
- package/dist/validator/index.d.ts +8 -4
- package/dist/validator/index.d.ts.map +1 -1
- package/dist/validator/index.js +4 -1
- package/dist/validator/index.js.map +1 -1
- package/dist/validator/tex-types.d.ts +19 -4
- package/dist/validator/tex-types.d.ts.map +1 -1
- package/dist/validator/tex-types.js +102 -0
- package/dist/validator/tex-types.js.map +1 -1
- package/dist/validator/tex.d.ts +1 -1
- package/dist/validator/tex.d.ts.map +1 -1
- package/dist/validator/tex.js +3 -1
- package/dist/validator/tex.js.map +1 -1
- package/dist/validator/types.d.ts +1 -0
- package/dist/validator/types.d.ts.map +1 -1
- package/package.json +46 -14
- package/dist/docs/content/dataloader.mdx +0 -170
- package/dist/docs/reference/dataloader.mdx +0 -91
|
@@ -1,241 +1,264 @@
|
|
|
1
1
|
---
|
|
2
|
-
|
|
3
|
-
|
|
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
|
|
8
|
+
# CLI Commands
|
|
7
9
|
|
|
8
|
-
|
|
10
|
+
The ExisJS CLI provides tools for local development, production compilation, scaffolding, testing, database scripting, and environment auditing.
|
|
9
11
|
|
|
10
|
-
|
|
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
|
-
|
|
19
|
+
npx exisjs dev [options]
|
|
14
20
|
```
|
|
15
21
|
|
|
16
|
-
|
|
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
|
|
22
|
-
| `-e, --entry <file>` |
|
|
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
|
-
|
|
25
|
-
- **
|
|
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
|
-
|
|
36
|
+
## `exisjs build`
|
|
30
37
|
|
|
31
|
-
Compiles TypeScript to production JavaScript and
|
|
38
|
+
Compiles the TypeScript application to production JavaScript, performs type-checking, and generates static route manifests.
|
|
32
39
|
|
|
33
40
|
```bash
|
|
34
|
-
|
|
41
|
+
npx exisjs build [options]
|
|
35
42
|
```
|
|
36
43
|
|
|
37
|
-
|
|
44
|
+
### Options
|
|
38
45
|
|
|
39
|
-
| Option | Description |
|
|
40
|
-
| :--- | :--- |
|
|
41
|
-
| `-o, --out-dir <dir>` |
|
|
42
|
-
| `--no-clean` | Skip cleaning the output directory
|
|
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
|
-
|
|
45
|
-
-
|
|
46
|
-
-
|
|
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
|
-
|
|
61
|
+
## `exisjs clean`
|
|
51
62
|
|
|
52
|
-
|
|
63
|
+
Removes temporary build artifacts, compiled files, and cached manifests.
|
|
53
64
|
|
|
54
65
|
```bash
|
|
55
|
-
|
|
66
|
+
npx exisjs clean [options]
|
|
67
|
+
npx exisjs cl [options]
|
|
56
68
|
```
|
|
57
69
|
|
|
58
|
-
|
|
70
|
+
### Options
|
|
59
71
|
|
|
60
|
-
| Option | Description |
|
|
61
|
-
| :--- | :--- |
|
|
62
|
-
| `-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
-
|
|
96
|
+
## `exisjs generate`
|
|
69
97
|
|
|
70
|
-
Scaffolds framework components and files according to ExisJS
|
|
98
|
+
Scaffolds framework components and files according to ExisJS file conventions.
|
|
71
99
|
|
|
72
100
|
```bash
|
|
73
|
-
|
|
74
|
-
|
|
101
|
+
npx exisjs generate <type> [name] [options]
|
|
102
|
+
npx exisjs g <type> [name] [options]
|
|
75
103
|
```
|
|
76
104
|
|
|
77
|
-
|
|
105
|
+
### Arguments
|
|
78
106
|
|
|
79
107
|
| Argument | Description |
|
|
80
108
|
| :--- | :--- |
|
|
81
109
|
| `<type>` | The schematic type to generate. |
|
|
82
|
-
|
|
|
110
|
+
| `[name]` | The name of the feature or folder (required for all types except `error`). |
|
|
83
111
|
|
|
84
|
-
|
|
112
|
+
### Options
|
|
85
113
|
|
|
86
|
-
| Option | Description |
|
|
87
|
-
| :--- | :--- |
|
|
88
|
-
| `-n, --named` | Names generated files using the feature prefix (e.g.
|
|
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
|
-
|
|
119
|
+
### Supported Schematics
|
|
92
120
|
|
|
93
|
-
| Schematic | Alias | Description | Output
|
|
121
|
+
| Schematic | Alias | Description | Output Location |
|
|
94
122
|
| :--- | :--- | :--- | :--- |
|
|
95
|
-
| `crud` | `resource` |
|
|
96
|
-
| `model` | | Standalone database-agnostic TypeScript entity
|
|
97
|
-
| `route` | `r`, `c`, `controller` | HTTP route
|
|
98
|
-
| `service` | `s` | Injectable service
|
|
99
|
-
| `schema` | `sc` | Validation schemas
|
|
100
|
-
| `boundary` | `b` | Folder-
|
|
101
|
-
| `
|
|
102
|
-
| `
|
|
103
|
-
| `
|
|
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
|
-
|
|
137
|
+
## `exisjs routes`
|
|
108
138
|
|
|
109
|
-
|
|
139
|
+
Inspects and displays the complete application routing table in formatted tabular output or raw JSON.
|
|
110
140
|
|
|
111
141
|
```bash
|
|
112
|
-
|
|
142
|
+
npx exisjs routes [options]
|
|
113
143
|
```
|
|
114
144
|
|
|
115
|
-
|
|
145
|
+
### Options
|
|
116
146
|
|
|
117
|
-
| Option | Description |
|
|
118
|
-
| :--- | :--- |
|
|
119
|
-
| `-e, --entry <file>` | Custom entry file path to
|
|
120
|
-
| `-m, --method <method>` | Filter endpoints by HTTP method (e.g. `GET`, `POST
|
|
121
|
-
| `-f, --filter <keyword>` | Filter endpoints
|
|
122
|
-
| `--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
|
-
|
|
156
|
+
## `exisjs test`
|
|
134
157
|
|
|
135
|
-
|
|
158
|
+
Runs the test suite using the integrated Node.js test runner (`node:test`).
|
|
136
159
|
|
|
137
160
|
```bash
|
|
138
|
-
|
|
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
|
-
|
|
175
|
+
## `exisjs run`
|
|
144
176
|
|
|
145
|
-
|
|
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
|
-
|
|
180
|
+
npx exisjs run <scriptOrCmd> [args...] [options]
|
|
181
|
+
npx exisjs exec <scriptOrCmd> [args...] [options]
|
|
149
182
|
```
|
|
150
183
|
|
|
151
|
-
|
|
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
|
-
|
|
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
|
-
|
|
191
|
+
### Examples
|
|
164
192
|
|
|
165
193
|
```bash
|
|
166
|
-
|
|
167
|
-
|
|
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
|
-
|
|
202
|
+
---
|
|
171
203
|
|
|
172
|
-
|
|
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
|
-
|
|
206
|
+
Starts an interactive Node.js REPL environment loaded with the application context.
|
|
178
207
|
|
|
179
208
|
```bash
|
|
180
|
-
|
|
181
|
-
|
|
209
|
+
npx exisjs console [options]
|
|
210
|
+
npx exisjs repl [options]
|
|
211
|
+
```
|
|
182
212
|
|
|
183
|
-
|
|
184
|
-
$ npx exisjs run src/database/seed.ts
|
|
213
|
+
### Options
|
|
185
214
|
|
|
186
|
-
|
|
187
|
-
|
|
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
|
-
|
|
221
|
+
## `exisjs doctor`
|
|
193
222
|
|
|
194
|
-
|
|
223
|
+
Runs an end-to-end diagnostic audit of the local project environment.
|
|
195
224
|
|
|
196
225
|
```bash
|
|
197
|
-
|
|
198
|
-
$ npx exisjs console [options]
|
|
226
|
+
npx exisjs doctor
|
|
199
227
|
```
|
|
200
228
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
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
|
-
|
|
237
|
+
## `exisjs info`
|
|
210
238
|
|
|
211
|
-
|
|
239
|
+
Prints runtime environment details, including ExisJS version, Node.js version, platform, and operating system architecture.
|
|
212
240
|
|
|
213
241
|
```bash
|
|
214
|
-
|
|
242
|
+
npx exisjs info
|
|
215
243
|
```
|
|
216
244
|
|
|
217
245
|
---
|
|
218
246
|
|
|
219
|
-
|
|
247
|
+
## `exisjs exports`
|
|
220
248
|
|
|
221
|
-
|
|
249
|
+
Lists all public subpath exports provided by the `exisjs` package.
|
|
222
250
|
|
|
223
251
|
```bash
|
|
224
|
-
|
|
252
|
+
npx exisjs exports
|
|
225
253
|
```
|
|
226
254
|
|
|
227
255
|
---
|
|
228
256
|
|
|
229
|
-
|
|
257
|
+
## `exisjs init`
|
|
230
258
|
|
|
231
|
-
|
|
259
|
+
Initializes a new ExisJS project interactively in the current working directory.
|
|
232
260
|
|
|
233
261
|
```bash
|
|
234
|
-
|
|
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 (`
|
|
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
|
|
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
|
-
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## Installation & Execution
|
|
13
22
|
|
|
14
|
-
|
|
23
|
+
### On-Demand via `npx`
|
|
24
|
+
|
|
25
|
+
Run commands directly without global installation:
|
|
15
26
|
|
|
16
27
|
```bash
|
|
17
|
-
#
|
|
18
|
-
|
|
28
|
+
# Initialize a new project in a directory
|
|
29
|
+
npx exisjs init
|
|
19
30
|
|
|
20
|
-
#
|
|
21
|
-
|
|
31
|
+
# Start the dev server
|
|
32
|
+
npx exisjs dev
|
|
22
33
|
```
|
|
23
34
|
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
## Basic Workflow
|
|
35
|
+
### Global Installation
|
|
27
36
|
|
|
28
|
-
|
|
37
|
+
To install the `exisjs` / `exis` binary globally:
|
|
29
38
|
|
|
30
39
|
```bash
|
|
31
|
-
|
|
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
|
-
|
|
43
|
+
### Project-Local Execution
|
|
39
44
|
|
|
40
|
-
|
|
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
|
-
|
|
47
|
+
---
|
|
47
48
|
|
|
48
|
-
##
|
|
49
|
+
## Command Syntax
|
|
49
50
|
|
|
50
|
-
All
|
|
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
|
-
|
|
57
|
+
Or using the shorter alias:
|
|
57
58
|
|
|
58
59
|
```bash
|
|
59
|
-
|
|
60
|
-
|
|
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
|
|
63
|
-
|
|
69
|
+
# Scaffold an HTTP route in Functional paradigm
|
|
70
|
+
npx exisjs generate route users
|
|
64
71
|
|
|
65
|
-
#
|
|
66
|
-
|
|
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
|
-
|
|
79
|
+
---
|
|
80
|
+
|
|
81
|
+
## Command Summary
|
|
70
82
|
|
|
71
83
|
| Command | Alias | Description |
|
|
72
84
|
| :--- | :--- | :--- |
|
|
73
|
-
| `dev` | | Starts
|
|
74
|
-
| `build` | | Type-checks and compiles TypeScript to
|
|
75
|
-
| `start` | |
|
|
76
|
-
| `
|
|
77
|
-
| `
|
|
78
|
-
| `
|
|
79
|
-
| `
|
|
80
|
-
| `
|
|
81
|
-
| `
|
|
82
|
-
| `
|
|
83
|
-
| `
|
|
84
|
-
| `
|
|
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
|
+
|