dockup-cli 1.0.1 → 1.1.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/dist/index.js CHANGED
@@ -1,186 +1,82 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
- var __importDefault = (this && this.__importDefault) || function (mod) {
4
- return (mod && mod.__esModule) ? mod : { "default": mod };
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
- Object.defineProperty(exports, "__esModule", { value: true });
7
- const commander_1 = require("commander");
8
- const chalk_1 = __importDefault(require("chalk"));
9
- const auth_1 = require("./commands/auth");
10
- const link_1 = require("./commands/link");
11
- const push_1 = require("./commands/push");
12
- const logs_1 = require("./commands/logs");
13
- const env_1 = require("./commands/env");
14
- const status_1 = require("./commands/status");
15
- const open_1 = require("./commands/open");
16
- const workspace_1 = require("./commands/workspace");
17
- const database_1 = require("./commands/database");
18
- const program = new commander_1.Command();
19
- program
20
- .name('dockup')
21
- .description('Dockup CLI - Deploy from your terminal')
22
- .version('1.0.0');
23
- // Auth commands
24
- program
25
- .command('login')
26
- .description('Authenticate with Dockup')
27
- .option('-t, --token <token>', 'Use API token directly')
28
- .action(auth_1.login);
29
- program
30
- .command('logout')
31
- .description('Log out from Dockup')
32
- .action(auth_1.logout);
33
- program
34
- .command('whoami')
35
- .description('Show current logged in user')
36
- .action(auth_1.whoami);
37
- // Project linking
38
- program
39
- .command('link [project/service]')
40
- .description('Link current directory to a Dockup service')
41
- .action(link_1.link);
42
- program
43
- .command('unlink')
44
- .description('Unlink current directory from Dockup')
45
- .action(link_1.unlink);
46
- // Deploy
47
- program
48
- .command('push [branch]')
49
- .description('Push and deploy to Dockup')
50
- .option('-f, --force', 'Force deploy without git push')
51
- .action(push_1.push);
52
- // Logs
53
- program
54
- .command('logs')
55
- .description('Stream live logs from your service')
56
- .option('-n, --tail <lines>', 'Number of lines to show', '100')
57
- .option('-f, --follow', 'Follow log output', true)
58
- .action(logs_1.logs);
59
- // Environment variables
60
- const envCmd = program.command('env').description('Manage environment variables');
61
- envCmd
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.0.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
+ 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);
56
+ program.command("open").description("Open service in browser").option("-d, --dashboard", "Open dashboard instead of live URL").action(import_open.open);
57
+ const workspaceCmd = program.command("workspace").alias("ws").description("Manage workspaces");
58
+ workspaceCmd.command("list").alias("ls").description("List all workspaces").action(import_workspace.workspaceList);
59
+ workspaceCmd.command("create").description("Create a new workspace").option("-n, --name <name>", "Workspace name").action(import_workspace.workspaceCreate);
60
+ workspaceCmd.command("select").alias("use").description("Select a workspace to use").action(import_workspace.workspaceSelect);
61
+ workspaceCmd.command("rename").description("Rename the current workspace").option("-n, --name <name>", "New workspace name").action(import_workspace.workspaceRename);
62
+ workspaceCmd.command("delete").alias("rm").description("Delete the current workspace").action(import_workspace.workspaceDelete);
63
+ workspaceCmd.command("current").description("Show the current workspace").action(import_workspace.workspaceCurrent);
64
+ const dbCmd = program.command("db").alias("database").description("Manage databases");
65
+ dbCmd.command("list").alias("ls").description("List databases in current workspace").action(import_database.databaseList);
66
+ 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);
67
+ dbCmd.command("rename [id]").description("Rename a database").action(import_database.databaseRename);
68
+ dbCmd.command("delete [id]").alias("rm").description("Delete a database").action(import_database.databaseDelete);
69
+ dbCmd.command("credentials [id]").alias("creds").description("Get database credentials").action(import_database.databaseCredentials);
70
+ dbCmd.command("info [id]").description("Get database details").action(import_database.databaseInfo);
174
71
  program.parse();
175
- // Show help if no command
176
72
  if (!process.argv.slice(2).length) {
177
- console.log(chalk_1.default.cyan(`
178
- ╔══════════════════════════════════════╗
179
-
180
- ${chalk_1.default.bold('DOCKUP CLI')}
181
- Deploy from your terminal
182
-
183
- ╚══════════════════════════════════════╝
73
+ console.log(import_chalk.default.cyan(`
74
+ \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
75
+ \u2551 \u2551
76
+ \u2551 ${import_chalk.default.bold("DOCKUP CLI")} \u2551
77
+ \u2551 Deploy from your terminal \u2551
78
+ \u2551 \u2551
79
+ \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
80
  `));
185
- program.outputHelp();
81
+ program.outputHelp();
186
82
  }