dockup-cli 1.0.2 → 1.2.0
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/bin/dockup +2 -0
- package/dist/commands/agent.js +432 -0
- package/dist/commands/auth.js +123 -126
- package/dist/commands/database.js +315 -563
- package/dist/commands/env.js +125 -93
- package/dist/commands/link.js +148 -189
- package/dist/commands/logs.js +100 -82
- package/dist/commands/open.js +69 -41
- package/dist/commands/projects.js +128 -94
- package/dist/commands/push.js +138 -122
- package/dist/commands/service.js +143 -119
- package/dist/commands/status.js +116 -89
- package/dist/commands/workspace.js +210 -220
- package/dist/index.js +77 -179
- package/dist/lib/api.js +248 -185
- package/dist/lib/config.js +135 -142
- package/dist/lib/flags.js +36 -0
- package/dist/lib/output.js +65 -0
- package/dist/lib/target.js +40 -0
- package/dockupcli.md +211 -0
- package/package.json +13 -25
- package/dist/commands/auth.d.ts +0 -5
- package/dist/commands/database.d.ts +0 -16
- package/dist/commands/env.d.ts +0 -5
- package/dist/commands/link.d.ts +0 -2
- package/dist/commands/logs.d.ts +0 -4
- package/dist/commands/open.d.ts +0 -3
- package/dist/commands/projects.d.ts +0 -2
- package/dist/commands/push.d.ts +0 -3
- package/dist/commands/service.d.ts +0 -8
- package/dist/commands/status.d.ts +0 -1
- package/dist/commands/workspace.d.ts +0 -10
- package/dist/index.d.ts +0 -2
- package/dist/lib/api.d.ts +0 -39
- package/dist/lib/config.d.ts +0 -51
package/dist/index.js
CHANGED
|
@@ -1,186 +1,84 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
"use strict";
|
|
3
|
-
var
|
|
4
|
-
|
|
3
|
+
var __create = Object.create;
|
|
4
|
+
var __defProp = Object.defineProperty;
|
|
5
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
6
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
7
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
8
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
|
+
var __copyProps = (to, from, except, desc) => {
|
|
10
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
11
|
+
for (let key of __getOwnPropNames(from))
|
|
12
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
13
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
14
|
+
}
|
|
15
|
+
return to;
|
|
5
16
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
program
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
program
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
program
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
program
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
.command('list')
|
|
63
|
-
.alias('ls')
|
|
64
|
-
.description('List environment variables')
|
|
65
|
-
.action(env_1.envList);
|
|
66
|
-
envCmd
|
|
67
|
-
.command('set <key=value>')
|
|
68
|
-
.description('Set an environment variable')
|
|
69
|
-
.option('-s, --secret', 'Mark as secret')
|
|
70
|
-
.action(env_1.envSet);
|
|
71
|
-
envCmd
|
|
72
|
-
.command('remove <key>')
|
|
73
|
-
.alias('rm')
|
|
74
|
-
.description('Remove an environment variable')
|
|
75
|
-
.action(env_1.envRemove);
|
|
76
|
-
// Status
|
|
77
|
-
program
|
|
78
|
-
.command('status')
|
|
79
|
-
.description('Show service status')
|
|
80
|
-
.action(status_1.status);
|
|
81
|
-
// Open in browser
|
|
82
|
-
program
|
|
83
|
-
.command('open')
|
|
84
|
-
.description('Open service in browser')
|
|
85
|
-
.option('-d, --dashboard', 'Open dashboard instead of live URL')
|
|
86
|
-
.action(open_1.open);
|
|
87
|
-
// Workspace commands
|
|
88
|
-
const workspaceCmd = program.command('workspace').alias('ws').description('Manage workspaces');
|
|
89
|
-
workspaceCmd
|
|
90
|
-
.command('list')
|
|
91
|
-
.alias('ls')
|
|
92
|
-
.description('List all workspaces')
|
|
93
|
-
.action(workspace_1.workspaceList);
|
|
94
|
-
workspaceCmd
|
|
95
|
-
.command('create')
|
|
96
|
-
.description('Create a new workspace')
|
|
97
|
-
.option('-n, --name <name>', 'Workspace name')
|
|
98
|
-
.action(workspace_1.workspaceCreate);
|
|
99
|
-
workspaceCmd
|
|
100
|
-
.command('select')
|
|
101
|
-
.alias('use')
|
|
102
|
-
.description('Select a workspace to use')
|
|
103
|
-
.action(workspace_1.workspaceSelect);
|
|
104
|
-
workspaceCmd
|
|
105
|
-
.command('rename')
|
|
106
|
-
.description('Rename the current workspace')
|
|
107
|
-
.option('-n, --name <name>', 'New workspace name')
|
|
108
|
-
.action(workspace_1.workspaceRename);
|
|
109
|
-
workspaceCmd
|
|
110
|
-
.command('delete')
|
|
111
|
-
.alias('rm')
|
|
112
|
-
.description('Delete the current workspace')
|
|
113
|
-
.action(workspace_1.workspaceDelete);
|
|
114
|
-
workspaceCmd
|
|
115
|
-
.command('current')
|
|
116
|
-
.description('Show the current workspace')
|
|
117
|
-
.action(workspace_1.workspaceCurrent);
|
|
118
|
-
// Database commands
|
|
119
|
-
const dbCmd = program.command('db').alias('database').description('Manage databases');
|
|
120
|
-
dbCmd
|
|
121
|
-
.command('list')
|
|
122
|
-
.alias('ls')
|
|
123
|
-
.description('List databases in current workspace')
|
|
124
|
-
.action(database_1.databaseList);
|
|
125
|
-
dbCmd
|
|
126
|
-
.command('create')
|
|
127
|
-
.description('Create a new database')
|
|
128
|
-
.option('-n, --name <name>', 'Database name')
|
|
129
|
-
.option('-t, --type <type>', 'Database type (postgresql, mysql, mongodb, redis)')
|
|
130
|
-
.action(database_1.databaseCreate);
|
|
131
|
-
dbCmd
|
|
132
|
-
.command('rename [id]')
|
|
133
|
-
.description('Rename a database')
|
|
134
|
-
.action(database_1.databaseRename);
|
|
135
|
-
dbCmd
|
|
136
|
-
.command('delete [id]')
|
|
137
|
-
.alias('rm')
|
|
138
|
-
.description('Delete a database')
|
|
139
|
-
.action(database_1.databaseDelete);
|
|
140
|
-
dbCmd
|
|
141
|
-
.command('credentials [id]')
|
|
142
|
-
.alias('creds')
|
|
143
|
-
.description('Get database credentials')
|
|
144
|
-
.action(database_1.databaseCredentials);
|
|
145
|
-
dbCmd
|
|
146
|
-
.command('info [id]')
|
|
147
|
-
.description('Get database details')
|
|
148
|
-
.action(database_1.databaseInfo);
|
|
149
|
-
dbCmd
|
|
150
|
-
.command('logs [slug]')
|
|
151
|
-
.description('View database logs')
|
|
152
|
-
.option('-n, --tail <lines>', 'Number of lines to show', '100')
|
|
153
|
-
.action(database_1.databaseLogs);
|
|
154
|
-
dbCmd
|
|
155
|
-
.command('restart [slug]')
|
|
156
|
-
.description('Restart a database')
|
|
157
|
-
.action(database_1.databaseRestart);
|
|
158
|
-
dbCmd
|
|
159
|
-
.command('size [slug]')
|
|
160
|
-
.description('Show database size')
|
|
161
|
-
.action(database_1.databaseSize);
|
|
162
|
-
// Database backup subcommand
|
|
163
|
-
const backupCmd = dbCmd.command('backup').description('Manage database backups');
|
|
164
|
-
backupCmd
|
|
165
|
-
.command('ls [slug]')
|
|
166
|
-
.alias('list')
|
|
167
|
-
.description('List database backups')
|
|
168
|
-
.action(database_1.databaseBackupList);
|
|
169
|
-
backupCmd
|
|
170
|
-
.command('create [slug]')
|
|
171
|
-
.description('Create a new backup')
|
|
172
|
-
.action(database_1.databaseBackupCreate);
|
|
173
|
-
// Parse arguments
|
|
17
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
18
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
19
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
20
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
21
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
22
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
23
|
+
mod
|
|
24
|
+
));
|
|
25
|
+
var import_commander = require("commander");
|
|
26
|
+
var import_chalk = __toESM(require("chalk"));
|
|
27
|
+
var import_auth = require("./commands/auth");
|
|
28
|
+
var import_link = require("./commands/link");
|
|
29
|
+
var import_push = require("./commands/push");
|
|
30
|
+
var import_open = require("./commands/open");
|
|
31
|
+
var import_agent = require("./commands/agent");
|
|
32
|
+
var import_workspace = require("./commands/workspace");
|
|
33
|
+
var import_database = require("./commands/database");
|
|
34
|
+
const program = new import_commander.Command();
|
|
35
|
+
program.name("dockup").description("Dockup CLI - Deploy from your terminal").version("1.2.0");
|
|
36
|
+
program.command("login").description("Authenticate with Dockup").option("-t, --token <token>", "Use API token directly").action(import_auth.login);
|
|
37
|
+
program.command("logout").description("Log out from Dockup").action(import_auth.logout);
|
|
38
|
+
program.command("whoami").description("Show current logged in user").action(import_auth.whoami);
|
|
39
|
+
program.command("link [project/service]").description("Link current directory to a Dockup service").action(import_link.link);
|
|
40
|
+
program.command("unlink").description("Unlink current directory from Dockup").action(import_link.unlink);
|
|
41
|
+
program.command("push [branch]").description("Push and deploy to Dockup").option("-f, --force", "Force deploy without git push").action(import_push.push);
|
|
42
|
+
program.command("logs [project/service]").description("Show runtime logs (or build logs with --build)").option("--build", "Show build logs of the latest deployment instead of runtime logs").option("-n, --number <lines>", "Number of runtime lines", "200").option("-j, --json", "Machine-readable JSON output").action(import_agent.logsView);
|
|
43
|
+
const envCmd = program.command("env").description("Manage environment variables");
|
|
44
|
+
envCmd.command("list").alias("ls").description("List environment variables (secret values are masked)").option("-s, --service <project/service>", "Target service (defaults to linked .dockup)").option("-j, --json", "Machine-readable JSON output").action(import_agent.envView);
|
|
45
|
+
envCmd.command("set <key=value>").description("Set an environment variable").option("--secret", "Mark as secret").option("-s, --service <project/service>", "Target service (defaults to linked .dockup)").option("-j, --json", "Machine-readable JSON output").action(import_agent.envSet);
|
|
46
|
+
envCmd.command("remove <key>").alias("rm").description("Remove an environment variable").option("-s, --service <project/service>", "Target service (defaults to linked .dockup)").option("-j, --json", "Machine-readable JSON output").action(import_agent.envRemove);
|
|
47
|
+
envCmd.command("import <file>").description("Bulk-set variables from a .env-style file").option("--secret", "Mark all imported variables as secret").option("-s, --service <project/service>", "Target service (defaults to linked .dockup)").option("-j, --json", "Machine-readable JSON output").action(import_agent.envImport);
|
|
48
|
+
program.command("status [project/service]").description("Show current service status + latest deployment").option("-j, --json", "Machine-readable JSON output").action(import_agent.statusView);
|
|
49
|
+
program.command("services").alias("ps").description("List all services across all your projects").option("-j, --json", "Machine-readable JSON output").action(import_agent.servicesList);
|
|
50
|
+
program.command("info [project/service]").description("Full details: repo, branch, status, domain, env keys, last deploy").option("-j, --json", "Machine-readable JSON output").action(import_agent.info);
|
|
51
|
+
program.command("deployments [project/service]").alias("history").description("Deployment history (most recent first)").option("-n, --number <count>", "How many to show", "10").option("-j, --json", "Machine-readable JSON output").action(import_agent.deploymentsView);
|
|
52
|
+
const registryCmd = program.command("registry").description("Private registry auth for a private FROM base image");
|
|
53
|
+
registryCmd.command("set [project/service]").description("Set registry credentials (used at build time to pull a private base image)").requiredOption("--url <registry>", "Registry host, e.g. ghcr.io").requiredOption("--user <username>", "Registry username").requiredOption("--token <token>", "PAT / password").option("-j, --json", "Machine-readable JSON output").action(import_agent.registrySet);
|
|
54
|
+
registryCmd.command("clear [project/service]").description("Remove registry credentials").option("-j, --json", "Machine-readable JSON output").action(import_agent.registryClear);
|
|
55
|
+
const resourcesCmd = program.command("resources [project/target]").alias("res").description("View reserved CPU/RAM (use `resources set` to change; --db for databases)").option("--db", "Target a database instead of a service").option("-j, --json", "Machine-readable JSON output").action(import_agent.resourcesView);
|
|
56
|
+
resourcesCmd.command("set [project/target]").description("Set reserved CPU/RAM \u2014 PRO (max 24 vCPU / 24576 MB)").option("--cpu <vcpu>", "vCPU to reserve, e.g. 2").option("--memory <mb>", "RAM in MB to reserve, e.g. 4096").option("--db", "Target a database instead of a service").option("-j, --json", "Machine-readable JSON output").action(import_agent.resourcesSet);
|
|
57
|
+
program.command("deploy [project/service]").description("Trigger a deployment (no git push; use `push` for git+deploy)").option("-b, --branch <branch>", "Branch to deploy").option("-j, --json", "Machine-readable JSON output").action(import_agent.deployTrigger);
|
|
58
|
+
program.command("open").description("Open service in browser").option("-d, --dashboard", "Open dashboard instead of live URL").action(import_open.open);
|
|
59
|
+
const workspaceCmd = program.command("workspace").alias("ws").description("Manage workspaces");
|
|
60
|
+
workspaceCmd.command("list").alias("ls").description("List all workspaces").action(import_workspace.workspaceList);
|
|
61
|
+
workspaceCmd.command("create").description("Create a new workspace").option("-n, --name <name>", "Workspace name").action(import_workspace.workspaceCreate);
|
|
62
|
+
workspaceCmd.command("select").alias("use").description("Select a workspace to use").action(import_workspace.workspaceSelect);
|
|
63
|
+
workspaceCmd.command("rename").description("Rename the current workspace").option("-n, --name <name>", "New workspace name").action(import_workspace.workspaceRename);
|
|
64
|
+
workspaceCmd.command("delete").alias("rm").description("Delete the current workspace").action(import_workspace.workspaceDelete);
|
|
65
|
+
workspaceCmd.command("current").description("Show the current workspace").action(import_workspace.workspaceCurrent);
|
|
66
|
+
const dbCmd = program.command("db").alias("database").description("Manage databases");
|
|
67
|
+
dbCmd.command("list").alias("ls").description("List databases in current workspace").action(import_database.databaseList);
|
|
68
|
+
dbCmd.command("create").description("Create a new database").option("-n, --name <name>", "Database name").option("-t, --type <type>", "Database type (postgresql, mysql, mongodb, redis)").action(import_database.databaseCreate);
|
|
69
|
+
dbCmd.command("rename [id]").description("Rename a database").action(import_database.databaseRename);
|
|
70
|
+
dbCmd.command("delete [id]").alias("rm").description("Delete a database").action(import_database.databaseDelete);
|
|
71
|
+
dbCmd.command("credentials [id]").alias("creds").description("Get database credentials").action(import_database.databaseCredentials);
|
|
72
|
+
dbCmd.command("info [id]").description("Get database details").action(import_database.databaseInfo);
|
|
174
73
|
program.parse();
|
|
175
|
-
// Show help if no command
|
|
176
74
|
if (!process.argv.slice(2).length) {
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
75
|
+
console.log(import_chalk.default.cyan(`
|
|
76
|
+
\u2554\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2557
|
|
77
|
+
\u2551 \u2551
|
|
78
|
+
\u2551 ${import_chalk.default.bold("DOCKUP CLI")} \u2551
|
|
79
|
+
\u2551 Deploy from your terminal \u2551
|
|
80
|
+
\u2551 \u2551
|
|
81
|
+
\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u2550\u255D
|
|
184
82
|
`));
|
|
185
|
-
|
|
83
|
+
program.outputHelp();
|
|
186
84
|
}
|