@mks2508/coolify-mks-cli-mcp 0.4.3 → 0.6.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/cli/coolify-state.d.ts +51 -0
- package/dist/cli/coolify-state.d.ts.map +1 -0
- package/dist/cli/index.js +2862 -631
- package/dist/coolify/config.d.ts +1 -1
- package/dist/coolify/config.d.ts.map +1 -1
- package/dist/coolify/index.d.ts +626 -12
- package/dist/coolify/index.d.ts.map +1 -1
- package/dist/coolify/types.d.ts +87 -3
- package/dist/coolify/types.d.ts.map +1 -1
- package/dist/dist-C4hIkHif.js +66 -0
- package/dist/dist-C4hIkHif.js.map +1 -0
- package/dist/dist-DEPvJhbP.js +3 -0
- package/dist/index.cjs +8511 -28542
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +32 -8
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8470 -28506
- package/dist/index.js.map +1 -1
- package/dist/network.d.ts +75 -0
- package/dist/network.d.ts.map +1 -0
- package/dist/sdk.d.ts +356 -0
- package/dist/sdk.d.ts.map +1 -0
- package/dist/server/index.d.ts +9 -0
- package/dist/server/index.d.ts.map +1 -0
- package/dist/server/sse.js +3 -1
- package/dist/server/stdio.d.ts +0 -2
- package/dist/server/stdio.d.ts.map +1 -1
- package/dist/server/stdio.js +3307 -1618
- package/dist/tools/definitions.d.ts +1 -1
- package/dist/tools/definitions.d.ts.map +1 -1
- package/dist/tools/handlers.d.ts +6 -7
- package/dist/tools/handlers.d.ts.map +1 -1
- package/dist/tools/index.d.ts +8 -0
- package/dist/tools/index.d.ts.map +1 -0
- package/dist/trace.d.ts +71 -0
- package/dist/trace.d.ts.map +1 -0
- package/dist/utils/format.d.ts +1 -1
- package/dist/utils/format.d.ts.map +1 -1
- package/package.json +13 -7
- package/src/cli/actions.ts +162 -0
- package/src/cli/commands/active-deployments.ts +24 -0
- package/src/cli/commands/build-logs.ts +58 -0
- package/src/cli/commands/cancel-deploy.ts +35 -0
- package/src/cli/commands/config.ts +53 -47
- package/src/cli/commands/create.ts +74 -53
- package/src/cli/commands/databases.ts +63 -0
- package/src/cli/commands/db.ts +68 -0
- package/src/cli/commands/delete.ts +41 -29
- package/src/cli/commands/deploy.ts +42 -21
- package/src/cli/commands/deployments.ts +41 -31
- package/src/cli/commands/destinations.ts +19 -27
- package/src/cli/commands/diagnose.ts +139 -0
- package/src/cli/commands/env.ts +66 -41
- package/src/cli/commands/environments.ts +36 -32
- package/src/cli/commands/exec.ts +39 -0
- package/src/cli/commands/keys.ts +46 -0
- package/src/cli/commands/list.ts +29 -27
- package/src/cli/commands/logs.ts +33 -18
- package/src/cli/commands/network.ts +145 -0
- package/src/cli/commands/projects.ts +51 -39
- package/src/cli/commands/restart.ts +60 -0
- package/src/cli/commands/server-resources.ts +71 -0
- package/src/cli/commands/servers.ts +23 -23
- package/src/cli/commands/service-logs.ts +59 -0
- package/src/cli/commands/services.ts +63 -0
- package/src/cli/commands/show.ts +72 -41
- package/src/cli/commands/start.ts +60 -0
- package/src/cli/commands/stop.ts +60 -0
- package/src/cli/commands/svc.ts +68 -0
- package/src/cli/commands/teams.ts +60 -0
- package/src/cli/commands/update.ts +73 -49
- package/src/cli/commands/version.ts +37 -0
- package/src/cli/coolify-state.ts +88 -0
- package/src/cli/index.ts +400 -125
- package/src/coolify/config.ts +29 -27
- package/src/coolify/index.ts +2221 -371
- package/src/coolify/types.ts +218 -123
- package/src/index.ts +82 -868
- package/src/network.ts +298 -0
- package/src/sdk.ts +597 -0
- package/src/server/index.ts +13 -0
- package/src/server/sse.ts +33 -25
- package/src/server/stdio.ts +24 -27
- package/src/tools/definitions.ts +893 -264
- package/src/tools/handlers.ts +556 -748
- package/src/tools/index.ts +8 -0
- package/src/trace.ts +116 -0
- package/src/utils/format.ts +36 -33
package/src/cli/index.ts
CHANGED
|
@@ -7,176 +7,451 @@
|
|
|
7
7
|
* @module
|
|
8
8
|
*/
|
|
9
9
|
|
|
10
|
-
import { Command } from
|
|
11
|
-
import chalk from
|
|
12
|
-
import { createCommand } from
|
|
13
|
-
import { deployCommand } from
|
|
14
|
-
import { listCommand } from
|
|
15
|
-
import { logsCommand } from
|
|
16
|
-
import { serversCommand } from
|
|
17
|
-
import { projectsCommand } from
|
|
18
|
-
import { environmentsCommand } from
|
|
19
|
-
import { configCommand } from
|
|
20
|
-
import { envCommand } from
|
|
21
|
-
import { updateCommand } from
|
|
22
|
-
import { deleteCommand } from
|
|
23
|
-
import { destinationsCommand } from
|
|
24
|
-
import { showCommand } from
|
|
25
|
-
import { deploymentsCommand } from
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
10
|
+
import { Command } from "commander";
|
|
11
|
+
import chalk from "chalk";
|
|
12
|
+
import { createCommand } from "./commands/create.js";
|
|
13
|
+
import { deployCommand } from "./commands/deploy.js";
|
|
14
|
+
import { listCommand } from "./commands/list.js";
|
|
15
|
+
import { logsCommand } from "./commands/logs.js";
|
|
16
|
+
import { serversCommand } from "./commands/servers.js";
|
|
17
|
+
import { projectsCommand } from "./commands/projects.js";
|
|
18
|
+
import { environmentsCommand } from "./commands/environments.js";
|
|
19
|
+
import { configCommand } from "./commands/config.js";
|
|
20
|
+
import { envCommand } from "./commands/env.js";
|
|
21
|
+
import { updateCommand } from "./commands/update.js";
|
|
22
|
+
import { deleteCommand } from "./commands/delete.js";
|
|
23
|
+
import { destinationsCommand } from "./commands/destinations.js";
|
|
24
|
+
import { showCommand } from "./commands/show.js";
|
|
25
|
+
import { deploymentsCommand } from "./commands/deployments.js";
|
|
26
|
+
import { startCommand } from "./commands/start.js";
|
|
27
|
+
import { stopCommand } from "./commands/stop.js";
|
|
28
|
+
import { restartCommand } from "./commands/restart.js";
|
|
29
|
+
import { buildLogsCommand } from "./commands/build-logs.js";
|
|
30
|
+
import { serviceLogsCommand } from "./commands/service-logs.js";
|
|
31
|
+
import { versionCommand } from "./commands/version.js";
|
|
32
|
+
import { databasesCommand } from "./commands/databases.js";
|
|
33
|
+
import { servicesCommand as servicesListCommand } from "./commands/services.js";
|
|
34
|
+
import { cancelDeployCommand } from "./commands/cancel-deploy.js";
|
|
35
|
+
import { serverResourcesCommand } from "./commands/server-resources.js";
|
|
36
|
+
import {
|
|
37
|
+
dbListCommand,
|
|
38
|
+
dbGetCommand,
|
|
39
|
+
dbStartCommand,
|
|
40
|
+
dbStopCommand,
|
|
41
|
+
dbRestartCommand,
|
|
42
|
+
dbDeleteCommand,
|
|
43
|
+
} from "./commands/db.js";
|
|
44
|
+
import {
|
|
45
|
+
svcListCommand,
|
|
46
|
+
svcGetCommand,
|
|
47
|
+
svcStartCommand,
|
|
48
|
+
svcStopCommand,
|
|
49
|
+
svcRestartCommand,
|
|
50
|
+
svcDeleteCommand,
|
|
51
|
+
} from "./commands/svc.js";
|
|
52
|
+
import {
|
|
53
|
+
keysListCommand,
|
|
54
|
+
keysGetCommand,
|
|
55
|
+
keysDeleteCommand,
|
|
56
|
+
} from "./commands/keys.js";
|
|
57
|
+
import {
|
|
58
|
+
teamsListCommand,
|
|
59
|
+
teamsCurrentCommand,
|
|
60
|
+
teamsMembersCommand,
|
|
61
|
+
} from "./commands/teams.js";
|
|
62
|
+
import {
|
|
63
|
+
diagnoseAppCommand,
|
|
64
|
+
diagnoseServerCommand,
|
|
65
|
+
scanIssuesCommand,
|
|
66
|
+
} from "./commands/diagnose.js";
|
|
67
|
+
import { execCommand } from "./commands/exec.js";
|
|
68
|
+
import { activeDeploymentsCommand } from "./commands/active-deployments.js";
|
|
69
|
+
import {
|
|
70
|
+
networkInspectCommand,
|
|
71
|
+
analyzeDeployCommand,
|
|
72
|
+
} from "./commands/network.js";
|
|
73
|
+
|
|
74
|
+
const program = new Command();
|
|
75
|
+
|
|
76
|
+
program
|
|
77
|
+
.name("coolify-mcp")
|
|
78
|
+
.description("CLI for Coolify deployment management")
|
|
79
|
+
.version("0.1.0");
|
|
33
80
|
|
|
34
81
|
// Create application
|
|
35
82
|
program
|
|
36
|
-
.command(
|
|
37
|
-
.description(
|
|
38
|
-
.option(
|
|
39
|
-
.option(
|
|
40
|
-
.option(
|
|
41
|
-
.option(
|
|
42
|
-
.option(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
.option(
|
|
47
|
-
.option(
|
|
48
|
-
.option(
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
.
|
|
83
|
+
.command("create")
|
|
84
|
+
.description("Create a new application")
|
|
85
|
+
.option("--name <name>", "Application name")
|
|
86
|
+
.option("--description <desc>", "Application description")
|
|
87
|
+
.option("--server <uuid>", "Server UUID")
|
|
88
|
+
.option("--project <uuid>", "Project UUID")
|
|
89
|
+
.option(
|
|
90
|
+
"--environment <uuid>",
|
|
91
|
+
"Environment UUID (auto-fetched if not provided)",
|
|
92
|
+
)
|
|
93
|
+
.option("--repo <url>", "Git repository URL")
|
|
94
|
+
.option("--branch <branch>", "Git branch", "main")
|
|
95
|
+
.option(
|
|
96
|
+
"--type <type>",
|
|
97
|
+
"Application type (public, private-github-app, private-deploy-key, dockerfile, docker-image, docker-compose)",
|
|
98
|
+
"public",
|
|
99
|
+
)
|
|
100
|
+
.option(
|
|
101
|
+
"--build-pack <pack>",
|
|
102
|
+
"Build pack (dockerfile, nixpacks, static, dockercompose)",
|
|
103
|
+
"dockerfile",
|
|
104
|
+
)
|
|
105
|
+
.option("--ports <ports>", "Ports to expose (default: 3000)", "3000")
|
|
106
|
+
.option("--docker-image <image>", "Docker image (for docker-image type)")
|
|
107
|
+
.option(
|
|
108
|
+
"--docker-compose <content>",
|
|
109
|
+
"Docker Compose content (for docker-compose type)",
|
|
110
|
+
)
|
|
111
|
+
.option(
|
|
112
|
+
"--docker-compose-location <path>",
|
|
113
|
+
'Docker Compose file path (for dockercompose buildPack, e.g., "docker-compose.yml")',
|
|
114
|
+
)
|
|
115
|
+
.option(
|
|
116
|
+
"--dockerfile-location <path>",
|
|
117
|
+
'Dockerfile location (e.g., "apps/haidodocs/Dockerfile")',
|
|
118
|
+
)
|
|
119
|
+
.option(
|
|
120
|
+
"--base-directory <dir>",
|
|
121
|
+
'Base directory for build context (default: "/")',
|
|
122
|
+
"/",
|
|
123
|
+
)
|
|
124
|
+
.action(createCommand);
|
|
54
125
|
|
|
55
126
|
// Config command
|
|
56
127
|
program
|
|
57
|
-
.command(
|
|
58
|
-
.description(
|
|
59
|
-
.argument(
|
|
60
|
-
.option(
|
|
61
|
-
.option(
|
|
62
|
-
.action(configCommand)
|
|
128
|
+
.command("config")
|
|
129
|
+
.description("Manage configuration")
|
|
130
|
+
.argument("[action]", "Action to perform (set, get, path)")
|
|
131
|
+
.option("--key <key>", 'Configuration key (for "set" action)')
|
|
132
|
+
.option("--value <value>", 'Configuration value (for "set" action)')
|
|
133
|
+
.action(configCommand);
|
|
63
134
|
|
|
64
135
|
// List applications
|
|
65
136
|
program
|
|
66
|
-
.command(
|
|
67
|
-
.description(
|
|
68
|
-
.option(
|
|
69
|
-
.option(
|
|
70
|
-
|
|
71
|
-
.action(listCommand)
|
|
137
|
+
.command("list")
|
|
138
|
+
.description("List all applications")
|
|
139
|
+
.option("-t, --team <id>", "Filter by team ID")
|
|
140
|
+
.option("-p, --project <id>", "Filter by project ID")
|
|
141
|
+
|
|
142
|
+
.action(listCommand);
|
|
72
143
|
|
|
73
144
|
// Deploy application
|
|
74
145
|
program
|
|
75
|
-
.command(
|
|
76
|
-
.description(
|
|
77
|
-
.option(
|
|
78
|
-
.option(
|
|
79
|
-
.action(deployCommand)
|
|
146
|
+
.command("deploy [uuid]")
|
|
147
|
+
.description("Deploy an application (reads .coolify.json if no UUID)")
|
|
148
|
+
.option("-f, --force", "Force rebuild without cache")
|
|
149
|
+
.option("-t, --tag <tag>", "Deploy specific tag/version")
|
|
150
|
+
.action(deployCommand);
|
|
80
151
|
|
|
81
152
|
// Logs command
|
|
82
153
|
program
|
|
83
|
-
.command(
|
|
84
|
-
.description(
|
|
85
|
-
.option(
|
|
86
|
-
.option(
|
|
154
|
+
.command("logs [uuid]")
|
|
155
|
+
.description("Get application logs (reads .coolify.json if no UUID)")
|
|
156
|
+
.option("-n, --lines <number>", "Number of lines to retrieve", "50")
|
|
157
|
+
.option("-f, --follow", "Follow logs in real-time")
|
|
87
158
|
.action((uuid, options) => {
|
|
88
|
-
const lines = parseInt(options.lines, 10)
|
|
89
|
-
logsCommand(uuid, { lines, follow: options.follow })
|
|
90
|
-
})
|
|
159
|
+
const lines = parseInt(options.lines, 10);
|
|
160
|
+
logsCommand(uuid, { lines, follow: options.follow });
|
|
161
|
+
});
|
|
91
162
|
|
|
92
163
|
// Servers command
|
|
93
164
|
program
|
|
94
|
-
.command(
|
|
95
|
-
.description(
|
|
96
|
-
|
|
97
|
-
.action((options) => serversCommand(options))
|
|
165
|
+
.command("servers")
|
|
166
|
+
.description("List available servers")
|
|
167
|
+
|
|
168
|
+
.action((options) => serversCommand(options));
|
|
98
169
|
|
|
99
170
|
// Projects command
|
|
100
171
|
program
|
|
101
|
-
.command(
|
|
102
|
-
.description(
|
|
103
|
-
|
|
104
|
-
.option(
|
|
105
|
-
.option(
|
|
106
|
-
.action((options) => projectsCommand(options))
|
|
172
|
+
.command("projects")
|
|
173
|
+
.description("List or create projects")
|
|
174
|
+
|
|
175
|
+
.option("--create <name>", "Create a new project with this name")
|
|
176
|
+
.option("--description <desc>", "Project description (use with --create)")
|
|
177
|
+
.action((options) => projectsCommand(options));
|
|
107
178
|
|
|
108
179
|
// Environments command
|
|
109
180
|
program
|
|
110
|
-
.command(
|
|
111
|
-
.description(
|
|
112
|
-
|
|
113
|
-
.action((projectUuid, options) => environmentsCommand(projectUuid, options))
|
|
181
|
+
.command("environments <projectUuid>")
|
|
182
|
+
.description("List environments for a project")
|
|
183
|
+
|
|
184
|
+
.action((projectUuid, options) => environmentsCommand(projectUuid, options));
|
|
114
185
|
|
|
115
186
|
// Env vars command
|
|
116
187
|
program
|
|
117
|
-
.command(
|
|
118
|
-
.description(
|
|
119
|
-
.option(
|
|
120
|
-
.option(
|
|
121
|
-
.option(
|
|
122
|
-
.action((uuid, options) => envCommand(uuid, options))
|
|
188
|
+
.command("env [uuid]")
|
|
189
|
+
.description("Manage env vars (reads .coolify.json if no UUID)")
|
|
190
|
+
.option("--set <KEY=VALUE>", "Set an environment variable")
|
|
191
|
+
.option("--delete <KEY>", "Delete an environment variable")
|
|
192
|
+
.option("--buildtime", "Mark variable as build-time only (use with --set)")
|
|
193
|
+
.action((uuid, options) => envCommand(uuid, options));
|
|
123
194
|
|
|
124
195
|
// Update application
|
|
125
196
|
program
|
|
126
|
-
.command(
|
|
127
|
-
.description(
|
|
128
|
-
.option(
|
|
129
|
-
.option(
|
|
130
|
-
.option(
|
|
131
|
-
.option(
|
|
132
|
-
.option(
|
|
133
|
-
.option(
|
|
134
|
-
.option(
|
|
135
|
-
.option(
|
|
136
|
-
.option(
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
.option(
|
|
141
|
-
|
|
142
|
-
|
|
197
|
+
.command("update [uuid]")
|
|
198
|
+
.description("Update app config (reads .coolify.json if no UUID)")
|
|
199
|
+
.option("--name <name>", "Application name")
|
|
200
|
+
.option("--description <desc>", "Application description")
|
|
201
|
+
.option("--build-pack <pack>", "Build pack (dockerfile, nixpacks, static)")
|
|
202
|
+
.option("--git-branch <branch>", "Git branch")
|
|
203
|
+
.option("--ports <ports>", "Ports to expose (e.g., 3000)")
|
|
204
|
+
.option("--install-command <cmd>", "Install command (nixpacks)")
|
|
205
|
+
.option("--build-command <cmd>", "Build command")
|
|
206
|
+
.option("--start-command <cmd>", "Start command")
|
|
207
|
+
.option(
|
|
208
|
+
"--dockerfile-location <path>",
|
|
209
|
+
'Dockerfile location (e.g., "apps/haidodocs/Dockerfile")',
|
|
210
|
+
)
|
|
211
|
+
.option(
|
|
212
|
+
"--base-directory <dir>",
|
|
213
|
+
'Base directory for build context (e.g., "/")',
|
|
214
|
+
)
|
|
215
|
+
.option(
|
|
216
|
+
"--domains <domains>",
|
|
217
|
+
'Domains (comma-separated with protocol, e.g., "https://app.example.com")',
|
|
218
|
+
)
|
|
219
|
+
.option("--auto-deploy", "Enable auto-deploy on git push")
|
|
220
|
+
.option("--no-auto-deploy", "Disable auto-deploy on git push")
|
|
221
|
+
.option("--force-https", "Enable forced HTTPS redirect")
|
|
222
|
+
.action((uuid, options) => updateCommand({ uuid, ...options }));
|
|
143
223
|
|
|
144
224
|
// Delete application
|
|
145
225
|
program
|
|
146
|
-
.command(
|
|
147
|
-
.description(
|
|
148
|
-
.option(
|
|
149
|
-
.option(
|
|
150
|
-
.action((uuid, options) => deleteCommand(uuid, options))
|
|
226
|
+
.command("delete [uuid]")
|
|
227
|
+
.description("Delete application (reads .coolify.json if no UUID)")
|
|
228
|
+
.option("-f, --force", "Skip confirmation prompt")
|
|
229
|
+
.option("-y, --yes", "Skip confirmation prompt (alias for --force)")
|
|
230
|
+
.action((uuid, options) => deleteCommand(uuid, options));
|
|
151
231
|
|
|
152
232
|
// Destinations command
|
|
153
233
|
program
|
|
154
|
-
.command(
|
|
155
|
-
.description(
|
|
156
|
-
.action(destinationsCommand)
|
|
234
|
+
.command("destinations <serverUuid>")
|
|
235
|
+
.description("List available destinations for a server")
|
|
236
|
+
.action(destinationsCommand);
|
|
157
237
|
|
|
158
238
|
// Show application details
|
|
159
239
|
program
|
|
160
|
-
.command(
|
|
161
|
-
.description(
|
|
162
|
-
.action(showCommand)
|
|
240
|
+
.command("show [uuid]")
|
|
241
|
+
.description("Show app details (reads .coolify.json if no UUID)")
|
|
242
|
+
.action(showCommand);
|
|
163
243
|
|
|
164
244
|
// Deployments history
|
|
165
245
|
program
|
|
166
|
-
.command(
|
|
167
|
-
.description(
|
|
168
|
-
|
|
169
|
-
.option(
|
|
246
|
+
.command("deployments [uuid]")
|
|
247
|
+
.description("Show deployment history (reads .coolify.json if no UUID)")
|
|
248
|
+
|
|
249
|
+
.option("-n, --limit <number>", "Limit number of deployments shown", "10")
|
|
170
250
|
.action((uuid, options) => {
|
|
171
|
-
const limit = parseInt(options.limit, 10)
|
|
172
|
-
deploymentsCommand(uuid, { full: options.full, limit })
|
|
173
|
-
})
|
|
251
|
+
const limit = parseInt(options.limit, 10);
|
|
252
|
+
deploymentsCommand(uuid, { full: options.full, limit });
|
|
253
|
+
});
|
|
254
|
+
|
|
255
|
+
// Start application
|
|
256
|
+
program
|
|
257
|
+
.command("start [uuid]")
|
|
258
|
+
.description("Start application (reads .coolify.json if no UUID)")
|
|
259
|
+
.action(startCommand);
|
|
260
|
+
|
|
261
|
+
// Stop application
|
|
262
|
+
program
|
|
263
|
+
.command("stop [uuid]")
|
|
264
|
+
.description("Stop application (reads .coolify.json if no UUID)")
|
|
265
|
+
.action(stopCommand);
|
|
266
|
+
|
|
267
|
+
// Restart application
|
|
268
|
+
program
|
|
269
|
+
.command("restart [uuid]")
|
|
270
|
+
.description("Restart application (reads .coolify.json if no UUID)")
|
|
271
|
+
.action(restartCommand);
|
|
272
|
+
|
|
273
|
+
// Build/deployment logs
|
|
274
|
+
program
|
|
275
|
+
.command("build-logs <deployment-uuid>")
|
|
276
|
+
.description("View build/deployment logs for a specific deployment")
|
|
277
|
+
.option("-n, --lines <number>", "Number of lines to show (tail)")
|
|
278
|
+
.action((deploymentUuid, options) => {
|
|
279
|
+
const lines = options.lines ? parseInt(options.lines, 10) : undefined;
|
|
280
|
+
buildLogsCommand(deploymentUuid, { lines });
|
|
281
|
+
});
|
|
282
|
+
|
|
283
|
+
// Service logs (docker-compose)
|
|
284
|
+
program
|
|
285
|
+
.command("service-logs <uuid> <service-name>")
|
|
286
|
+
.description("View logs for a specific docker-compose service")
|
|
287
|
+
.option("-n, --lines <number>", "Number of lines to retrieve", "50")
|
|
288
|
+
.action((uuid, serviceName, options) => {
|
|
289
|
+
const lines = parseInt(options.lines, 10);
|
|
290
|
+
serviceLogsCommand(uuid, serviceName, { lines });
|
|
291
|
+
});
|
|
292
|
+
|
|
293
|
+
// Coolify server version
|
|
294
|
+
program
|
|
295
|
+
.command("version")
|
|
296
|
+
.description("Show Coolify server version")
|
|
297
|
+
.action(versionCommand);
|
|
298
|
+
|
|
299
|
+
// List databases
|
|
300
|
+
program
|
|
301
|
+
.command("databases")
|
|
302
|
+
.description("List all databases")
|
|
303
|
+
|
|
304
|
+
.action((options) => databasesCommand(options));
|
|
305
|
+
|
|
306
|
+
// List services
|
|
307
|
+
program
|
|
308
|
+
.command("services")
|
|
309
|
+
.description("List all services")
|
|
310
|
+
|
|
311
|
+
.action((options) => servicesListCommand(options));
|
|
312
|
+
|
|
313
|
+
// Cancel deployment
|
|
314
|
+
program
|
|
315
|
+
.command("cancel-deploy <deployment-uuid>")
|
|
316
|
+
.description("Cancel an in-progress deployment")
|
|
317
|
+
.action(cancelDeployCommand);
|
|
318
|
+
|
|
319
|
+
// Server resources
|
|
320
|
+
program
|
|
321
|
+
.command("server-resources <server-uuid>")
|
|
322
|
+
.description("List resources deployed on a server")
|
|
323
|
+
|
|
324
|
+
.action((serverUuid, options) => serverResourcesCommand(serverUuid, options));
|
|
325
|
+
|
|
326
|
+
// ─── Database subcommands ────────────────────────────────────────────────────
|
|
327
|
+
|
|
328
|
+
const db = program.command("db").description("Manage databases");
|
|
329
|
+
db.command("list").description("List all databases").action(dbListCommand);
|
|
330
|
+
db.command("get <uuid>")
|
|
331
|
+
.description("Get database details")
|
|
332
|
+
.action(dbGetCommand);
|
|
333
|
+
db.command("start <uuid>")
|
|
334
|
+
.description("Start a database")
|
|
335
|
+
.action(dbStartCommand);
|
|
336
|
+
db.command("stop <uuid>").description("Stop a database").action(dbStopCommand);
|
|
337
|
+
db.command("restart <uuid>")
|
|
338
|
+
.description("Restart a database")
|
|
339
|
+
.action(dbRestartCommand);
|
|
340
|
+
db.command("delete <uuid>")
|
|
341
|
+
.description("Delete a database")
|
|
342
|
+
.action(dbDeleteCommand);
|
|
343
|
+
db.action(() => db.help());
|
|
344
|
+
|
|
345
|
+
// ─── Service subcommands ─────────────────────────────────────────────────────
|
|
346
|
+
|
|
347
|
+
const svc = program.command("svc").description("Manage services");
|
|
348
|
+
svc.command("list").description("List all services").action(svcListCommand);
|
|
349
|
+
svc
|
|
350
|
+
.command("get <uuid>")
|
|
351
|
+
.description("Get service details")
|
|
352
|
+
.action(svcGetCommand);
|
|
353
|
+
svc
|
|
354
|
+
.command("start <uuid>")
|
|
355
|
+
.description("Start a service")
|
|
356
|
+
.action(svcStartCommand);
|
|
357
|
+
svc.command("stop <uuid>").description("Stop a service").action(svcStopCommand);
|
|
358
|
+
svc
|
|
359
|
+
.command("restart <uuid>")
|
|
360
|
+
.description("Restart a service")
|
|
361
|
+
.action(svcRestartCommand);
|
|
362
|
+
svc
|
|
363
|
+
.command("delete <uuid>")
|
|
364
|
+
.description("Delete a service")
|
|
365
|
+
.action(svcDeleteCommand);
|
|
366
|
+
svc.action(() => svc.help());
|
|
367
|
+
|
|
368
|
+
// ─── SSH Key subcommands ─────────────────────────────────────────────────────
|
|
369
|
+
|
|
370
|
+
const keys = program.command("keys").description("Manage SSH private keys");
|
|
371
|
+
keys
|
|
372
|
+
.command("list")
|
|
373
|
+
.description("List all private keys")
|
|
374
|
+
.action(keysListCommand);
|
|
375
|
+
keys
|
|
376
|
+
.command("get <uuid>")
|
|
377
|
+
.description("Get private key details")
|
|
378
|
+
.action(keysGetCommand);
|
|
379
|
+
keys
|
|
380
|
+
.command("delete <uuid>")
|
|
381
|
+
.description("Delete a private key")
|
|
382
|
+
.action(keysDeleteCommand);
|
|
383
|
+
keys.action(() => keys.help());
|
|
384
|
+
|
|
385
|
+
// ─── Team subcommands ────────────────────────────────────────────────────────
|
|
386
|
+
|
|
387
|
+
const team = program.command("team").description("Manage teams");
|
|
388
|
+
team.command("list").description("List all teams").action(teamsListCommand);
|
|
389
|
+
team
|
|
390
|
+
.command("current")
|
|
391
|
+
.description("Show current team")
|
|
392
|
+
.action(teamsCurrentCommand);
|
|
393
|
+
team
|
|
394
|
+
.command("members <team-id>")
|
|
395
|
+
.description("Show team members")
|
|
396
|
+
.action(teamsMembersCommand);
|
|
397
|
+
team.action(() => team.help());
|
|
398
|
+
|
|
399
|
+
// ─── Diagnostics ─────────────────────────────────────────────────────────────
|
|
400
|
+
|
|
401
|
+
program
|
|
402
|
+
.command("diagnose [query]")
|
|
403
|
+
.description("Diagnose application (reads .coolify.json if no query)")
|
|
404
|
+
.action(diagnoseAppCommand);
|
|
405
|
+
|
|
406
|
+
program
|
|
407
|
+
.command("diagnose-server <query>")
|
|
408
|
+
.description("Diagnose a server (name, IP, or UUID)")
|
|
409
|
+
.action(diagnoseServerCommand);
|
|
410
|
+
|
|
411
|
+
program
|
|
412
|
+
.command("scan")
|
|
413
|
+
.description("Scan all infrastructure for issues")
|
|
414
|
+
.action(scanIssuesCommand);
|
|
415
|
+
|
|
416
|
+
// ─── Execute command ─────────────────────────────────────────────────────────
|
|
417
|
+
|
|
418
|
+
program
|
|
419
|
+
.command("exec [uuid] <command>")
|
|
420
|
+
.description("Execute command on app container (reads .coolify.json)")
|
|
421
|
+
.action(execCommand);
|
|
422
|
+
|
|
423
|
+
// ─── Active deployments ──────────────────────────────────────────────────────
|
|
424
|
+
|
|
425
|
+
program
|
|
426
|
+
.command("active-deployments")
|
|
427
|
+
.description("List all active/queued deployments")
|
|
428
|
+
.action(activeDeploymentsCommand);
|
|
429
|
+
|
|
430
|
+
// ─── Network diagnostics ─────────────────────────────────────────────────────
|
|
431
|
+
|
|
432
|
+
const net = program.command("network").description("Network diagnostics");
|
|
433
|
+
net
|
|
434
|
+
.command("inspect [uuid]")
|
|
435
|
+
.description("Inspect container network (DNS, hosts, connectivity)")
|
|
436
|
+
.option(
|
|
437
|
+
"--services <names>",
|
|
438
|
+
"Comma-separated service names to test (e.g., db,redis)",
|
|
439
|
+
)
|
|
440
|
+
.action((uuid, options) => networkInspectCommand(uuid, options));
|
|
441
|
+
net.action(() => net.help());
|
|
442
|
+
|
|
443
|
+
// ─── Deploy failure analysis ─────────────────────────────────────────────────
|
|
444
|
+
|
|
445
|
+
program
|
|
446
|
+
.command("analyze-deploy <deployment-uuid>")
|
|
447
|
+
.description("Analyze a failed deployment (extract errors, suggest fixes)")
|
|
448
|
+
.action(analyzeDeployCommand);
|
|
174
449
|
|
|
175
450
|
// Show help by default
|
|
176
451
|
program.action(() => {
|
|
177
|
-
console.log(chalk.cyan(
|
|
178
|
-
console.log(chalk.gray(
|
|
179
|
-
program.help()
|
|
180
|
-
})
|
|
452
|
+
console.log(chalk.cyan("Coolify MCP CLI v0.6.0"));
|
|
453
|
+
console.log(chalk.gray("Manage Coolify deployments from the command line\n"));
|
|
454
|
+
program.help();
|
|
455
|
+
});
|
|
181
456
|
|
|
182
|
-
program.parse()
|
|
457
|
+
program.parse();
|