@mks2508/coolify-mks-cli-mcp 0.3.0 → 0.3.1
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/index.js
CHANGED
|
@@ -11708,6 +11708,7 @@ async function createCommand2(options) {
|
|
|
11708
11708
|
portsExposes: options.ports || "3000",
|
|
11709
11709
|
dockerImage: options.dockerImage,
|
|
11710
11710
|
dockerCompose: options.dockerCompose,
|
|
11711
|
+
dockerComposeLocation: options.dockerComposeLocation,
|
|
11711
11712
|
dockerfileLocation: options.dockerfileLocation,
|
|
11712
11713
|
baseDirectory: options.baseDirectory
|
|
11713
11714
|
}, (percent, message) => {
|
|
@@ -11902,6 +11903,18 @@ async function projectsCommand(options = {}) {
|
|
|
11902
11903
|
spinner.fail(source_default.red(`Failed to initialize: ${initResult.error.message}`));
|
|
11903
11904
|
return;
|
|
11904
11905
|
}
|
|
11906
|
+
if (options.create) {
|
|
11907
|
+
spinner.text = `Creating project "${options.create}"...`;
|
|
11908
|
+
const createResult = await coolify.createProject(options.create, options.description);
|
|
11909
|
+
if (isOk(createResult)) {
|
|
11910
|
+
spinner.succeed(source_default.green(`Project created: ${source_default.cyan(createResult.value.uuid)}`));
|
|
11911
|
+
console.log(` Name: ${source_default.cyan(options.create)}`);
|
|
11912
|
+
console.log(` UUID: ${source_default.cyan(createResult.value.uuid)}`);
|
|
11913
|
+
} else {
|
|
11914
|
+
spinner.fail(source_default.red(`Failed to create project: ${createResult.error.message}`));
|
|
11915
|
+
}
|
|
11916
|
+
return;
|
|
11917
|
+
}
|
|
11905
11918
|
spinner.text = "Fetching projects...";
|
|
11906
11919
|
const result = await coolify.listProjects();
|
|
11907
11920
|
if (isOk(result)) {
|
|
@@ -12138,6 +12151,12 @@ async function updateCommand(options) {
|
|
|
12138
12151
|
updateOptions.dockerfileLocation = options.dockerfileLocation;
|
|
12139
12152
|
if (options.baseDirectory)
|
|
12140
12153
|
updateOptions.baseDirectory = options.baseDirectory;
|
|
12154
|
+
if (options.domains)
|
|
12155
|
+
updateOptions.domains = options.domains;
|
|
12156
|
+
if (options.autoDeploy !== undefined)
|
|
12157
|
+
updateOptions.isAutoDeployEnabled = options.autoDeploy;
|
|
12158
|
+
if (options.forceHttps)
|
|
12159
|
+
updateOptions.isForceHttpsEnabled = true;
|
|
12141
12160
|
if (Object.keys(updateOptions).length === 0) {
|
|
12142
12161
|
console.warn(source_default.yellow("No update options provided. Use --help to see available options."));
|
|
12143
12162
|
process.exit(0);
|
|
@@ -12334,7 +12353,7 @@ async function deploymentsCommand(uuid, options = {}) {
|
|
|
12334
12353
|
// src/cli/index.ts
|
|
12335
12354
|
var program2 = new Command;
|
|
12336
12355
|
program2.name("coolify-mcp").description("CLI for Coolify deployment management").version("0.1.0");
|
|
12337
|
-
program2.command("create").description("Create a new application").option("--name <name>", "Application name").option("--description <desc>", "Application description").option("--server <uuid>", "Server UUID").option("--project <uuid>", "Project UUID").option("--environment <uuid>", "Environment UUID (auto-fetched if not provided)").option("--repo <url>", "Git repository URL").option("--branch <branch>", "Git branch", "main").option("--type <type>", "Application type (public, private-github-app, private-deploy-key, dockerfile, docker-image, docker-compose)", "public").option("--build-pack <pack>", "Build pack (dockerfile, nixpacks, static)", "dockerfile").option("--ports <ports>", "Ports to expose (default: 3000)", "3000").option("--docker-image <image>", "Docker image (for docker-image type)").option("--docker-compose <content>", "Docker Compose content (for docker-compose type)").option("--dockerfile-location <path>", 'Dockerfile location (e.g., "apps/haidodocs/Dockerfile")').option("--base-directory <dir>", 'Base directory for build context (default: "/")', "/").action(createCommand2);
|
|
12356
|
+
program2.command("create").description("Create a new application").option("--name <name>", "Application name").option("--description <desc>", "Application description").option("--server <uuid>", "Server UUID").option("--project <uuid>", "Project UUID").option("--environment <uuid>", "Environment UUID (auto-fetched if not provided)").option("--repo <url>", "Git repository URL").option("--branch <branch>", "Git branch", "main").option("--type <type>", "Application type (public, private-github-app, private-deploy-key, dockerfile, docker-image, docker-compose)", "public").option("--build-pack <pack>", "Build pack (dockerfile, nixpacks, static, dockercompose)", "dockerfile").option("--ports <ports>", "Ports to expose (default: 3000)", "3000").option("--docker-image <image>", "Docker image (for docker-image type)").option("--docker-compose <content>", "Docker Compose content (for docker-compose type)").option("--docker-compose-location <path>", 'Docker Compose file path (for dockercompose buildPack, e.g., "docker-compose.yml")').option("--dockerfile-location <path>", 'Dockerfile location (e.g., "apps/haidodocs/Dockerfile")').option("--base-directory <dir>", 'Base directory for build context (default: "/")', "/").action(createCommand2);
|
|
12338
12357
|
program2.command("config").description("Manage configuration").argument("[action]", "Action to perform (set, get, path)").option("--key <key>", 'Configuration key (for "set" action)').option("--value <value>", 'Configuration value (for "set" action)').action(configCommand);
|
|
12339
12358
|
program2.command("list").description("List all applications").option("-t, --team <id>", "Filter by team ID").option("-p, --project <id>", "Filter by project ID").option("--full", "Show full UUIDs instead of truncated").action(listCommand);
|
|
12340
12359
|
program2.command("deploy <uuid>").description("Deploy an application").option("-f, --force", "Force rebuild without cache").option("-t, --tag <tag>", "Deploy specific tag/version").action(deployCommand);
|
|
@@ -12343,10 +12362,10 @@ program2.command("logs <uuid>").description("Get application logs").option("-n,
|
|
|
12343
12362
|
logsCommand(uuid, { lines, follow: options.follow });
|
|
12344
12363
|
});
|
|
12345
12364
|
program2.command("servers").description("List available servers").option("--full", "Show full UUIDs instead of truncated").action((options) => serversCommand(options));
|
|
12346
|
-
program2.command("projects").description("List
|
|
12365
|
+
program2.command("projects").description("List or create projects").option("--full", "Show full UUIDs instead of truncated").option("--create <name>", "Create a new project with this name").option("--description <desc>", "Project description (use with --create)").action((options) => projectsCommand(options));
|
|
12347
12366
|
program2.command("environments <projectUuid>").description("List environments for a project").option("--full", "Show full UUIDs instead of truncated").action((projectUuid, options) => environmentsCommand(projectUuid, options));
|
|
12348
12367
|
program2.command("env <uuid>").description("Manage environment variables for an application").option("--set <KEY=VALUE>", "Set an environment variable").option("--delete <KEY>", "Delete an environment variable").option("--buildtime", "Mark variable as build-time only (use with --set)").action((uuid, options) => envCommand(uuid, options));
|
|
12349
|
-
program2.command("update <uuid>").description("Update an application configuration").option("--name <name>", "Application name").option("--description <desc>", "Application description").option("--build-pack <pack>", "Build pack (dockerfile, nixpacks, static)").option("--git-branch <branch>", "Git branch").option("--ports <ports>", "Ports to expose (e.g., 3000)").option("--install-command <cmd>", "Install command (nixpacks)").option("--build-command <cmd>", "Build command").option("--start-command <cmd>", "Start command").option("--dockerfile-location <path>", 'Dockerfile location (e.g., "apps/haidodocs/Dockerfile")').option("--base-directory <dir>", 'Base directory for build context (e.g., "/")').action((uuid, options) => updateCommand({ uuid, ...options }));
|
|
12368
|
+
program2.command("update <uuid>").description("Update an application configuration").option("--name <name>", "Application name").option("--description <desc>", "Application description").option("--build-pack <pack>", "Build pack (dockerfile, nixpacks, static)").option("--git-branch <branch>", "Git branch").option("--ports <ports>", "Ports to expose (e.g., 3000)").option("--install-command <cmd>", "Install command (nixpacks)").option("--build-command <cmd>", "Build command").option("--start-command <cmd>", "Start command").option("--dockerfile-location <path>", 'Dockerfile location (e.g., "apps/haidodocs/Dockerfile")').option("--base-directory <dir>", 'Base directory for build context (e.g., "/")').option("--domains <domains>", 'Domains (comma-separated with protocol, e.g., "https://app.example.com")').option("--auto-deploy", "Enable auto-deploy on git push").option("--no-auto-deploy", "Disable auto-deploy on git push").option("--force-https", "Enable forced HTTPS redirect").action((uuid, options) => updateCommand({ uuid, ...options }));
|
|
12350
12369
|
program2.command("delete <uuid>").description("Delete an application").option("-f, --force", "Skip confirmation prompt").option("-y, --yes", "Skip confirmation prompt (alias for --force)").action((uuid, options) => deleteCommand(uuid, options));
|
|
12351
12370
|
program2.command("destinations <serverUuid>").description("List available destinations for a server").action(destinationsCommand);
|
|
12352
12371
|
program2.command("show <uuid>").description("Show detailed information about an application").action(showCommand);
|
package/package.json
CHANGED
|
@@ -21,10 +21,11 @@ interface ICreateOptions {
|
|
|
21
21
|
repo?: string
|
|
22
22
|
branch?: string
|
|
23
23
|
type?: 'public' | 'private-github-app' | 'private-deploy-key' | 'dockerfile' | 'docker-image' | 'docker-compose'
|
|
24
|
-
buildPack?: 'dockerfile' | 'nixpacks' | 'static'
|
|
24
|
+
buildPack?: 'dockerfile' | 'nixpacks' | 'static' | 'dockercompose'
|
|
25
25
|
ports?: string
|
|
26
26
|
dockerImage?: string
|
|
27
27
|
dockerCompose?: string
|
|
28
|
+
dockerComposeLocation?: string
|
|
28
29
|
dockerfileLocation?: string
|
|
29
30
|
baseDirectory?: string
|
|
30
31
|
}
|
|
@@ -87,6 +88,7 @@ export async function createCommand(options: ICreateOptions) {
|
|
|
87
88
|
portsExposes: options.ports || '3000',
|
|
88
89
|
dockerImage: options.dockerImage,
|
|
89
90
|
dockerCompose: options.dockerCompose,
|
|
91
|
+
dockerComposeLocation: options.dockerComposeLocation,
|
|
90
92
|
dockerfileLocation: options.dockerfileLocation,
|
|
91
93
|
baseDirectory: options.baseDirectory,
|
|
92
94
|
},
|
|
@@ -12,8 +12,9 @@ import { getCoolifyService } from '../../coolify/index.js'
|
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* Projects command handler.
|
|
15
|
+
* Lists all projects, or creates a new one if --create is provided.
|
|
15
16
|
*/
|
|
16
|
-
export async function projectsCommand(options: { full?: boolean } = {}) {
|
|
17
|
+
export async function projectsCommand(options: { full?: boolean; create?: string; description?: string } = {}) {
|
|
17
18
|
const spinner = ora('Connecting to Coolify...').start()
|
|
18
19
|
|
|
19
20
|
try {
|
|
@@ -25,6 +26,22 @@ export async function projectsCommand(options: { full?: boolean } = {}) {
|
|
|
25
26
|
return
|
|
26
27
|
}
|
|
27
28
|
|
|
29
|
+
// Create mode
|
|
30
|
+
if (options.create) {
|
|
31
|
+
spinner.text = `Creating project "${options.create}"...`
|
|
32
|
+
const createResult = await coolify.createProject(options.create, options.description)
|
|
33
|
+
|
|
34
|
+
if (isOk(createResult)) {
|
|
35
|
+
spinner.succeed(chalk.green(`Project created: ${chalk.cyan(createResult.value.uuid)}`))
|
|
36
|
+
console.log(` Name: ${chalk.cyan(options.create)}`)
|
|
37
|
+
console.log(` UUID: ${chalk.cyan(createResult.value.uuid)}`)
|
|
38
|
+
} else {
|
|
39
|
+
spinner.fail(chalk.red(`Failed to create project: ${createResult.error.message}`))
|
|
40
|
+
}
|
|
41
|
+
return
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
// List mode
|
|
28
45
|
spinner.text = 'Fetching projects...'
|
|
29
46
|
|
|
30
47
|
const result = await coolify.listProjects()
|
|
@@ -26,6 +26,9 @@ interface IUpdateCommandOptions {
|
|
|
26
26
|
startCommand?: string
|
|
27
27
|
dockerfileLocation?: string
|
|
28
28
|
baseDirectory?: string
|
|
29
|
+
domains?: string
|
|
30
|
+
autoDeploy?: boolean
|
|
31
|
+
forceHttps?: boolean
|
|
29
32
|
}
|
|
30
33
|
|
|
31
34
|
/**
|
|
@@ -49,7 +52,7 @@ export async function updateCommand(options: IUpdateCommandOptions): Promise<voi
|
|
|
49
52
|
|
|
50
53
|
if (options.name) updateOptions.name = options.name
|
|
51
54
|
if (options.description) updateOptions.description = options.description
|
|
52
|
-
if (options.buildPack) updateOptions.buildPack = options.buildPack as 'dockerfile' | 'nixpacks' | 'static'
|
|
55
|
+
if (options.buildPack) updateOptions.buildPack = options.buildPack as 'dockerfile' | 'nixpacks' | 'static' | 'dockercompose'
|
|
53
56
|
if (options.gitBranch) updateOptions.gitBranch = options.gitBranch
|
|
54
57
|
if (options.ports) updateOptions.portsExposes = options.ports
|
|
55
58
|
if (options.installCommand) updateOptions.installCommand = options.installCommand
|
|
@@ -57,6 +60,9 @@ export async function updateCommand(options: IUpdateCommandOptions): Promise<voi
|
|
|
57
60
|
if (options.startCommand) updateOptions.startCommand = options.startCommand
|
|
58
61
|
if (options.dockerfileLocation) updateOptions.dockerfileLocation = options.dockerfileLocation
|
|
59
62
|
if (options.baseDirectory) updateOptions.baseDirectory = options.baseDirectory
|
|
63
|
+
if (options.domains) updateOptions.domains = options.domains
|
|
64
|
+
if (options.autoDeploy !== undefined) updateOptions.isAutoDeployEnabled = options.autoDeploy
|
|
65
|
+
if (options.forceHttps) updateOptions.isForceHttpsEnabled = true
|
|
60
66
|
|
|
61
67
|
if (Object.keys(updateOptions).length === 0) {
|
|
62
68
|
console.warn(chalk.yellow('No update options provided. Use --help to see available options.'))
|
package/src/cli/index.ts
CHANGED
|
@@ -43,10 +43,11 @@ program
|
|
|
43
43
|
.option('--repo <url>', 'Git repository URL')
|
|
44
44
|
.option('--branch <branch>', 'Git branch', 'main')
|
|
45
45
|
.option('--type <type>', 'Application type (public, private-github-app, private-deploy-key, dockerfile, docker-image, docker-compose)', 'public')
|
|
46
|
-
.option('--build-pack <pack>', 'Build pack (dockerfile, nixpacks, static)', 'dockerfile')
|
|
46
|
+
.option('--build-pack <pack>', 'Build pack (dockerfile, nixpacks, static, dockercompose)', 'dockerfile')
|
|
47
47
|
.option('--ports <ports>', 'Ports to expose (default: 3000)', '3000')
|
|
48
48
|
.option('--docker-image <image>', 'Docker image (for docker-image type)')
|
|
49
49
|
.option('--docker-compose <content>', 'Docker Compose content (for docker-compose type)')
|
|
50
|
+
.option('--docker-compose-location <path>', 'Docker Compose file path (for dockercompose buildPack, e.g., "docker-compose.yml")')
|
|
50
51
|
.option('--dockerfile-location <path>', 'Dockerfile location (e.g., "apps/haidodocs/Dockerfile")')
|
|
51
52
|
.option('--base-directory <dir>', 'Base directory for build context (default: "/")', '/')
|
|
52
53
|
.action(createCommand)
|
|
@@ -98,8 +99,10 @@ program
|
|
|
98
99
|
// Projects command
|
|
99
100
|
program
|
|
100
101
|
.command('projects')
|
|
101
|
-
.description('List
|
|
102
|
+
.description('List or create projects')
|
|
102
103
|
.option('--full', 'Show full UUIDs instead of truncated')
|
|
104
|
+
.option('--create <name>', 'Create a new project with this name')
|
|
105
|
+
.option('--description <desc>', 'Project description (use with --create)')
|
|
103
106
|
.action((options) => projectsCommand(options))
|
|
104
107
|
|
|
105
108
|
// Environments command
|
|
@@ -132,6 +135,10 @@ program
|
|
|
132
135
|
.option('--start-command <cmd>', 'Start command')
|
|
133
136
|
.option('--dockerfile-location <path>', 'Dockerfile location (e.g., "apps/haidodocs/Dockerfile")')
|
|
134
137
|
.option('--base-directory <dir>', 'Base directory for build context (e.g., "/")')
|
|
138
|
+
.option('--domains <domains>', 'Domains (comma-separated with protocol, e.g., "https://app.example.com")')
|
|
139
|
+
.option('--auto-deploy', 'Enable auto-deploy on git push')
|
|
140
|
+
.option('--no-auto-deploy', 'Disable auto-deploy on git push')
|
|
141
|
+
.option('--force-https', 'Enable forced HTTPS redirect')
|
|
135
142
|
.action((uuid, options) => updateCommand({ uuid, ...options }))
|
|
136
143
|
|
|
137
144
|
// Delete application
|