@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.
Files changed (88) hide show
  1. package/dist/cli/coolify-state.d.ts +51 -0
  2. package/dist/cli/coolify-state.d.ts.map +1 -0
  3. package/dist/cli/index.js +2862 -631
  4. package/dist/coolify/config.d.ts +1 -1
  5. package/dist/coolify/config.d.ts.map +1 -1
  6. package/dist/coolify/index.d.ts +626 -12
  7. package/dist/coolify/index.d.ts.map +1 -1
  8. package/dist/coolify/types.d.ts +87 -3
  9. package/dist/coolify/types.d.ts.map +1 -1
  10. package/dist/dist-C4hIkHif.js +66 -0
  11. package/dist/dist-C4hIkHif.js.map +1 -0
  12. package/dist/dist-DEPvJhbP.js +3 -0
  13. package/dist/index.cjs +8511 -28542
  14. package/dist/index.cjs.map +1 -1
  15. package/dist/index.d.ts +32 -8
  16. package/dist/index.d.ts.map +1 -1
  17. package/dist/index.js +8470 -28506
  18. package/dist/index.js.map +1 -1
  19. package/dist/network.d.ts +75 -0
  20. package/dist/network.d.ts.map +1 -0
  21. package/dist/sdk.d.ts +356 -0
  22. package/dist/sdk.d.ts.map +1 -0
  23. package/dist/server/index.d.ts +9 -0
  24. package/dist/server/index.d.ts.map +1 -0
  25. package/dist/server/sse.js +3 -1
  26. package/dist/server/stdio.d.ts +0 -2
  27. package/dist/server/stdio.d.ts.map +1 -1
  28. package/dist/server/stdio.js +3307 -1618
  29. package/dist/tools/definitions.d.ts +1 -1
  30. package/dist/tools/definitions.d.ts.map +1 -1
  31. package/dist/tools/handlers.d.ts +6 -7
  32. package/dist/tools/handlers.d.ts.map +1 -1
  33. package/dist/tools/index.d.ts +8 -0
  34. package/dist/tools/index.d.ts.map +1 -0
  35. package/dist/trace.d.ts +71 -0
  36. package/dist/trace.d.ts.map +1 -0
  37. package/dist/utils/format.d.ts +1 -1
  38. package/dist/utils/format.d.ts.map +1 -1
  39. package/package.json +13 -7
  40. package/src/cli/actions.ts +162 -0
  41. package/src/cli/commands/active-deployments.ts +24 -0
  42. package/src/cli/commands/build-logs.ts +25 -22
  43. package/src/cli/commands/cancel-deploy.ts +35 -0
  44. package/src/cli/commands/config.ts +53 -47
  45. package/src/cli/commands/create.ts +74 -53
  46. package/src/cli/commands/databases.ts +63 -0
  47. package/src/cli/commands/db.ts +68 -0
  48. package/src/cli/commands/delete.ts +41 -29
  49. package/src/cli/commands/deploy.ts +42 -21
  50. package/src/cli/commands/deployments.ts +41 -31
  51. package/src/cli/commands/destinations.ts +19 -27
  52. package/src/cli/commands/diagnose.ts +139 -0
  53. package/src/cli/commands/env.ts +66 -41
  54. package/src/cli/commands/environments.ts +36 -32
  55. package/src/cli/commands/exec.ts +39 -0
  56. package/src/cli/commands/keys.ts +46 -0
  57. package/src/cli/commands/list.ts +29 -27
  58. package/src/cli/commands/logs.ts +33 -18
  59. package/src/cli/commands/network.ts +145 -0
  60. package/src/cli/commands/projects.ts +51 -39
  61. package/src/cli/commands/restart.ts +34 -18
  62. package/src/cli/commands/server-resources.ts +71 -0
  63. package/src/cli/commands/servers.ts +23 -23
  64. package/src/cli/commands/service-logs.ts +24 -16
  65. package/src/cli/commands/services.ts +63 -0
  66. package/src/cli/commands/show.ts +72 -41
  67. package/src/cli/commands/start.ts +34 -18
  68. package/src/cli/commands/stop.ts +34 -18
  69. package/src/cli/commands/svc.ts +68 -0
  70. package/src/cli/commands/teams.ts +60 -0
  71. package/src/cli/commands/update.ts +73 -49
  72. package/src/cli/commands/version.ts +37 -0
  73. package/src/cli/coolify-state.ts +88 -0
  74. package/src/cli/index.ts +383 -151
  75. package/src/coolify/config.ts +29 -27
  76. package/src/coolify/index.ts +1829 -123
  77. package/src/coolify/types.ts +217 -124
  78. package/src/index.ts +82 -868
  79. package/src/network.ts +298 -0
  80. package/src/sdk.ts +597 -0
  81. package/src/server/index.ts +13 -0
  82. package/src/server/sse.ts +33 -25
  83. package/src/server/stdio.ts +24 -27
  84. package/src/tools/definitions.ts +893 -264
  85. package/src/tools/handlers.ts +556 -748
  86. package/src/tools/index.ts +8 -0
  87. package/src/trace.ts +116 -0
  88. 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 '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
-
32
- const program = new Command()
33
-
34
- program
35
- .name('coolify-mcp')
36
- .description('CLI for Coolify deployment management')
37
- .version('0.1.0')
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('create')
42
- .description('Create a new application')
43
- .option('--name <name>', 'Application name')
44
- .option('--description <desc>', 'Application description')
45
- .option('--server <uuid>', 'Server UUID')
46
- .option('--project <uuid>', 'Project UUID')
47
- .option('--environment <uuid>', 'Environment UUID (auto-fetched if not provided)')
48
- .option('--repo <url>', 'Git repository URL')
49
- .option('--branch <branch>', 'Git branch', 'main')
50
- .option('--type <type>', 'Application type (public, private-github-app, private-deploy-key, dockerfile, docker-image, docker-compose)', 'public')
51
- .option('--build-pack <pack>', 'Build pack (dockerfile, nixpacks, static, dockercompose)', 'dockerfile')
52
- .option('--ports <ports>', 'Ports to expose (default: 3000)', '3000')
53
- .option('--docker-image <image>', 'Docker image (for docker-image type)')
54
- .option('--docker-compose <content>', 'Docker Compose content (for docker-compose type)')
55
- .option('--docker-compose-location <path>', 'Docker Compose file path (for dockercompose buildPack, e.g., "docker-compose.yml")')
56
- .option('--dockerfile-location <path>', 'Dockerfile location (e.g., "apps/haidodocs/Dockerfile")')
57
- .option('--base-directory <dir>', 'Base directory for build context (default: "/")', '/')
58
- .action(createCommand)
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('config')
63
- .description('Manage configuration')
64
- .argument('[action]', 'Action to perform (set, get, path)')
65
- .option('--key <key>', 'Configuration key (for "set" action)')
66
- .option('--value <value>', 'Configuration value (for "set" action)')
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('list')
72
- .description('List all applications')
73
- .option('-t, --team <id>', 'Filter by team ID')
74
- .option('-p, --project <id>', 'Filter by project ID')
75
- .option('--full', 'Show full UUIDs instead of truncated')
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('deploy <uuid>')
81
- .description('Deploy an application')
82
- .option('-f, --force', 'Force rebuild without cache')
83
- .option('-t, --tag <tag>', 'Deploy specific tag/version')
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('logs <uuid>')
89
- .description('Get application logs')
90
- .option('-n, --lines <number>', 'Number of lines to retrieve', '50')
91
- .option('-f, --follow', 'Follow logs in real-time')
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('servers')
100
- .description('List available servers')
101
- .option('--full', 'Show full UUIDs instead of truncated')
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('projects')
107
- .description('List or create projects')
108
- .option('--full', 'Show full UUIDs instead of truncated')
109
- .option('--create <name>', 'Create a new project with this name')
110
- .option('--description <desc>', 'Project description (use with --create)')
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('environments <projectUuid>')
116
- .description('List environments for a project')
117
- .option('--full', 'Show full UUIDs instead of truncated')
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('env <uuid>')
123
- .description('Manage environment variables for an application')
124
- .option('--set <KEY=VALUE>', 'Set an environment variable')
125
- .option('--delete <KEY>', 'Delete an environment variable')
126
- .option('--buildtime', 'Mark variable as build-time only (use with --set)')
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('update <uuid>')
132
- .description('Update an application configuration')
133
- .option('--name <name>', 'Application name')
134
- .option('--description <desc>', 'Application description')
135
- .option('--build-pack <pack>', 'Build pack (dockerfile, nixpacks, static)')
136
- .option('--git-branch <branch>', 'Git branch')
137
- .option('--ports <ports>', 'Ports to expose (e.g., 3000)')
138
- .option('--install-command <cmd>', 'Install command (nixpacks)')
139
- .option('--build-command <cmd>', 'Build command')
140
- .option('--start-command <cmd>', 'Start command')
141
- .option('--dockerfile-location <path>', 'Dockerfile location (e.g., "apps/haidodocs/Dockerfile")')
142
- .option('--base-directory <dir>', 'Base directory for build context (e.g., "/")')
143
- .option('--domains <domains>', 'Domains (comma-separated with protocol, e.g., "https://app.example.com")')
144
- .option('--auto-deploy', 'Enable auto-deploy on git push')
145
- .option('--no-auto-deploy', 'Disable auto-deploy on git push')
146
- .option('--force-https', 'Enable forced HTTPS redirect')
147
- .action((uuid, options) => updateCommand({ uuid, ...options }))
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('delete <uuid>')
152
- .description('Delete an application')
153
- .option('-f, --force', 'Skip confirmation prompt')
154
- .option('-y, --yes', 'Skip confirmation prompt (alias for --force)')
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('destinations <serverUuid>')
160
- .description('List available destinations for a server')
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('show <uuid>')
166
- .description('Show detailed information about an application')
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('deployments <uuid>')
172
- .description('Show deployment history for an application')
173
- .option('--full', 'Show full UUIDs')
174
- .option('-n, --limit <number>', 'Limit number of deployments shown', '10')
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('start <uuid>')
183
- .description('Start a stopped application')
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('stop <uuid>')
189
- .description('Stop a running application')
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('restart <uuid>')
195
- .description('Restart an application')
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('build-logs <deployment-uuid>')
201
- .description('View build/deployment logs for a specific deployment')
202
- .option('-n, --lines <number>', 'Number of lines to show (tail)')
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('service-logs <uuid> <service-name>')
211
- .description('View logs for a specific docker-compose service')
212
- .option('-n, --lines <number>', 'Number of lines to retrieve', '50')
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('Coolify MCP CLI'))
221
- console.log(chalk.gray('Manage Coolify deployments from the command line\n'))
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();