@mks2508/coolify-mks-cli-mcp 0.5.0 → 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 +25 -22
- 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 +34 -18
- package/src/cli/commands/server-resources.ts +71 -0
- package/src/cli/commands/servers.ts +23 -23
- package/src/cli/commands/service-logs.ts +24 -16
- package/src/cli/commands/services.ts +63 -0
- package/src/cli/commands/show.ts +72 -41
- package/src/cli/commands/start.ts +34 -18
- package/src/cli/commands/stop.ts +34 -18
- 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 +383 -151
- package/src/coolify/config.ts +29 -27
- package/src/coolify/index.ts +1829 -123
- package/src/coolify/types.ts +217 -124
- 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,219 +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
|
-
import { startCommand } from
|
|
27
|
-
import { stopCommand } from
|
|
28
|
-
import { restartCommand } from
|
|
29
|
-
import { buildLogsCommand } from
|
|
30
|
-
import { serviceLogsCommand } from
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
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");
|
|
38
80
|
|
|
39
81
|
// Create application
|
|
40
82
|
program
|
|
41
|
-
.command(
|
|
42
|
-
.description(
|
|
43
|
-
.option(
|
|
44
|
-
.option(
|
|
45
|
-
.option(
|
|
46
|
-
.option(
|
|
47
|
-
.option(
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
.option(
|
|
52
|
-
.option(
|
|
53
|
-
.option(
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
.
|
|
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);
|
|
59
125
|
|
|
60
126
|
// Config command
|
|
61
127
|
program
|
|
62
|
-
.command(
|
|
63
|
-
.description(
|
|
64
|
-
.argument(
|
|
65
|
-
.option(
|
|
66
|
-
.option(
|
|
67
|
-
.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);
|
|
68
134
|
|
|
69
135
|
// List applications
|
|
70
136
|
program
|
|
71
|
-
.command(
|
|
72
|
-
.description(
|
|
73
|
-
.option(
|
|
74
|
-
.option(
|
|
75
|
-
|
|
76
|
-
.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);
|
|
77
143
|
|
|
78
144
|
// Deploy application
|
|
79
145
|
program
|
|
80
|
-
.command(
|
|
81
|
-
.description(
|
|
82
|
-
.option(
|
|
83
|
-
.option(
|
|
84
|
-
.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);
|
|
85
151
|
|
|
86
152
|
// Logs command
|
|
87
153
|
program
|
|
88
|
-
.command(
|
|
89
|
-
.description(
|
|
90
|
-
.option(
|
|
91
|
-
.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")
|
|
92
158
|
.action((uuid, options) => {
|
|
93
|
-
const lines = parseInt(options.lines, 10)
|
|
94
|
-
logsCommand(uuid, { lines, follow: options.follow })
|
|
95
|
-
})
|
|
159
|
+
const lines = parseInt(options.lines, 10);
|
|
160
|
+
logsCommand(uuid, { lines, follow: options.follow });
|
|
161
|
+
});
|
|
96
162
|
|
|
97
163
|
// Servers command
|
|
98
164
|
program
|
|
99
|
-
.command(
|
|
100
|
-
.description(
|
|
101
|
-
|
|
102
|
-
.action((options) => serversCommand(options))
|
|
165
|
+
.command("servers")
|
|
166
|
+
.description("List available servers")
|
|
167
|
+
|
|
168
|
+
.action((options) => serversCommand(options));
|
|
103
169
|
|
|
104
170
|
// Projects command
|
|
105
171
|
program
|
|
106
|
-
.command(
|
|
107
|
-
.description(
|
|
108
|
-
|
|
109
|
-
.option(
|
|
110
|
-
.option(
|
|
111
|
-
.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));
|
|
112
178
|
|
|
113
179
|
// Environments command
|
|
114
180
|
program
|
|
115
|
-
.command(
|
|
116
|
-
.description(
|
|
117
|
-
|
|
118
|
-
.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));
|
|
119
185
|
|
|
120
186
|
// Env vars command
|
|
121
187
|
program
|
|
122
|
-
.command(
|
|
123
|
-
.description(
|
|
124
|
-
.option(
|
|
125
|
-
.option(
|
|
126
|
-
.option(
|
|
127
|
-
.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));
|
|
128
194
|
|
|
129
195
|
// Update application
|
|
130
196
|
program
|
|
131
|
-
.command(
|
|
132
|
-
.description(
|
|
133
|
-
.option(
|
|
134
|
-
.option(
|
|
135
|
-
.option(
|
|
136
|
-
.option(
|
|
137
|
-
.option(
|
|
138
|
-
.option(
|
|
139
|
-
.option(
|
|
140
|
-
.option(
|
|
141
|
-
.option(
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
.option(
|
|
146
|
-
|
|
147
|
-
|
|
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 }));
|
|
148
223
|
|
|
149
224
|
// Delete application
|
|
150
225
|
program
|
|
151
|
-
.command(
|
|
152
|
-
.description(
|
|
153
|
-
.option(
|
|
154
|
-
.option(
|
|
155
|
-
.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));
|
|
156
231
|
|
|
157
232
|
// Destinations command
|
|
158
233
|
program
|
|
159
|
-
.command(
|
|
160
|
-
.description(
|
|
161
|
-
.action(destinationsCommand)
|
|
234
|
+
.command("destinations <serverUuid>")
|
|
235
|
+
.description("List available destinations for a server")
|
|
236
|
+
.action(destinationsCommand);
|
|
162
237
|
|
|
163
238
|
// Show application details
|
|
164
239
|
program
|
|
165
|
-
.command(
|
|
166
|
-
.description(
|
|
167
|
-
.action(showCommand)
|
|
240
|
+
.command("show [uuid]")
|
|
241
|
+
.description("Show app details (reads .coolify.json if no UUID)")
|
|
242
|
+
.action(showCommand);
|
|
168
243
|
|
|
169
244
|
// Deployments history
|
|
170
245
|
program
|
|
171
|
-
.command(
|
|
172
|
-
.description(
|
|
173
|
-
|
|
174
|
-
.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")
|
|
175
250
|
.action((uuid, options) => {
|
|
176
|
-
const limit = parseInt(options.limit, 10)
|
|
177
|
-
deploymentsCommand(uuid, { full: options.full, limit })
|
|
178
|
-
})
|
|
251
|
+
const limit = parseInt(options.limit, 10);
|
|
252
|
+
deploymentsCommand(uuid, { full: options.full, limit });
|
|
253
|
+
});
|
|
179
254
|
|
|
180
255
|
// Start application
|
|
181
256
|
program
|
|
182
|
-
.command(
|
|
183
|
-
.description(
|
|
184
|
-
.action(startCommand)
|
|
257
|
+
.command("start [uuid]")
|
|
258
|
+
.description("Start application (reads .coolify.json if no UUID)")
|
|
259
|
+
.action(startCommand);
|
|
185
260
|
|
|
186
261
|
// Stop application
|
|
187
262
|
program
|
|
188
|
-
.command(
|
|
189
|
-
.description(
|
|
190
|
-
.action(stopCommand)
|
|
263
|
+
.command("stop [uuid]")
|
|
264
|
+
.description("Stop application (reads .coolify.json if no UUID)")
|
|
265
|
+
.action(stopCommand);
|
|
191
266
|
|
|
192
267
|
// Restart application
|
|
193
268
|
program
|
|
194
|
-
.command(
|
|
195
|
-
.description(
|
|
196
|
-
.action(restartCommand)
|
|
269
|
+
.command("restart [uuid]")
|
|
270
|
+
.description("Restart application (reads .coolify.json if no UUID)")
|
|
271
|
+
.action(restartCommand);
|
|
197
272
|
|
|
198
273
|
// Build/deployment logs
|
|
199
274
|
program
|
|
200
|
-
.command(
|
|
201
|
-
.description(
|
|
202
|
-
.option(
|
|
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)")
|
|
203
278
|
.action((deploymentUuid, options) => {
|
|
204
|
-
const lines = options.lines ? parseInt(options.lines, 10) : undefined
|
|
205
|
-
buildLogsCommand(deploymentUuid, { lines })
|
|
206
|
-
})
|
|
279
|
+
const lines = options.lines ? parseInt(options.lines, 10) : undefined;
|
|
280
|
+
buildLogsCommand(deploymentUuid, { lines });
|
|
281
|
+
});
|
|
207
282
|
|
|
208
283
|
// Service logs (docker-compose)
|
|
209
284
|
program
|
|
210
|
-
.command(
|
|
211
|
-
.description(
|
|
212
|
-
.option(
|
|
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")
|
|
213
288
|
.action((uuid, serviceName, options) => {
|
|
214
|
-
const lines = parseInt(options.lines, 10)
|
|
215
|
-
serviceLogsCommand(uuid, serviceName, { lines })
|
|
216
|
-
})
|
|
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);
|
|
217
449
|
|
|
218
450
|
// Show help by default
|
|
219
451
|
program.action(() => {
|
|
220
|
-
console.log(chalk.cyan(
|
|
221
|
-
console.log(chalk.gray(
|
|
222
|
-
program.help()
|
|
223
|
-
})
|
|
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
|
+
});
|
|
224
456
|
|
|
225
|
-
program.parse()
|
|
457
|
+
program.parse();
|