@constructive-io/cli 5.1.13 → 5.1.15
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 +122 -5
- package/commands/server.js +2 -0
- package/esm/commands/server.js +2 -0
- package/esm/index.js +2 -4
- package/esm/utils/display.js +22 -19
- package/index.js +2 -4
- package/package.json +9 -9
- package/utils/display.d.ts +1 -3
- package/utils/display.js +22 -24
package/README.md
CHANGED
|
@@ -98,6 +98,9 @@ cnc server
|
|
|
98
98
|
|
|
99
99
|
# Custom port and options
|
|
100
100
|
cnc server --port 8080 --no-postgis
|
|
101
|
+
|
|
102
|
+
# With custom CORS origin
|
|
103
|
+
cnc server --origin http://localhost:3000
|
|
101
104
|
```
|
|
102
105
|
|
|
103
106
|
#### `cnc explorer`
|
|
@@ -112,6 +115,33 @@ cnc explorer
|
|
|
112
115
|
cnc explorer --origin http://localhost:3000
|
|
113
116
|
```
|
|
114
117
|
|
|
118
|
+
#### `cnc docker`
|
|
119
|
+
|
|
120
|
+
Manage PostgreSQL Docker containers for local development.
|
|
121
|
+
|
|
122
|
+
```bash
|
|
123
|
+
# Start PostgreSQL container
|
|
124
|
+
cnc docker start
|
|
125
|
+
|
|
126
|
+
# Stop PostgreSQL container
|
|
127
|
+
cnc docker stop
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
#### `cnc env`
|
|
131
|
+
|
|
132
|
+
Display environment configuration for PostgreSQL connection.
|
|
133
|
+
|
|
134
|
+
```bash
|
|
135
|
+
# Print environment variables for shell export
|
|
136
|
+
cnc env
|
|
137
|
+
|
|
138
|
+
# Use with eval to set environment
|
|
139
|
+
eval "$(cnc env)"
|
|
140
|
+
|
|
141
|
+
# Print Supabase local development environment
|
|
142
|
+
cnc env --supabase
|
|
143
|
+
```
|
|
144
|
+
|
|
115
145
|
## 🔄 Updates
|
|
116
146
|
|
|
117
147
|
The CLI performs a lightweight npm version check at most once per week (skipped in CI or when `PGPM_SKIP_UPDATE_CHECK` is set). Use `cnc update` to install the latest release (installs `pgpm` by default; pass `--package @constructive-io/cli` to target the CLI package).
|
|
@@ -202,6 +232,35 @@ Interactively manage module dependencies.
|
|
|
202
232
|
cnc extension
|
|
203
233
|
```
|
|
204
234
|
|
|
235
|
+
#### `cnc upgrade-modules`
|
|
236
|
+
|
|
237
|
+
Upgrade installed pgpm modules to their latest versions from npm.
|
|
238
|
+
|
|
239
|
+
```bash
|
|
240
|
+
# Interactive selection of modules to upgrade
|
|
241
|
+
cnc upgrade-modules
|
|
242
|
+
|
|
243
|
+
# Upgrade all installed modules without prompting
|
|
244
|
+
cnc upgrade-modules --all
|
|
245
|
+
|
|
246
|
+
# Preview available upgrades without making changes
|
|
247
|
+
cnc upgrade-modules --dry-run
|
|
248
|
+
|
|
249
|
+
# Upgrade specific modules
|
|
250
|
+
cnc upgrade-modules --modules @pgpm/base32,@pgpm/faker
|
|
251
|
+
|
|
252
|
+
# Upgrade modules across all packages in the workspace
|
|
253
|
+
cnc upgrade-modules --workspace --all
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
**Options:**
|
|
257
|
+
|
|
258
|
+
- `--all` - Upgrade all modules without prompting
|
|
259
|
+
- `--dry-run` - Show what would be upgraded without making changes
|
|
260
|
+
- `--modules <names>` - Comma-separated list of specific modules to upgrade
|
|
261
|
+
- `--workspace` - Upgrade modules across all packages in the workspace
|
|
262
|
+
- `--cwd <directory>` - Working directory (default: current directory)
|
|
263
|
+
|
|
205
264
|
#### `cnc tag`
|
|
206
265
|
|
|
207
266
|
Version your changes with tags.
|
|
@@ -241,6 +300,18 @@ cnc package --no-plan
|
|
|
241
300
|
|
|
242
301
|
### Utilities
|
|
243
302
|
|
|
303
|
+
#### `cnc add`
|
|
304
|
+
|
|
305
|
+
Add a new database change to your module.
|
|
306
|
+
|
|
307
|
+
```bash
|
|
308
|
+
# Add a new change
|
|
309
|
+
cnc add my_change
|
|
310
|
+
|
|
311
|
+
# Add with specific type
|
|
312
|
+
cnc add my_function --type function
|
|
313
|
+
```
|
|
314
|
+
|
|
244
315
|
#### `cnc export`
|
|
245
316
|
|
|
246
317
|
Export migrations from existing databases.
|
|
@@ -261,6 +332,53 @@ cnc kill
|
|
|
261
332
|
cnc kill --no-drop
|
|
262
333
|
```
|
|
263
334
|
|
|
335
|
+
#### `cnc clear`
|
|
336
|
+
|
|
337
|
+
Clear database state.
|
|
338
|
+
|
|
339
|
+
```bash
|
|
340
|
+
cnc clear
|
|
341
|
+
```
|
|
342
|
+
|
|
343
|
+
#### `cnc remove`
|
|
344
|
+
|
|
345
|
+
Remove database changes.
|
|
346
|
+
|
|
347
|
+
```bash
|
|
348
|
+
cnc remove my_change
|
|
349
|
+
```
|
|
350
|
+
|
|
351
|
+
#### `cnc analyze`
|
|
352
|
+
|
|
353
|
+
Analyze database structure.
|
|
354
|
+
|
|
355
|
+
```bash
|
|
356
|
+
cnc analyze
|
|
357
|
+
```
|
|
358
|
+
|
|
359
|
+
#### `cnc rename`
|
|
360
|
+
|
|
361
|
+
Rename database changes.
|
|
362
|
+
|
|
363
|
+
```bash
|
|
364
|
+
cnc rename old_name new_name
|
|
365
|
+
```
|
|
366
|
+
|
|
367
|
+
#### `cnc admin-users`
|
|
368
|
+
|
|
369
|
+
Manage admin users for your database.
|
|
370
|
+
|
|
371
|
+
```bash
|
|
372
|
+
# Bootstrap admin users
|
|
373
|
+
cnc admin-users bootstrap
|
|
374
|
+
|
|
375
|
+
# Add an admin user
|
|
376
|
+
cnc admin-users add
|
|
377
|
+
|
|
378
|
+
# Remove an admin user
|
|
379
|
+
cnc admin-users remove
|
|
380
|
+
```
|
|
381
|
+
|
|
264
382
|
### Testing
|
|
265
383
|
|
|
266
384
|
#### `cnc test-packages`
|
|
@@ -274,20 +392,20 @@ cnc test-packages
|
|
|
274
392
|
# Run full deploy/verify/revert/deploy cycle
|
|
275
393
|
cnc test-packages --full-cycle
|
|
276
394
|
|
|
277
|
-
#
|
|
278
|
-
cnc test-packages --
|
|
395
|
+
# Continue testing all packages even after failures
|
|
396
|
+
cnc test-packages --continue-on-fail
|
|
279
397
|
|
|
280
398
|
# Exclude specific modules
|
|
281
399
|
cnc test-packages --exclude my-module,another-module
|
|
282
400
|
|
|
283
401
|
# Combine options
|
|
284
|
-
cnc test-packages --full-cycle --
|
|
402
|
+
cnc test-packages --full-cycle --continue-on-fail --exclude legacy-module
|
|
285
403
|
```
|
|
286
404
|
|
|
287
405
|
**Options:**
|
|
288
406
|
|
|
289
407
|
- `--full-cycle` - Run full deploy/verify/revert/deploy cycle (default: deploy only)
|
|
290
|
-
- `--
|
|
408
|
+
- `--continue-on-fail` - Continue testing all packages even after failures (default: stop on first failure)
|
|
291
409
|
- `--exclude <modules>` - Comma-separated module names to exclude
|
|
292
410
|
- `--cwd <directory>` - Working directory (default: current directory)
|
|
293
411
|
|
|
@@ -545,7 +663,6 @@ Common issues and solutions for pgpm, PostgreSQL, and testing.
|
|
|
545
663
|
* [@pgsql/enums](https://www.npmjs.com/package/@pgsql/enums): **🏷️ TypeScript enums** for PostgreSQL AST for safe and ergonomic parsing logic.
|
|
546
664
|
* [@pgsql/types](https://www.npmjs.com/package/@pgsql/types): **📝 Type definitions** for PostgreSQL AST nodes in TypeScript.
|
|
547
665
|
* [@pgsql/utils](https://www.npmjs.com/package/@pgsql/utils): **🛠️ AST utilities** for constructing and transforming PostgreSQL syntax trees.
|
|
548
|
-
* [pg-ast](https://www.npmjs.com/package/pg-ast): **🔍 Low-level AST tools** and transformations for Postgres query structures.
|
|
549
666
|
|
|
550
667
|
### 🚀 API & Dev Tools
|
|
551
668
|
|
package/commands/server.js
CHANGED
|
@@ -15,6 +15,7 @@ Constructive GraphQL Server:
|
|
|
15
15
|
Options:
|
|
16
16
|
--help, -h Show this help message
|
|
17
17
|
--port <number> Server port (default: 5555)
|
|
18
|
+
--origin <url> CORS origin URL (exact URL or * for wildcard)
|
|
18
19
|
--simpleInflection Use simple inflection (default: true)
|
|
19
20
|
--oppositeBaseNames Use opposite base names (default: false)
|
|
20
21
|
--postgis Enable PostGIS extension (default: true)
|
|
@@ -25,6 +26,7 @@ Examples:
|
|
|
25
26
|
cnc server Start server with defaults
|
|
26
27
|
cnc server --port 8080 Start server on custom port
|
|
27
28
|
cnc server --no-postgis Start server without PostGIS
|
|
29
|
+
cnc server --origin http://localhost:3000 Set CORS origin
|
|
28
30
|
`;
|
|
29
31
|
const questions = [
|
|
30
32
|
{
|
package/esm/commands/server.js
CHANGED
|
@@ -13,6 +13,7 @@ Constructive GraphQL Server:
|
|
|
13
13
|
Options:
|
|
14
14
|
--help, -h Show this help message
|
|
15
15
|
--port <number> Server port (default: 5555)
|
|
16
|
+
--origin <url> CORS origin URL (exact URL or * for wildcard)
|
|
16
17
|
--simpleInflection Use simple inflection (default: true)
|
|
17
18
|
--oppositeBaseNames Use opposite base names (default: false)
|
|
18
19
|
--postgis Enable PostGIS extension (default: true)
|
|
@@ -23,6 +24,7 @@ Examples:
|
|
|
23
24
|
cnc server Start server with defaults
|
|
24
25
|
cnc server --port 8080 Start server on custom port
|
|
25
26
|
cnc server --no-postgis Start server without PostGIS
|
|
27
|
+
cnc server --origin http://localhost:3000 Set CORS origin
|
|
26
28
|
`;
|
|
27
29
|
const questions = [
|
|
28
30
|
{
|
package/esm/index.js
CHANGED
|
@@ -1,11 +1,9 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import {
|
|
2
|
+
import { findAndRequirePackageJson } from 'find-and-require-package-json';
|
|
3
3
|
import { CLI } from 'inquirerer';
|
|
4
|
-
import { join } from 'path';
|
|
5
4
|
import { commands } from './commands';
|
|
6
5
|
if (process.argv.includes('--version') || process.argv.includes('-v')) {
|
|
7
|
-
const
|
|
8
|
-
const pkg = JSON.parse(readFileSync(pkgPath, 'utf8'));
|
|
6
|
+
const pkg = findAndRequirePackageJson(__dirname);
|
|
9
7
|
console.log(pkg.version);
|
|
10
8
|
process.exit(0);
|
|
11
9
|
}
|
package/esm/utils/display.js
CHANGED
|
@@ -1,21 +1,13 @@
|
|
|
1
|
-
import { findAndRequirePackageJson } from 'find-and-require-package-json';
|
|
2
|
-
import yanse from 'yanse';
|
|
3
|
-
// Function to display the version information
|
|
4
|
-
export function displayVersion() {
|
|
5
|
-
const pkg = findAndRequirePackageJson(__dirname);
|
|
6
|
-
console.log(yanse.green(`Name: ${pkg.name}`));
|
|
7
|
-
console.log(yanse.blue(`Version: ${pkg.version}`));
|
|
8
|
-
}
|
|
9
1
|
export const usageText = `
|
|
10
2
|
Usage: cnc <command> [options]
|
|
11
3
|
constructive <command> [options]
|
|
12
|
-
|
|
4
|
+
|
|
13
5
|
Core Database Operations:
|
|
14
6
|
add Add database changes to plans and create SQL files
|
|
15
7
|
deploy Deploy database changes and migrations
|
|
16
8
|
verify Verify database state and migrations
|
|
17
9
|
revert Revert database changes and migrations
|
|
18
|
-
|
|
10
|
+
|
|
19
11
|
Project Management:
|
|
20
12
|
init Initialize pgpm workspace or module
|
|
21
13
|
extension Manage module dependencies
|
|
@@ -23,39 +15,50 @@ export const usageText = `
|
|
|
23
15
|
package Package module for distribution
|
|
24
16
|
update Update CLI/pgpm (installs pgpm by default)
|
|
25
17
|
cache Manage cached templates (clean)
|
|
26
|
-
|
|
18
|
+
upgrade-modules Upgrade installed pgpm modules to latest versions
|
|
19
|
+
|
|
27
20
|
Development Tools:
|
|
28
21
|
server Start a GraphQL server
|
|
29
22
|
explorer Launch GraphiQL explorer interface
|
|
30
23
|
docker Manage PostgreSQL Docker containers (start/stop)
|
|
31
24
|
export Export database migrations from existing databases
|
|
32
|
-
|
|
25
|
+
env Display environment configuration
|
|
26
|
+
|
|
27
|
+
Code Generation:
|
|
28
|
+
codegen Generate TypeScript types and SDK from GraphQL schema
|
|
29
|
+
get-graphql-schema Fetch or build GraphQL schema SDL
|
|
30
|
+
|
|
33
31
|
Database Administration:
|
|
34
32
|
kill Terminate database connections and optionally drop databases
|
|
35
33
|
install Install pgpm modules
|
|
36
34
|
tag Add tags to changes for versioning
|
|
37
|
-
|
|
35
|
+
clear Clear database state
|
|
36
|
+
remove Remove database changes
|
|
37
|
+
analyze Analyze database structure
|
|
38
|
+
rename Rename database changes
|
|
39
|
+
admin-users Manage admin users
|
|
40
|
+
|
|
41
|
+
Testing:
|
|
42
|
+
test-packages Run integration tests on all workspace packages
|
|
43
|
+
|
|
38
44
|
Migration Tools:
|
|
39
45
|
migrate Migration management subcommands
|
|
40
46
|
init Initialize migration tracking
|
|
41
47
|
status Show migration status
|
|
42
48
|
list List all changes
|
|
43
49
|
deps Show change dependencies
|
|
44
|
-
|
|
50
|
+
|
|
45
51
|
Global Options:
|
|
46
52
|
-h, --help Display this help information
|
|
47
53
|
-v, --version Display version information
|
|
48
54
|
--cwd <directory> Working directory (default: current directory)
|
|
49
|
-
|
|
55
|
+
|
|
50
56
|
Individual Command Help:
|
|
51
57
|
constructive <command> --help Display detailed help for specific command
|
|
52
58
|
constructive <command> -h Display detailed help for specific command
|
|
53
|
-
|
|
59
|
+
|
|
54
60
|
Examples:
|
|
55
61
|
cnc deploy --help Show deploy command options
|
|
56
62
|
cnc server --port 8080 Start server on port 8080
|
|
57
63
|
cnc init workspace Initialize new workspace
|
|
58
64
|
`;
|
|
59
|
-
export function displayUsage() {
|
|
60
|
-
console.log(usageText);
|
|
61
|
-
}
|
package/index.js
CHANGED
|
@@ -2,13 +2,11 @@
|
|
|
2
2
|
"use strict";
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
4
|
exports.options = void 0;
|
|
5
|
-
const
|
|
5
|
+
const find_and_require_package_json_1 = require("find-and-require-package-json");
|
|
6
6
|
const inquirerer_1 = require("inquirerer");
|
|
7
|
-
const path_1 = require("path");
|
|
8
7
|
const commands_1 = require("./commands");
|
|
9
8
|
if (process.argv.includes('--version') || process.argv.includes('-v')) {
|
|
10
|
-
const
|
|
11
|
-
const pkg = JSON.parse((0, fs_1.readFileSync)(pkgPath, 'utf8'));
|
|
9
|
+
const pkg = (0, find_and_require_package_json_1.findAndRequirePackageJson)(__dirname);
|
|
12
10
|
console.log(pkg.version);
|
|
13
11
|
process.exit(0);
|
|
14
12
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@constructive-io/cli",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.15",
|
|
4
4
|
"author": "Constructive <developers@constructive.io>",
|
|
5
5
|
"description": "Constructive CLI",
|
|
6
6
|
"main": "index.js",
|
|
@@ -46,21 +46,21 @@
|
|
|
46
46
|
"ts-node": "^10.9.2"
|
|
47
47
|
},
|
|
48
48
|
"dependencies": {
|
|
49
|
-
"@constructive-io/graphql-codegen": "^2.17.
|
|
49
|
+
"@constructive-io/graphql-codegen": "^2.17.23",
|
|
50
50
|
"@constructive-io/graphql-env": "^2.8.8",
|
|
51
|
-
"@constructive-io/graphql-explorer": "^2.10.
|
|
52
|
-
"@constructive-io/graphql-server": "^2.10.
|
|
53
|
-
"@pgpmjs/core": "^3.2.
|
|
51
|
+
"@constructive-io/graphql-explorer": "^2.10.17",
|
|
52
|
+
"@constructive-io/graphql-server": "^2.10.17",
|
|
53
|
+
"@pgpmjs/core": "^3.2.1",
|
|
54
54
|
"@pgpmjs/logger": "^1.3.5",
|
|
55
|
-
"@pgpmjs/server-utils": "^2.8.
|
|
55
|
+
"@pgpmjs/server-utils": "^2.8.9",
|
|
56
56
|
"@pgpmjs/types": "^2.12.6",
|
|
57
57
|
"find-and-require-package-json": "^0.8.2",
|
|
58
|
-
"inquirerer": "^2.
|
|
58
|
+
"inquirerer": "^2.3.0",
|
|
59
59
|
"js-yaml": "^4.1.0",
|
|
60
60
|
"minimist": "^1.2.8",
|
|
61
61
|
"pg-cache": "^1.6.9",
|
|
62
62
|
"pg-env": "^1.2.4",
|
|
63
|
-
"pgpm": "^1.
|
|
63
|
+
"pgpm": "^1.4.0",
|
|
64
64
|
"shelljs": "^0.10.0",
|
|
65
65
|
"yanse": "^0.1.8"
|
|
66
66
|
},
|
|
@@ -75,5 +75,5 @@
|
|
|
75
75
|
"postgres",
|
|
76
76
|
"graphile"
|
|
77
77
|
],
|
|
78
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "976cc9e0e09201c7df40518a1797f4178fc21c2c"
|
|
79
79
|
}
|
package/utils/display.d.ts
CHANGED
|
@@ -1,3 +1 @@
|
|
|
1
|
-
export declare
|
|
2
|
-
export declare const usageText = "\n Usage: cnc <command> [options]\n constructive <command> [options]\n \n Core Database Operations:\n add Add database changes to plans and create SQL files\n deploy Deploy database changes and migrations\n verify Verify database state and migrations\n revert Revert database changes and migrations\n \n Project Management:\n init Initialize pgpm workspace or module\n extension Manage module dependencies\n plan Generate module deployment plans\n package Package module for distribution\n update Update CLI/pgpm (installs pgpm by default)\n cache Manage cached templates (clean)\n \n Development Tools:\n server Start a GraphQL server\n explorer Launch GraphiQL explorer interface\n docker Manage PostgreSQL Docker containers (start/stop)\n export Export database migrations from existing databases\n \n Database Administration:\n kill Terminate database connections and optionally drop databases\n install Install pgpm modules\n tag Add tags to changes for versioning\n \n Migration Tools:\n migrate Migration management subcommands\n init Initialize migration tracking\n status Show migration status\n list List all changes\n deps Show change dependencies\n \n Global Options:\n -h, --help Display this help information\n -v, --version Display version information\n --cwd <directory> Working directory (default: current directory)\n \n Individual Command Help:\n constructive <command> --help Display detailed help for specific command\n constructive <command> -h Display detailed help for specific command\n \n Examples:\n cnc deploy --help Show deploy command options\n cnc server --port 8080 Start server on port 8080\n cnc init workspace Initialize new workspace\n ";
|
|
3
|
-
export declare function displayUsage(): void;
|
|
1
|
+
export declare const usageText = "\n Usage: cnc <command> [options]\n constructive <command> [options]\n\n Core Database Operations:\n add Add database changes to plans and create SQL files\n deploy Deploy database changes and migrations\n verify Verify database state and migrations\n revert Revert database changes and migrations\n\n Project Management:\n init Initialize pgpm workspace or module\n extension Manage module dependencies\n plan Generate module deployment plans\n package Package module for distribution\n update Update CLI/pgpm (installs pgpm by default)\n cache Manage cached templates (clean)\n upgrade-modules Upgrade installed pgpm modules to latest versions\n\n Development Tools:\n server Start a GraphQL server\n explorer Launch GraphiQL explorer interface\n docker Manage PostgreSQL Docker containers (start/stop)\n export Export database migrations from existing databases\n env Display environment configuration\n\n Code Generation:\n codegen Generate TypeScript types and SDK from GraphQL schema\n get-graphql-schema Fetch or build GraphQL schema SDL\n\n Database Administration:\n kill Terminate database connections and optionally drop databases\n install Install pgpm modules\n tag Add tags to changes for versioning\n clear Clear database state\n remove Remove database changes\n analyze Analyze database structure\n rename Rename database changes\n admin-users Manage admin users\n\n Testing:\n test-packages Run integration tests on all workspace packages\n\n Migration Tools:\n migrate Migration management subcommands\n init Initialize migration tracking\n status Show migration status\n list List all changes\n deps Show change dependencies\n\n Global Options:\n -h, --help Display this help information\n -v, --version Display version information\n --cwd <directory> Working directory (default: current directory)\n\n Individual Command Help:\n constructive <command> --help Display detailed help for specific command\n constructive <command> -h Display detailed help for specific command\n\n Examples:\n cnc deploy --help Show deploy command options\n cnc server --port 8080 Start server on port 8080\n cnc init workspace Initialize new workspace\n ";
|
package/utils/display.js
CHANGED
|
@@ -1,29 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
3
|
exports.usageText = void 0;
|
|
7
|
-
exports.displayVersion = displayVersion;
|
|
8
|
-
exports.displayUsage = displayUsage;
|
|
9
|
-
const find_and_require_package_json_1 = require("find-and-require-package-json");
|
|
10
|
-
const yanse_1 = __importDefault(require("yanse"));
|
|
11
|
-
// Function to display the version information
|
|
12
|
-
function displayVersion() {
|
|
13
|
-
const pkg = (0, find_and_require_package_json_1.findAndRequirePackageJson)(__dirname);
|
|
14
|
-
console.log(yanse_1.default.green(`Name: ${pkg.name}`));
|
|
15
|
-
console.log(yanse_1.default.blue(`Version: ${pkg.version}`));
|
|
16
|
-
}
|
|
17
4
|
exports.usageText = `
|
|
18
5
|
Usage: cnc <command> [options]
|
|
19
6
|
constructive <command> [options]
|
|
20
|
-
|
|
7
|
+
|
|
21
8
|
Core Database Operations:
|
|
22
9
|
add Add database changes to plans and create SQL files
|
|
23
10
|
deploy Deploy database changes and migrations
|
|
24
11
|
verify Verify database state and migrations
|
|
25
12
|
revert Revert database changes and migrations
|
|
26
|
-
|
|
13
|
+
|
|
27
14
|
Project Management:
|
|
28
15
|
init Initialize pgpm workspace or module
|
|
29
16
|
extension Manage module dependencies
|
|
@@ -31,39 +18,50 @@ exports.usageText = `
|
|
|
31
18
|
package Package module for distribution
|
|
32
19
|
update Update CLI/pgpm (installs pgpm by default)
|
|
33
20
|
cache Manage cached templates (clean)
|
|
34
|
-
|
|
21
|
+
upgrade-modules Upgrade installed pgpm modules to latest versions
|
|
22
|
+
|
|
35
23
|
Development Tools:
|
|
36
24
|
server Start a GraphQL server
|
|
37
25
|
explorer Launch GraphiQL explorer interface
|
|
38
26
|
docker Manage PostgreSQL Docker containers (start/stop)
|
|
39
27
|
export Export database migrations from existing databases
|
|
40
|
-
|
|
28
|
+
env Display environment configuration
|
|
29
|
+
|
|
30
|
+
Code Generation:
|
|
31
|
+
codegen Generate TypeScript types and SDK from GraphQL schema
|
|
32
|
+
get-graphql-schema Fetch or build GraphQL schema SDL
|
|
33
|
+
|
|
41
34
|
Database Administration:
|
|
42
35
|
kill Terminate database connections and optionally drop databases
|
|
43
36
|
install Install pgpm modules
|
|
44
37
|
tag Add tags to changes for versioning
|
|
45
|
-
|
|
38
|
+
clear Clear database state
|
|
39
|
+
remove Remove database changes
|
|
40
|
+
analyze Analyze database structure
|
|
41
|
+
rename Rename database changes
|
|
42
|
+
admin-users Manage admin users
|
|
43
|
+
|
|
44
|
+
Testing:
|
|
45
|
+
test-packages Run integration tests on all workspace packages
|
|
46
|
+
|
|
46
47
|
Migration Tools:
|
|
47
48
|
migrate Migration management subcommands
|
|
48
49
|
init Initialize migration tracking
|
|
49
50
|
status Show migration status
|
|
50
51
|
list List all changes
|
|
51
52
|
deps Show change dependencies
|
|
52
|
-
|
|
53
|
+
|
|
53
54
|
Global Options:
|
|
54
55
|
-h, --help Display this help information
|
|
55
56
|
-v, --version Display version information
|
|
56
57
|
--cwd <directory> Working directory (default: current directory)
|
|
57
|
-
|
|
58
|
+
|
|
58
59
|
Individual Command Help:
|
|
59
60
|
constructive <command> --help Display detailed help for specific command
|
|
60
61
|
constructive <command> -h Display detailed help for specific command
|
|
61
|
-
|
|
62
|
+
|
|
62
63
|
Examples:
|
|
63
64
|
cnc deploy --help Show deploy command options
|
|
64
65
|
cnc server --port 8080 Start server on port 8080
|
|
65
66
|
cnc init workspace Initialize new workspace
|
|
66
67
|
`;
|
|
67
|
-
function displayUsage() {
|
|
68
|
-
console.log(exports.usageText);
|
|
69
|
-
}
|