-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.ts
More file actions
71 lines (63 loc) · 2.52 KB
/
index.ts
File metadata and controls
71 lines (63 loc) · 2.52 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env node
import { CLI, CLIOptions, getPackageJson } from 'inquirerer';
import { commands, createPgpmCommandMap } from './commands';
export { createInitUsageText } from './commands/init';
export { createPgpmCommandMap };
export { default as add } from './commands/add';
export { default as adminUsers } from './commands/admin-users';
export { default as analyze } from './commands/analyze';
export { default as clear } from './commands/clear';
export { default as deploy } from './commands/deploy';
export { default as docker } from './commands/docker';
export { default as dump } from './commands/dump';
export { default as env } from './commands/env';
export { default as _export } from './commands/export';
export { default as extension } from './commands/extension';
export { default as install } from './commands/install';
export { default as kill } from './commands/kill';
export { default as migrate } from './commands/migrate';
export { default as _package } from './commands/package';
export { default as plan } from './commands/plan';
export { default as remove } from './commands/remove';
export { default as renameCmd } from './commands/rename';
export { default as revert } from './commands/revert';
export { default as slice } from './commands/slice';
export { default as tag } from './commands/tag';
export { default as testPackages } from './commands/test-packages';
export { default as verify } from './commands/verify';
export * from './utils';
export const options: Partial<CLIOptions> = {
minimistOpts: {
alias: {
v: 'version',
h: 'help',
'from-branch': 'fromBranch',
// Support both --template and --template-path (deprecated) for backward compatibility
'template-path': 'template',
t: 'template',
// -w for --create-workspace flag
w: 'createWorkspace',
'create-workspace': 'createWorkspace'
}
}
};
if (require.main === module) {
if (process.argv.includes('--version') || process.argv.includes('-v')) {
const pkg = getPackageJson(__dirname);
console.log(pkg.version);
process.exit(0);
}
// Detect non-TTY environment:
// 1. Explicit --no-tty flag
// 2. CI environment variable
// 3. stdin is not a TTY (running from script, pipe, etc.)
const noTty = process.argv.includes('--no-tty') ||
process.env.CI === 'true' ||
!process.stdin.isTTY;
const app = new CLI(commands, { ...options, noTty });
app.run().then(() => {
}).catch(error => {
console.error('Unexpected error:', error);
process.exit(1);
});
}