@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.
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 +58 -0
  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 +60 -0
  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 +59 -0
  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 +60 -0
  68. package/src/cli/commands/stop.ts +60 -0
  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 +400 -125
  75. package/src/coolify/config.ts +29 -27
  76. package/src/coolify/index.ts +2221 -371
  77. package/src/coolify/types.ts +218 -123
  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
@@ -12,66 +12,66 @@
12
12
  */
13
13
  export interface ICoolifyDeployOptions {
14
14
  /** Application UUID */
15
- uuid?: string
15
+ uuid?: string;
16
16
  /** Application tag */
17
- tag?: string
17
+ tag?: string;
18
18
  /** Force rebuild without cache */
19
- force?: boolean
19
+ force?: boolean;
20
20
  /** Progress callback for deployment status updates */
21
- onProgress?: IProgressCallback
21
+ onProgress?: IProgressCallback;
22
22
  }
23
23
 
24
24
  /**
25
25
  * Application types supported by Coolify.
26
26
  */
27
27
  export type TCoolifyApplicationType =
28
- | 'public'
29
- | 'private-github-app'
30
- | 'private-deploy-key'
31
- | 'dockerfile'
32
- | 'docker-image'
33
- | 'docker-compose'
28
+ | "public"
29
+ | "private-github-app"
30
+ | "private-deploy-key"
31
+ | "dockerfile"
32
+ | "docker-image"
33
+ | "docker-compose";
34
34
 
35
35
  /**
36
36
  * Options for creating a Coolify application.
37
37
  */
38
38
  export interface ICoolifyAppOptions {
39
39
  /** Application name */
40
- name: string
40
+ name: string;
41
41
  /** Application description */
42
- description?: string
42
+ description?: string;
43
43
  /** Project UUID */
44
- projectUuid: string
44
+ projectUuid: string;
45
45
  /** Environment UUID */
46
- environmentUuid: string
46
+ environmentUuid: string;
47
47
  /** Server UUID */
48
- serverUuid: string
48
+ serverUuid: string;
49
49
  /** Destination UUID (optional, for specific destination targeting) */
50
- destinationUuid?: string
50
+ destinationUuid?: string;
51
51
  /** Application type */
52
- type?: TCoolifyApplicationType
52
+ type?: TCoolifyApplicationType;
53
53
  /** GitHub App UUID (required for private-github-app type — get from listGithubApps) */
54
- githubAppUuid?: string
54
+ githubAppUuid?: string;
55
55
  /** GitHub repository URL (for git-based apps) */
56
- githubRepoUrl?: string
56
+ githubRepoUrl?: string;
57
57
  /** Git branch */
58
- branch?: string
58
+ branch?: string;
59
59
  /** Build pack type */
60
- buildPack?: 'dockerfile' | 'nixpacks' | 'static' | 'dockercompose'
60
+ buildPack?: "dockerfile" | "nixpacks" | "static" | "dockercompose";
61
61
  /** Ports to expose */
62
- portsExposes?: string
62
+ portsExposes?: string;
63
63
  /** Docker image (for docker-image type) */
64
- dockerImage?: string
64
+ dockerImage?: string;
65
65
  /** Docker Compose content (for docker-compose type) */
66
- dockerCompose?: string
66
+ dockerCompose?: string;
67
67
  /** Docker Compose file location relative to repo root (for dockercompose buildPack) */
68
- dockerComposeLocation?: string
68
+ dockerComposeLocation?: string;
69
69
  /** Environment variables */
70
- envVars?: Record<string, string>
70
+ envVars?: Record<string, string>;
71
71
  /** Dockerfile location (path relative to repo root, e.g., "apps/haidodocs/Dockerfile") */
72
- dockerfileLocation?: string
72
+ dockerfileLocation?: string;
73
73
  /** Base directory for build context (default: "/") */
74
- baseDirectory?: string
74
+ baseDirectory?: string;
75
75
  }
76
76
 
77
77
  /**
@@ -79,33 +79,33 @@ export interface ICoolifyAppOptions {
79
79
  */
80
80
  export interface ICoolifyUpdateOptions {
81
81
  /** Application name */
82
- name?: string
82
+ name?: string;
83
83
  /** Application description */
84
- description?: string
84
+ description?: string;
85
85
  /** Build pack type */
86
- buildPack?: 'dockerfile' | 'nixpacks' | 'static' | 'dockercompose'
86
+ buildPack?: "dockerfile" | "nixpacks" | "static" | "dockercompose";
87
87
  /** Git branch */
88
- gitBranch?: string
88
+ gitBranch?: string;
89
89
  /** Ports to expose */
90
- portsExposes?: string
90
+ portsExposes?: string;
91
91
  /** Install command (nixpacks) */
92
- installCommand?: string
92
+ installCommand?: string;
93
93
  /** Build command */
94
- buildCommand?: string
94
+ buildCommand?: string;
95
95
  /** Start command */
96
- startCommand?: string
96
+ startCommand?: string;
97
97
  /** Dockerfile location (path relative to repo root, e.g., "apps/haidodocs/Dockerfile") */
98
- dockerfileLocation?: string
98
+ dockerfileLocation?: string;
99
99
  /** Base directory for build context (default: "/") */
100
- baseDirectory?: string
100
+ baseDirectory?: string;
101
101
  /** Domains/FQDN - comma separated list of domains with protocol (e.g., "https://app.example.com") — NOT for dockercompose apps */
102
- domains?: string
102
+ domains?: string;
103
103
  /** Docker Compose domains - JSON object: { "service-name": { "domain": "https://..." } } — for dockercompose apps */
104
- dockerComposeDomains?: string
104
+ dockerComposeDomains?: string;
105
105
  /** Force HTTPS redirect */
106
- isForceHttpsEnabled?: boolean
106
+ isForceHttpsEnabled?: boolean;
107
107
  /** Enable auto deploy on git push */
108
- isAutoDeployEnabled?: boolean
108
+ isAutoDeployEnabled?: boolean;
109
109
  }
110
110
 
111
111
  /**
@@ -113,9 +113,11 @@ export interface ICoolifyUpdateOptions {
113
113
  */
114
114
  export interface ICoolifyLogsOptions {
115
115
  /** Follow logs in real-time */
116
- follow?: boolean
116
+ follow?: boolean;
117
117
  /** Number of lines to retrieve */
118
- tail?: number
118
+ tail?: number;
119
+ /** Service name for docker-compose apps */
120
+ serviceName?: string;
119
121
  }
120
122
 
121
123
  /**
@@ -123,13 +125,13 @@ export interface ICoolifyLogsOptions {
123
125
  */
124
126
  export interface ICoolifyDeployResult {
125
127
  /** Whether the deployment started successfully */
126
- success: boolean
128
+ success: boolean;
127
129
  /** Deployment UUID */
128
- deploymentUuid?: string
130
+ deploymentUuid?: string;
129
131
  /** Resource UUID */
130
- resourceUuid?: string
132
+ resourceUuid?: string;
131
133
  /** Error message if failed */
132
- error?: string
134
+ error?: string;
133
135
  }
134
136
 
135
137
  /**
@@ -137,11 +139,11 @@ export interface ICoolifyDeployResult {
137
139
  */
138
140
  export interface ICoolifyAppResult {
139
141
  /** Whether the application was created */
140
- success: boolean
142
+ success: boolean;
141
143
  /** Application UUID */
142
- uuid?: string
144
+ uuid?: string;
143
145
  /** Error message if failed */
144
- error?: string
146
+ error?: string;
145
147
  }
146
148
 
147
149
  /**
@@ -149,9 +151,9 @@ export interface ICoolifyAppResult {
149
151
  */
150
152
  export interface ICoolifyDeleteResult {
151
153
  /** Whether the deletion was successful */
152
- success: boolean
154
+ success: boolean;
153
155
  /** Optional message */
154
- message?: string
156
+ message?: string;
155
157
  }
156
158
 
157
159
  /**
@@ -159,9 +161,9 @@ export interface ICoolifyDeleteResult {
159
161
  */
160
162
  export interface ICoolifyLogs {
161
163
  /** Log lines */
162
- logs: string[]
164
+ logs: string[];
163
165
  /** Timestamp of log retrieval */
164
- timestamp: string
166
+ timestamp: string;
165
167
  }
166
168
 
167
169
  /**
@@ -169,27 +171,27 @@ export interface ICoolifyLogs {
169
171
  */
170
172
  export interface ICoolifyDeployment {
171
173
  /** Deployment ID */
172
- id: number
174
+ id: number;
173
175
  /** Deployment UUID */
174
- uuid: string
176
+ uuid: string;
175
177
  /** Deployment status */
176
- status: string
178
+ status: string;
177
179
  /** Application ID */
178
- application_id?: number
180
+ application_id?: number;
179
181
  /** Pull request ID if applicable */
180
- pull_request_id?: number | null
182
+ pull_request_id?: number | null;
181
183
  /** Force rebuild flag */
182
- force_rebuild?: boolean
184
+ force_rebuild?: boolean;
183
185
  /** Commit hash */
184
- commit?: string | null
186
+ commit?: string | null;
185
187
  /** Rollback flag */
186
- rollback?: boolean
188
+ rollback?: boolean;
187
189
  /** Commit message */
188
- commit_message?: string | null
190
+ commit_message?: string | null;
189
191
  /** Creation timestamp */
190
- created_at: string
192
+ created_at: string;
191
193
  /** Update timestamp */
192
- updated_at: string
194
+ updated_at: string;
193
195
  }
194
196
 
195
197
  /**
@@ -197,53 +199,53 @@ export interface ICoolifyDeployment {
197
199
  */
198
200
  export interface ICoolifyApplication {
199
201
  /** Application UUID */
200
- uuid: string
202
+ uuid: string;
201
203
  /** Application name */
202
- name: string
204
+ name: string;
203
205
  /** Application description */
204
- description?: string | null
206
+ description?: string | null;
205
207
  /** Current status (e.g., "running:unknown", "stopped") */
206
- status: string
208
+ status: string;
207
209
  /** FQDN if configured */
208
- fqdn?: string | null
210
+ fqdn?: string | null;
209
211
  /** Git repository (e.g., "MKS2508/repo-name") */
210
- git_repository?: string | null
212
+ git_repository?: string | null;
211
213
  /** Git branch */
212
- git_branch?: string | null
214
+ git_branch?: string | null;
213
215
  /** Full git URL */
214
- git_full_url?: string | null
216
+ git_full_url?: string | null;
215
217
  /** Build pack type */
216
- build_pack?: string | null
218
+ build_pack?: string | null;
217
219
  /** Ports exposed */
218
- ports_exposes?: string | null
220
+ ports_exposes?: string | null;
219
221
  /** Dockerfile location */
220
- dockerfile_location?: string | null
222
+ dockerfile_location?: string | null;
221
223
  /** Base directory */
222
- base_directory?: string | null
224
+ base_directory?: string | null;
223
225
  /** Server status (boolean) */
224
- server_status?: boolean
226
+ server_status?: boolean;
225
227
  /** Environment ID */
226
- environment_id?: number
228
+ environment_id?: number;
227
229
  /** Destination info */
228
230
  destination?: {
229
- uuid: string
230
- name: string
231
+ uuid: string;
232
+ name: string;
231
233
  server?: {
232
- uuid: string
233
- name: string
234
- ip: string
235
- }
236
- } | null
234
+ uuid: string;
235
+ name: string;
236
+ ip: string;
237
+ };
238
+ } | null;
237
239
  /** Install command */
238
- install_command?: string | null
240
+ install_command?: string | null;
239
241
  /** Build command */
240
- build_command?: string | null
242
+ build_command?: string | null;
241
243
  /** Start command */
242
- start_command?: string | null
244
+ start_command?: string | null;
243
245
  /** Creation timestamp */
244
- created_at?: string
246
+ created_at?: string;
245
247
  /** Update timestamp */
246
- updated_at?: string
248
+ updated_at?: string;
247
249
  }
248
250
 
249
251
  /**
@@ -251,27 +253,27 @@ export interface ICoolifyApplication {
251
253
  */
252
254
  export interface ICoolifyServer {
253
255
  /** Server UUID */
254
- uuid: string
256
+ uuid: string;
255
257
  /** Server name */
256
- name: string
258
+ name: string;
257
259
  /** Server description */
258
- description?: string | null
260
+ description?: string | null;
259
261
  /** Server IP address */
260
- ip?: string
262
+ ip?: string;
261
263
  /** SSH port */
262
- port?: number
264
+ port?: number;
263
265
  /** Whether this is the Coolify host */
264
- is_coolify_host?: boolean
266
+ is_coolify_host?: boolean;
265
267
  /** Whether server is reachable */
266
- is_reachable?: boolean
268
+ is_reachable?: boolean;
267
269
  /** Whether server is usable */
268
- is_usable?: boolean
270
+ is_usable?: boolean;
269
271
  /** Proxy configuration */
270
272
  proxy?: {
271
- redirect_enabled?: boolean
272
- } | null
273
+ redirect_enabled?: boolean;
274
+ } | null;
273
275
  /** Server settings */
274
- settings?: Record<string, unknown> | null
276
+ settings?: Record<string, unknown> | null;
275
277
  }
276
278
 
277
279
  /**
@@ -279,13 +281,13 @@ export interface ICoolifyServer {
279
281
  */
280
282
  export interface ICoolifyDestination {
281
283
  /** Destination UUID */
282
- uuid: string
284
+ uuid: string;
283
285
  /** Destination name */
284
- name: string
286
+ name: string;
285
287
  /** Network name */
286
- network?: string
288
+ network?: string;
287
289
  /** Server UUID */
288
- server_uuid?: string
290
+ server_uuid?: string;
289
291
  }
290
292
 
291
293
  /**
@@ -293,13 +295,13 @@ export interface ICoolifyDestination {
293
295
  */
294
296
  export interface ICoolifyProject {
295
297
  /** Project UUID */
296
- uuid: string
298
+ uuid: string;
297
299
  /** Project name */
298
- name: string
300
+ name: string;
299
301
  /** Project description */
300
- description?: string | null
302
+ description?: string | null;
301
303
  /** Environments in this project */
302
- environments?: ICoolifyEnvironment[]
304
+ environments?: ICoolifyEnvironment[];
303
305
  }
304
306
 
305
307
  /**
@@ -307,19 +309,19 @@ export interface ICoolifyProject {
307
309
  */
308
310
  export interface ICoolifyEnvironment {
309
311
  /** Environment UUID (needed for API calls) */
310
- uuid: string
312
+ uuid: string;
311
313
  /** Environment ID */
312
- id: number
314
+ id: number;
313
315
  /** Environment name */
314
- name: string
316
+ name: string;
315
317
  /** Environment description */
316
- description?: string | null
318
+ description?: string | null;
317
319
  /** Project ID */
318
- project_id: number
320
+ project_id: number;
319
321
  /** Creation timestamp */
320
- created_at?: string
322
+ created_at?: string;
321
323
  /** Update timestamp */
322
- updated_at?: string
324
+ updated_at?: string;
323
325
  }
324
326
 
325
327
  /**
@@ -327,13 +329,13 @@ export interface ICoolifyEnvironment {
327
329
  */
328
330
  export interface ICoolifyTeam {
329
331
  /** Team ID */
330
- id: number
332
+ id: number;
331
333
  /** Team name */
332
- name: string
334
+ name: string;
333
335
  /** Team description */
334
- description?: string | null
336
+ description?: string | null;
335
337
  /** Personal team flag */
336
- personal_team?: boolean
338
+ personal_team?: boolean;
337
339
  }
338
340
 
339
341
  /**
@@ -343,4 +345,97 @@ export interface ICoolifyTeam {
343
345
  * @param message - Progress message
344
346
  * @param step - Current step identifier
345
347
  */
346
- export type IProgressCallback = (percent: number, message: string, step?: string) => void
348
+ export type IProgressCallback = (
349
+ percent: number,
350
+ message: string,
351
+ step?: string,
352
+ ) => void;
353
+
354
+ /**
355
+ * Database details from API (snake_case).
356
+ */
357
+ export interface ICoolifyDatabase {
358
+ uuid: string;
359
+ name: string;
360
+ type: string;
361
+ status: string;
362
+ version?: string;
363
+ description?: string | null;
364
+ destination?: {
365
+ uuid: string;
366
+ name: string;
367
+ server?: {
368
+ uuid: string;
369
+ name: string;
370
+ ip: string;
371
+ };
372
+ } | null;
373
+ }
374
+
375
+ /**
376
+ * Service details from API (snake_case).
377
+ */
378
+ export interface ICoolifyService {
379
+ uuid: string;
380
+ name: string;
381
+ type: string;
382
+ status: string;
383
+ version?: string;
384
+ description?: string | null;
385
+ project_uuid?: string;
386
+ environment_uuid?: string;
387
+ server_uuid?: string;
388
+ }
389
+
390
+ /**
391
+ * Private key details from API (snake_case).
392
+ */
393
+ export interface ICoolifyPrivateKey {
394
+ uuid: string;
395
+ name: string;
396
+ private_key?: string;
397
+ is_git_related?: boolean;
398
+ created_at?: string;
399
+ updated_at?: string;
400
+ }
401
+
402
+ /**
403
+ * Database backup details from API (snake_case).
404
+ */
405
+ export interface ICoolifyDatabaseBackup {
406
+ uuid: string;
407
+ name: string;
408
+ status: string;
409
+ created_at: string;
410
+ finished_at?: string;
411
+ size?: number;
412
+ }
413
+
414
+ /**
415
+ * Server resource details from API.
416
+ */
417
+ export interface ICoolifyServerResource {
418
+ uuid: string;
419
+ name: string;
420
+ type: string;
421
+ status: string;
422
+ }
423
+
424
+ /**
425
+ * Server domain details from API.
426
+ */
427
+ export interface ICoolifyServerDomain {
428
+ uuid: string;
429
+ domain: string;
430
+ status: string;
431
+ force_https: boolean;
432
+ }
433
+
434
+ /**
435
+ * Coolify version info.
436
+ */
437
+ export interface ICoolifyVersion {
438
+ version: string;
439
+ latest_version?: string;
440
+ is_latest?: boolean;
441
+ }