@vibedhost/cli 1.0.3 → 1.0.5
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/index.js +212 -2
- package/package.json +1 -1
- package/src/index.ts +236 -2
package/dist/index.js
CHANGED
|
@@ -20,6 +20,12 @@ async function main() {
|
|
|
20
20
|
case "whoami":
|
|
21
21
|
await handleWhoami();
|
|
22
22
|
break;
|
|
23
|
+
case "token":
|
|
24
|
+
await handleToken();
|
|
25
|
+
break;
|
|
26
|
+
case "app":
|
|
27
|
+
await handleApp();
|
|
28
|
+
break;
|
|
23
29
|
case "deploy":
|
|
24
30
|
await handleDeploy();
|
|
25
31
|
break;
|
|
@@ -69,10 +75,12 @@ Commands:
|
|
|
69
75
|
login Authenticate this terminal with your VibedHost account
|
|
70
76
|
logout Disconnect active account credentials from this machine
|
|
71
77
|
whoami Display authenticated account and workspace inventory
|
|
78
|
+
token Display authenticated MCP API token and client configuration
|
|
79
|
+
app <create|list> Launch 1-Click catalog applications (WordPress, n8n, Ghost, etc.)
|
|
72
80
|
deploy [dir] Package and deploy local project to dedicated workspace
|
|
73
81
|
status [app] Check real-time application deployment and routing status
|
|
74
82
|
logs [app] Stream live application logs or container build output
|
|
75
|
-
db <create|list|link> Manage dedicated databases and link to applications
|
|
83
|
+
db <create|list|link|unlink> Manage dedicated databases and link to applications
|
|
76
84
|
env <get|set> Manage container environment variables
|
|
77
85
|
port set <port> Update container listening port (e.g. 3000, 8080)
|
|
78
86
|
|
|
@@ -934,7 +942,209 @@ async function handleDb() {
|
|
|
934
942
|
}
|
|
935
943
|
return;
|
|
936
944
|
}
|
|
937
|
-
|
|
945
|
+
// 4. DATABASE UNLINK
|
|
946
|
+
if (subCommand === "unlink") {
|
|
947
|
+
const targetAppName = (args[2] && !args[2].startsWith("--"))
|
|
948
|
+
? args[2]
|
|
949
|
+
: (projectConfig?.appName || (0, utils_1.inferAppName)(process.cwd()));
|
|
950
|
+
if (!targetAppName) {
|
|
951
|
+
console.error("Usage: vibed db unlink <application-name> (or npx @vibedhost/cli db unlink <application-name>)");
|
|
952
|
+
process.exit(1);
|
|
953
|
+
}
|
|
954
|
+
console.log(`Unlinking database from application '${targetAppName}'...`);
|
|
955
|
+
try {
|
|
956
|
+
const res = await fetch(`${utils_1.API_BASE_URL}/api/cli/db`, {
|
|
957
|
+
method: "POST",
|
|
958
|
+
headers: {
|
|
959
|
+
Authorization: `Bearer ${config.token}`,
|
|
960
|
+
"Content-Type": "application/json"
|
|
961
|
+
},
|
|
962
|
+
body: JSON.stringify({
|
|
963
|
+
action: "UNLINK_DB",
|
|
964
|
+
appName: targetAppName
|
|
965
|
+
})
|
|
966
|
+
});
|
|
967
|
+
const rawText = await res.text();
|
|
968
|
+
let data = {};
|
|
969
|
+
try {
|
|
970
|
+
data = JSON.parse(rawText);
|
|
971
|
+
}
|
|
972
|
+
catch {
|
|
973
|
+
throw new Error("Database unlink request is processing on the workspace.");
|
|
974
|
+
}
|
|
975
|
+
if (!res.ok || !data.success) {
|
|
976
|
+
console.error(`Unlink error: ${data.error || "Failed to unlink database."}`);
|
|
977
|
+
process.exit(1);
|
|
978
|
+
}
|
|
979
|
+
console.log(`\nSuccessfully unlinked database from '${data.appName}'!`);
|
|
980
|
+
console.log(`Database connection variables removed from container. Service restarted.\n`);
|
|
981
|
+
}
|
|
982
|
+
catch (err) {
|
|
983
|
+
console.error(`Connection error: ${err.message}`);
|
|
984
|
+
}
|
|
985
|
+
return;
|
|
986
|
+
}
|
|
987
|
+
console.log("Usage: vibed db [create|list|link|unlink] (or npx @vibedhost/cli db [create|list|link|unlink])");
|
|
988
|
+
}
|
|
989
|
+
async function handleToken() {
|
|
990
|
+
const config = (0, utils_1.readGlobalConfig)();
|
|
991
|
+
if (!config?.token) {
|
|
992
|
+
console.log("Not authenticated. Run 'vibed login' (or 'npx @vibedhost/cli login') to connect your account.");
|
|
993
|
+
return;
|
|
994
|
+
}
|
|
995
|
+
console.log("\nVibedHost Personal Access Token & MCP Configuration");
|
|
996
|
+
console.log("------------------------------------------------------------");
|
|
997
|
+
console.log(`Account: ${config.email || "Authenticated User"}`);
|
|
998
|
+
console.log(`Token: ${config.token}`);
|
|
999
|
+
console.log("\nAdd to Claude Code, Cursor, or ChatGPT MCP Settings (JSON):");
|
|
1000
|
+
console.log(JSON.stringify({
|
|
1001
|
+
mcpServers: {
|
|
1002
|
+
vibedhost: {
|
|
1003
|
+
url: `${utils_1.API_BASE_URL}/api/mcp`,
|
|
1004
|
+
headers: {
|
|
1005
|
+
Authorization: `Bearer ${config.token}`
|
|
1006
|
+
}
|
|
1007
|
+
}
|
|
1008
|
+
}
|
|
1009
|
+
}, null, 2));
|
|
1010
|
+
console.log("------------------------------------------------------------\n");
|
|
1011
|
+
}
|
|
1012
|
+
async function handleApp() {
|
|
1013
|
+
const config = (0, utils_1.readGlobalConfig)();
|
|
1014
|
+
if (!config?.token) {
|
|
1015
|
+
console.error("Not authenticated. Please run 'vibed login' (or 'npx @vibedhost/cli login') first.");
|
|
1016
|
+
process.exit(1);
|
|
1017
|
+
}
|
|
1018
|
+
const subCommand = args[1] || "list";
|
|
1019
|
+
const projectConfig = (0, utils_1.readProjectConfig)();
|
|
1020
|
+
// 1. APP LIST
|
|
1021
|
+
if (subCommand === "list") {
|
|
1022
|
+
try {
|
|
1023
|
+
const res = await fetch(`${utils_1.API_BASE_URL}/api/cli/workspaces`, {
|
|
1024
|
+
headers: { Authorization: `Bearer ${config.token}` }
|
|
1025
|
+
});
|
|
1026
|
+
const data = (await res.json());
|
|
1027
|
+
if (!res.ok) {
|
|
1028
|
+
console.error(`Error: ${data.error || "Failed to fetch applications."}`);
|
|
1029
|
+
process.exit(1);
|
|
1030
|
+
}
|
|
1031
|
+
console.log("\nActive Web Applications & Services:");
|
|
1032
|
+
console.log("------------------------------------------------------------");
|
|
1033
|
+
let totalAppCount = 0;
|
|
1034
|
+
(data.workspaces || []).forEach((ws) => {
|
|
1035
|
+
const webApps = (ws.apps || []).filter((a) => a.type !== "DATABASE");
|
|
1036
|
+
if (webApps.length > 0) {
|
|
1037
|
+
console.log(`Workspace: ${ws.name} (${ws.planName})`);
|
|
1038
|
+
webApps.forEach((a, idx) => {
|
|
1039
|
+
totalAppCount++;
|
|
1040
|
+
const urlStr = a.domain ? `https://${a.domain}` : "Initializing";
|
|
1041
|
+
console.log(` [${idx + 1}] ${a.name} (${a.type}) • Status: ${a.status}`);
|
|
1042
|
+
console.log(` URL: ${urlStr}`);
|
|
1043
|
+
});
|
|
1044
|
+
console.log("");
|
|
1045
|
+
}
|
|
1046
|
+
});
|
|
1047
|
+
if (totalAppCount === 0) {
|
|
1048
|
+
console.log("No web applications deployed yet.");
|
|
1049
|
+
console.log("Run 'vibed deploy' inside a project folder or 'vibed app create <name>' to launch a 1-Click app.\n");
|
|
1050
|
+
}
|
|
1051
|
+
else {
|
|
1052
|
+
console.log("------------------------------------------------------------\n");
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
catch (err) {
|
|
1056
|
+
console.error(`Connection error: ${err.message}`);
|
|
1057
|
+
}
|
|
1058
|
+
return;
|
|
1059
|
+
}
|
|
1060
|
+
// 2. APP CREATE (1-Click Catalog Launcher)
|
|
1061
|
+
if (subCommand === "create") {
|
|
1062
|
+
let appName = args[2] && !args[2].startsWith("--") ? args[2] : "";
|
|
1063
|
+
const catalogIndex = args.indexOf("--catalog");
|
|
1064
|
+
const appFlagIndex = args.indexOf("--app");
|
|
1065
|
+
let explicitCatalog = catalogIndex !== -1 ? args[catalogIndex + 1] : appFlagIndex !== -1 ? args[appFlagIndex + 1] : "";
|
|
1066
|
+
if (!appName && process.stdin.isTTY) {
|
|
1067
|
+
appName = await (0, utils_1.askQuestion)("Application Service Name", "my-wordpress");
|
|
1068
|
+
}
|
|
1069
|
+
else if (!appName) {
|
|
1070
|
+
appName = "my-wordpress";
|
|
1071
|
+
}
|
|
1072
|
+
if (!explicitCatalog && process.stdin.isTTY) {
|
|
1073
|
+
console.log("\nSelect 1-Click Application to Launch:");
|
|
1074
|
+
console.log(" [1] WordPress (CMS + Dedicated MySQL 8.0)");
|
|
1075
|
+
console.log(" [2] n8n.io (Workflow Automation + Postgres)");
|
|
1076
|
+
console.log(" [3] PocketBase (Lean Backend + SQLite)");
|
|
1077
|
+
console.log(" [4] Ghost (Publishing + MySQL 8.0)");
|
|
1078
|
+
console.log(" [5] Directus (BaaS + Postgres)");
|
|
1079
|
+
console.log(" [6] MinIO (S3-Compatible Object Storage)");
|
|
1080
|
+
console.log(" [7] Uptime Kuma (Uptime Monitoring & Status Pages)");
|
|
1081
|
+
console.log(" [8] Umami (Privacy Analytics + Postgres)");
|
|
1082
|
+
console.log(" [9] MeiliSearch (High-Speed Full-Text Search)");
|
|
1083
|
+
console.log(" [10] Qdrant (Vector AI Database)");
|
|
1084
|
+
const chosen = await (0, utils_1.askQuestion)("Enter number", "1");
|
|
1085
|
+
const map = {
|
|
1086
|
+
"1": "wordpress",
|
|
1087
|
+
"2": "n8n",
|
|
1088
|
+
"3": "pocketbase",
|
|
1089
|
+
"4": "ghost",
|
|
1090
|
+
"5": "directus",
|
|
1091
|
+
"6": "minio",
|
|
1092
|
+
"7": "uptime-kuma",
|
|
1093
|
+
"8": "umami",
|
|
1094
|
+
"9": "meilisearch",
|
|
1095
|
+
"10": "qdrant"
|
|
1096
|
+
};
|
|
1097
|
+
explicitCatalog = map[chosen] || "wordpress";
|
|
1098
|
+
}
|
|
1099
|
+
const cleanCatalogKey = (explicitCatalog || "wordpress").toLowerCase().trim();
|
|
1100
|
+
console.log(`\nLaunching 1-Click '${cleanCatalogKey}' as '${appName}' on dedicated workspace...`);
|
|
1101
|
+
try {
|
|
1102
|
+
const res = await fetch(`${utils_1.API_BASE_URL}/api/cli/app`, {
|
|
1103
|
+
method: "POST",
|
|
1104
|
+
headers: {
|
|
1105
|
+
Authorization: `Bearer ${config.token}`,
|
|
1106
|
+
"Content-Type": "application/json"
|
|
1107
|
+
},
|
|
1108
|
+
body: JSON.stringify({
|
|
1109
|
+
action: "CREATE_APP",
|
|
1110
|
+
workspaceId: projectConfig?.workspaceId,
|
|
1111
|
+
name: appName,
|
|
1112
|
+
catalogKey: cleanCatalogKey
|
|
1113
|
+
})
|
|
1114
|
+
});
|
|
1115
|
+
const rawText = await res.text();
|
|
1116
|
+
let data = {};
|
|
1117
|
+
try {
|
|
1118
|
+
data = JSON.parse(rawText);
|
|
1119
|
+
}
|
|
1120
|
+
catch {
|
|
1121
|
+
throw new Error("Application launch request submitted. Run 'vibed app list' to check status.");
|
|
1122
|
+
}
|
|
1123
|
+
if (!res.ok || !data.success) {
|
|
1124
|
+
console.error(`Launch error: ${data.error || "Failed to launch catalog application."}`);
|
|
1125
|
+
process.exit(1);
|
|
1126
|
+
}
|
|
1127
|
+
console.log(`\nApplication Initialized!`);
|
|
1128
|
+
console.log("------------------------------------------------------------");
|
|
1129
|
+
console.log(`Service Name: ${data.name}`);
|
|
1130
|
+
console.log(`Catalog Type: ${data.catalogKey}`);
|
|
1131
|
+
console.log(`Workspace: ${data.workspaceName}`);
|
|
1132
|
+
console.log(`Live Domain: https://${data.domain}`);
|
|
1133
|
+
if (data.defaultUser) {
|
|
1134
|
+
console.log(`Admin User: ${data.defaultUser}`);
|
|
1135
|
+
}
|
|
1136
|
+
if (data.defaultPassword) {
|
|
1137
|
+
console.log(`Admin Pass: ${data.defaultPassword}`);
|
|
1138
|
+
}
|
|
1139
|
+
console.log("------------------------------------------------------------");
|
|
1140
|
+
console.log(`Check live build and startup logs with: vibed logs ${data.name}\n`);
|
|
1141
|
+
}
|
|
1142
|
+
catch (err) {
|
|
1143
|
+
console.error(`Connection error: ${err.message}`);
|
|
1144
|
+
}
|
|
1145
|
+
return;
|
|
1146
|
+
}
|
|
1147
|
+
console.log("Usage: vibed app [create|list] (or npx @vibedhost/cli app [create|list])");
|
|
938
1148
|
}
|
|
939
1149
|
main().catch((err) => {
|
|
940
1150
|
console.error(`Execution error: ${err.message}`);
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -32,6 +32,12 @@ async function main() {
|
|
|
32
32
|
case "whoami":
|
|
33
33
|
await handleWhoami();
|
|
34
34
|
break;
|
|
35
|
+
case "token":
|
|
36
|
+
await handleToken();
|
|
37
|
+
break;
|
|
38
|
+
case "app":
|
|
39
|
+
await handleApp();
|
|
40
|
+
break;
|
|
35
41
|
case "deploy":
|
|
36
42
|
await handleDeploy();
|
|
37
43
|
break;
|
|
@@ -82,10 +88,12 @@ Commands:
|
|
|
82
88
|
login Authenticate this terminal with your VibedHost account
|
|
83
89
|
logout Disconnect active account credentials from this machine
|
|
84
90
|
whoami Display authenticated account and workspace inventory
|
|
91
|
+
token Display authenticated MCP API token and client configuration
|
|
92
|
+
app <create|list> Launch 1-Click catalog applications (WordPress, n8n, Ghost, etc.)
|
|
85
93
|
deploy [dir] Package and deploy local project to dedicated workspace
|
|
86
94
|
status [app] Check real-time application deployment and routing status
|
|
87
95
|
logs [app] Stream live application logs or container build output
|
|
88
|
-
db <create|list|link> Manage dedicated databases and link to applications
|
|
96
|
+
db <create|list|link|unlink> Manage dedicated databases and link to applications
|
|
89
97
|
env <get|set> Manage container environment variables
|
|
90
98
|
port set <port> Update container listening port (e.g. 3000, 8080)
|
|
91
99
|
|
|
@@ -1044,7 +1052,233 @@ async function handleDb() {
|
|
|
1044
1052
|
return;
|
|
1045
1053
|
}
|
|
1046
1054
|
|
|
1047
|
-
|
|
1055
|
+
// 4. DATABASE UNLINK
|
|
1056
|
+
if (subCommand === "unlink") {
|
|
1057
|
+
const targetAppName = (args[2] && !args[2].startsWith("--"))
|
|
1058
|
+
? args[2]
|
|
1059
|
+
: (projectConfig?.appName || inferAppName(process.cwd()));
|
|
1060
|
+
|
|
1061
|
+
if (!targetAppName) {
|
|
1062
|
+
console.error("Usage: vibed db unlink <application-name> (or npx @vibedhost/cli db unlink <application-name>)");
|
|
1063
|
+
process.exit(1);
|
|
1064
|
+
}
|
|
1065
|
+
|
|
1066
|
+
console.log(`Unlinking database from application '${targetAppName}'...`);
|
|
1067
|
+
|
|
1068
|
+
try {
|
|
1069
|
+
const res = await fetch(`${API_BASE_URL}/api/cli/db`, {
|
|
1070
|
+
method: "POST",
|
|
1071
|
+
headers: {
|
|
1072
|
+
Authorization: `Bearer ${config.token}`,
|
|
1073
|
+
"Content-Type": "application/json"
|
|
1074
|
+
},
|
|
1075
|
+
body: JSON.stringify({
|
|
1076
|
+
action: "UNLINK_DB",
|
|
1077
|
+
appName: targetAppName
|
|
1078
|
+
})
|
|
1079
|
+
});
|
|
1080
|
+
|
|
1081
|
+
const rawText = await res.text();
|
|
1082
|
+
let data: any = {};
|
|
1083
|
+
try {
|
|
1084
|
+
data = JSON.parse(rawText);
|
|
1085
|
+
} catch {
|
|
1086
|
+
throw new Error("Database unlink request is processing on the workspace.");
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
if (!res.ok || !data.success) {
|
|
1090
|
+
console.error(`Unlink error: ${data.error || "Failed to unlink database."}`);
|
|
1091
|
+
process.exit(1);
|
|
1092
|
+
}
|
|
1093
|
+
|
|
1094
|
+
console.log(`\nSuccessfully unlinked database from '${data.appName}'!`);
|
|
1095
|
+
console.log(`Database connection variables removed from container. Service restarted.\n`);
|
|
1096
|
+
} catch (err: any) {
|
|
1097
|
+
console.error(`Connection error: ${err.message}`);
|
|
1098
|
+
}
|
|
1099
|
+
return;
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
console.log("Usage: vibed db [create|list|link|unlink] (or npx @vibedhost/cli db [create|list|link|unlink])");
|
|
1103
|
+
}
|
|
1104
|
+
|
|
1105
|
+
async function handleToken() {
|
|
1106
|
+
const config = readGlobalConfig();
|
|
1107
|
+
if (!config?.token) {
|
|
1108
|
+
console.log("Not authenticated. Run 'vibed login' (or 'npx @vibedhost/cli login') to connect your account.");
|
|
1109
|
+
return;
|
|
1110
|
+
}
|
|
1111
|
+
|
|
1112
|
+
console.log("\nVibedHost Personal Access Token & MCP Configuration");
|
|
1113
|
+
console.log("------------------------------------------------------------");
|
|
1114
|
+
console.log(`Account: ${config.email || "Authenticated User"}`);
|
|
1115
|
+
console.log(`Token: ${config.token}`);
|
|
1116
|
+
console.log("\nAdd to Claude Code, Cursor, or ChatGPT MCP Settings (JSON):");
|
|
1117
|
+
console.log(
|
|
1118
|
+
JSON.stringify(
|
|
1119
|
+
{
|
|
1120
|
+
mcpServers: {
|
|
1121
|
+
vibedhost: {
|
|
1122
|
+
url: `${API_BASE_URL}/api/mcp`,
|
|
1123
|
+
headers: {
|
|
1124
|
+
Authorization: `Bearer ${config.token}`
|
|
1125
|
+
}
|
|
1126
|
+
}
|
|
1127
|
+
}
|
|
1128
|
+
},
|
|
1129
|
+
null,
|
|
1130
|
+
2
|
|
1131
|
+
)
|
|
1132
|
+
);
|
|
1133
|
+
console.log("------------------------------------------------------------\n");
|
|
1134
|
+
}
|
|
1135
|
+
|
|
1136
|
+
async function handleApp() {
|
|
1137
|
+
const config = readGlobalConfig();
|
|
1138
|
+
if (!config?.token) {
|
|
1139
|
+
console.error("Not authenticated. Please run 'vibed login' (or 'npx @vibedhost/cli login') first.");
|
|
1140
|
+
process.exit(1);
|
|
1141
|
+
}
|
|
1142
|
+
|
|
1143
|
+
const subCommand = args[1] || "list";
|
|
1144
|
+
const projectConfig = readProjectConfig();
|
|
1145
|
+
|
|
1146
|
+
// 1. APP LIST
|
|
1147
|
+
if (subCommand === "list") {
|
|
1148
|
+
try {
|
|
1149
|
+
const res = await fetch(`${API_BASE_URL}/api/cli/workspaces`, {
|
|
1150
|
+
headers: { Authorization: `Bearer ${config.token}` }
|
|
1151
|
+
});
|
|
1152
|
+
const data = (await res.json()) as any;
|
|
1153
|
+
|
|
1154
|
+
if (!res.ok) {
|
|
1155
|
+
console.error(`Error: ${data.error || "Failed to fetch applications."}`);
|
|
1156
|
+
process.exit(1);
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
console.log("\nActive Web Applications & Services:");
|
|
1160
|
+
console.log("------------------------------------------------------------");
|
|
1161
|
+
|
|
1162
|
+
let totalAppCount = 0;
|
|
1163
|
+
(data.workspaces || []).forEach((ws: any) => {
|
|
1164
|
+
const webApps = (ws.apps || []).filter((a: any) => a.type !== "DATABASE");
|
|
1165
|
+
if (webApps.length > 0) {
|
|
1166
|
+
console.log(`Workspace: ${ws.name} (${ws.planName})`);
|
|
1167
|
+
webApps.forEach((a: any, idx: number) => {
|
|
1168
|
+
totalAppCount++;
|
|
1169
|
+
const urlStr = a.domain ? `https://${a.domain}` : "Initializing";
|
|
1170
|
+
console.log(` [${idx + 1}] ${a.name} (${a.type}) • Status: ${a.status}`);
|
|
1171
|
+
console.log(` URL: ${urlStr}`);
|
|
1172
|
+
});
|
|
1173
|
+
console.log("");
|
|
1174
|
+
}
|
|
1175
|
+
});
|
|
1176
|
+
|
|
1177
|
+
if (totalAppCount === 0) {
|
|
1178
|
+
console.log("No web applications deployed yet.");
|
|
1179
|
+
console.log("Run 'vibed deploy' inside a project folder or 'vibed app create <name>' to launch a 1-Click app.\n");
|
|
1180
|
+
} else {
|
|
1181
|
+
console.log("------------------------------------------------------------\n");
|
|
1182
|
+
}
|
|
1183
|
+
} catch (err: any) {
|
|
1184
|
+
console.error(`Connection error: ${err.message}`);
|
|
1185
|
+
}
|
|
1186
|
+
return;
|
|
1187
|
+
}
|
|
1188
|
+
|
|
1189
|
+
// 2. APP CREATE (1-Click Catalog Launcher)
|
|
1190
|
+
if (subCommand === "create") {
|
|
1191
|
+
let appName = args[2] && !args[2].startsWith("--") ? args[2] : "";
|
|
1192
|
+
const catalogIndex = args.indexOf("--catalog");
|
|
1193
|
+
const appFlagIndex = args.indexOf("--app");
|
|
1194
|
+
let explicitCatalog = catalogIndex !== -1 ? args[catalogIndex + 1] : appFlagIndex !== -1 ? args[appFlagIndex + 1] : "";
|
|
1195
|
+
|
|
1196
|
+
if (!appName && process.stdin.isTTY) {
|
|
1197
|
+
appName = await askQuestion("Application Service Name", "my-wordpress");
|
|
1198
|
+
} else if (!appName) {
|
|
1199
|
+
appName = "my-wordpress";
|
|
1200
|
+
}
|
|
1201
|
+
|
|
1202
|
+
if (!explicitCatalog && process.stdin.isTTY) {
|
|
1203
|
+
console.log("\nSelect 1-Click Application to Launch:");
|
|
1204
|
+
console.log(" [1] WordPress (CMS + Dedicated MySQL 8.0)");
|
|
1205
|
+
console.log(" [2] n8n.io (Workflow Automation + Postgres)");
|
|
1206
|
+
console.log(" [3] PocketBase (Lean Backend + SQLite)");
|
|
1207
|
+
console.log(" [4] Ghost (Publishing + MySQL 8.0)");
|
|
1208
|
+
console.log(" [5] Directus (BaaS + Postgres)");
|
|
1209
|
+
console.log(" [6] MinIO (S3-Compatible Object Storage)");
|
|
1210
|
+
console.log(" [7] Uptime Kuma (Uptime Monitoring & Status Pages)");
|
|
1211
|
+
console.log(" [8] Umami (Privacy Analytics + Postgres)");
|
|
1212
|
+
console.log(" [9] MeiliSearch (High-Speed Full-Text Search)");
|
|
1213
|
+
console.log(" [10] Qdrant (Vector AI Database)");
|
|
1214
|
+
const chosen = await askQuestion("Enter number", "1");
|
|
1215
|
+
const map: Record<string, string> = {
|
|
1216
|
+
"1": "wordpress",
|
|
1217
|
+
"2": "n8n",
|
|
1218
|
+
"3": "pocketbase",
|
|
1219
|
+
"4": "ghost",
|
|
1220
|
+
"5": "directus",
|
|
1221
|
+
"6": "minio",
|
|
1222
|
+
"7": "uptime-kuma",
|
|
1223
|
+
"8": "umami",
|
|
1224
|
+
"9": "meilisearch",
|
|
1225
|
+
"10": "qdrant"
|
|
1226
|
+
};
|
|
1227
|
+
explicitCatalog = map[chosen] || "wordpress";
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
const cleanCatalogKey = (explicitCatalog || "wordpress").toLowerCase().trim();
|
|
1231
|
+
console.log(`\nLaunching 1-Click '${cleanCatalogKey}' as '${appName}' on dedicated workspace...`);
|
|
1232
|
+
|
|
1233
|
+
try {
|
|
1234
|
+
const res = await fetch(`${API_BASE_URL}/api/cli/app`, {
|
|
1235
|
+
method: "POST",
|
|
1236
|
+
headers: {
|
|
1237
|
+
Authorization: `Bearer ${config.token}`,
|
|
1238
|
+
"Content-Type": "application/json"
|
|
1239
|
+
},
|
|
1240
|
+
body: JSON.stringify({
|
|
1241
|
+
action: "CREATE_APP",
|
|
1242
|
+
workspaceId: projectConfig?.workspaceId,
|
|
1243
|
+
name: appName,
|
|
1244
|
+
catalogKey: cleanCatalogKey
|
|
1245
|
+
})
|
|
1246
|
+
});
|
|
1247
|
+
|
|
1248
|
+
const rawText = await res.text();
|
|
1249
|
+
let data: any = {};
|
|
1250
|
+
try {
|
|
1251
|
+
data = JSON.parse(rawText);
|
|
1252
|
+
} catch {
|
|
1253
|
+
throw new Error("Application launch request submitted. Run 'vibed app list' to check status.");
|
|
1254
|
+
}
|
|
1255
|
+
|
|
1256
|
+
if (!res.ok || !data.success) {
|
|
1257
|
+
console.error(`Launch error: ${data.error || "Failed to launch catalog application."}`);
|
|
1258
|
+
process.exit(1);
|
|
1259
|
+
}
|
|
1260
|
+
|
|
1261
|
+
console.log(`\nApplication Initialized!`);
|
|
1262
|
+
console.log("------------------------------------------------------------");
|
|
1263
|
+
console.log(`Service Name: ${data.name}`);
|
|
1264
|
+
console.log(`Catalog Type: ${data.catalogKey}`);
|
|
1265
|
+
console.log(`Workspace: ${data.workspaceName}`);
|
|
1266
|
+
console.log(`Live Domain: https://${data.domain}`);
|
|
1267
|
+
if (data.defaultUser) {
|
|
1268
|
+
console.log(`Admin User: ${data.defaultUser}`);
|
|
1269
|
+
}
|
|
1270
|
+
if (data.defaultPassword) {
|
|
1271
|
+
console.log(`Admin Pass: ${data.defaultPassword}`);
|
|
1272
|
+
}
|
|
1273
|
+
console.log("------------------------------------------------------------");
|
|
1274
|
+
console.log(`Check live build and startup logs with: vibed logs ${data.name}\n`);
|
|
1275
|
+
} catch (err: any) {
|
|
1276
|
+
console.error(`Connection error: ${err.message}`);
|
|
1277
|
+
}
|
|
1278
|
+
return;
|
|
1279
|
+
}
|
|
1280
|
+
|
|
1281
|
+
console.log("Usage: vibed app [create|list] (or npx @vibedhost/cli app [create|list])");
|
|
1048
1282
|
}
|
|
1049
1283
|
|
|
1050
1284
|
main().catch((err) => {
|