@vibedhost/cli 1.0.5 → 1.0.6

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 (3) hide show
  1. package/dist/index.js +92 -16
  2. package/package.json +1 -1
  3. package/src/index.ts +96 -16
package/dist/index.js CHANGED
@@ -76,7 +76,7 @@ Commands:
76
76
  logout Disconnect active account credentials from this machine
77
77
  whoami Display authenticated account and workspace inventory
78
78
  token Display authenticated MCP API token and client configuration
79
- app <create|list> Launch 1-Click catalog applications (WordPress, n8n, Ghost, etc.)
79
+ app <create|list|status> Launch and inspect 1-Click catalog applications (WordPress, n8n, Ghost, etc.)
80
80
  deploy [dir] Package and deploy local project to dedicated workspace
81
81
  status [app] Check real-time application deployment and routing status
82
82
  logs [app] Stream live application logs or container build output
@@ -1017,6 +1017,14 @@ async function handleApp() {
1017
1017
  }
1018
1018
  const subCommand = args[1] || "list";
1019
1019
  const projectConfig = (0, utils_1.readProjectConfig)();
1020
+ // 0. APP STATUS
1021
+ if (subCommand === "status") {
1022
+ if (args[2]) {
1023
+ args[1] = args[2];
1024
+ }
1025
+ await handleStatus();
1026
+ return;
1027
+ }
1020
1028
  // 1. APP LIST
1021
1029
  if (subCommand === "list") {
1022
1030
  try {
@@ -1118,33 +1126,101 @@ async function handleApp() {
1118
1126
  data = JSON.parse(rawText);
1119
1127
  }
1120
1128
  catch {
1121
- throw new Error("Application launch request submitted. Run 'vibed app list' to check status.");
1129
+ throw new Error(`Gateway returned unexpected response (${res.status}): ${rawText.slice(0, 150)}`);
1122
1130
  }
1123
1131
  if (!res.ok || !data.success) {
1124
1132
  console.error(`Launch error: ${data.error || "Failed to launch catalog application."}`);
1125
1133
  process.exit(1);
1126
1134
  }
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
+ console.log("Building application container in background...");
1136
+ // Progressive status polling loop (up to 90 seconds)
1137
+ const startTime = Date.now();
1138
+ let isLive = false;
1139
+ let isFailed = false;
1140
+ const finalAppName = data.name || appName;
1141
+ while (!isLive && !isFailed && Date.now() - startTime < 90000) {
1142
+ await new Promise((r) => setTimeout(r, 2500));
1143
+ const elapsedSec = Math.round((Date.now() - startTime) / 1000);
1144
+ try {
1145
+ const checkRes = await fetch(`${utils_1.API_BASE_URL}/api/cli/logs?appName=${encodeURIComponent(finalAppName)}`, { headers: { Authorization: `Bearer ${config.token}` } });
1146
+ const checkData = (await checkRes.json());
1147
+ if (checkData.status === "active") {
1148
+ isLive = true;
1149
+ break;
1150
+ }
1151
+ else if (checkData.status === "failed") {
1152
+ isFailed = true;
1153
+ break;
1154
+ }
1155
+ else {
1156
+ process.stdout.write(`\rBuilding application container in background... (${elapsedSec}s)`);
1157
+ }
1158
+ }
1159
+ catch { }
1135
1160
  }
1136
- if (data.defaultPassword) {
1137
- console.log(`Admin Pass: ${data.defaultPassword}`);
1161
+ process.stdout.write("\r" + " ".repeat(65) + "\r");
1162
+ if (isLive) {
1163
+ console.log(`
1164
+ Application Ready & Online!
1165
+ ------------------------------------------------------------
1166
+ Service Name: ${data.name}
1167
+ Catalog Type: ${data.catalogKey}
1168
+ Workspace: ${data.workspaceName}
1169
+ Status: Active
1170
+
1171
+ Live URL: https://${data.domain}`);
1172
+ if (data.adminPath) {
1173
+ console.log(`Admin URL: https://${data.domain}${data.adminPath}`);
1174
+ }
1175
+ if (data.defaultUser) {
1176
+ console.log(`Admin User: ${data.defaultUser}`);
1177
+ }
1178
+ if (data.defaultPassword) {
1179
+ console.log(`Admin Pass: ${data.defaultPassword}`);
1180
+ }
1181
+ console.log(`------------------------------------------------------------\n`);
1182
+ }
1183
+ else if (isFailed) {
1184
+ console.error(`
1185
+ Application Launch Unsuccessful
1186
+ ------------------------------------------------------------
1187
+ Service: ${finalAppName}
1188
+ Workspace: ${data.workspaceName}
1189
+ Status: Failed
1190
+
1191
+ Launch unsuccessful.
1192
+ Run 'vibed logs ${finalAppName}' to view container error logs.
1193
+ ------------------------------------------------------------
1194
+ `);
1195
+ process.exit(1);
1196
+ }
1197
+ else {
1198
+ console.log(`
1199
+ Application Launch in Progress
1200
+ ------------------------------------------------------------
1201
+ Service Name: ${data.name}
1202
+ Catalog Type: ${data.catalogKey}
1203
+ Workspace: ${data.workspaceName}
1204
+ Status: Building
1205
+
1206
+ Your application is continuing to initialize in the background.
1207
+ Run 'vibed status ${finalAppName}' to check real-time status.
1208
+ Run 'vibed logs ${finalAppName}' to view live startup logs.`);
1209
+ if (data.defaultUser) {
1210
+ console.log(`Admin User: ${data.defaultUser}`);
1211
+ }
1212
+ if (data.defaultPassword) {
1213
+ console.log(`Admin Pass: ${data.defaultPassword}`);
1214
+ }
1215
+ console.log(`------------------------------------------------------------\n`);
1138
1216
  }
1139
- console.log("------------------------------------------------------------");
1140
- console.log(`Check live build and startup logs with: vibed logs ${data.name}\n`);
1141
1217
  }
1142
1218
  catch (err) {
1143
- console.error(`Connection error: ${err.message}`);
1219
+ console.error(`\nConnection error: ${err.message}`);
1144
1220
  }
1145
1221
  return;
1146
1222
  }
1147
- console.log("Usage: vibed app [create|list] (or npx @vibedhost/cli app [create|list])");
1223
+ console.log("Usage: vibed app [create|list|status] (or npx @vibedhost/cli app [create|list|status])");
1148
1224
  }
1149
1225
  main().catch((err) => {
1150
1226
  console.error(`Execution error: ${err.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vibedhost/cli",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "VibedHost Cloud Engine CLI: Deploy applications to dedicated cloud workspaces directly from your terminal.",
5
5
  "main": "./dist/index.js",
6
6
  "bin": {
package/src/index.ts CHANGED
@@ -89,7 +89,7 @@ Commands:
89
89
  logout Disconnect active account credentials from this machine
90
90
  whoami Display authenticated account and workspace inventory
91
91
  token Display authenticated MCP API token and client configuration
92
- app <create|list> Launch 1-Click catalog applications (WordPress, n8n, Ghost, etc.)
92
+ app <create|list|status> Launch and inspect 1-Click catalog applications (WordPress, n8n, Ghost, etc.)
93
93
  deploy [dir] Package and deploy local project to dedicated workspace
94
94
  status [app] Check real-time application deployment and routing status
95
95
  logs [app] Stream live application logs or container build output
@@ -1143,6 +1143,15 @@ async function handleApp() {
1143
1143
  const subCommand = args[1] || "list";
1144
1144
  const projectConfig = readProjectConfig();
1145
1145
 
1146
+ // 0. APP STATUS
1147
+ if (subCommand === "status") {
1148
+ if (args[2]) {
1149
+ args[1] = args[2];
1150
+ }
1151
+ await handleStatus();
1152
+ return;
1153
+ }
1154
+
1146
1155
  // 1. APP LIST
1147
1156
  if (subCommand === "list") {
1148
1157
  try {
@@ -1250,7 +1259,7 @@ async function handleApp() {
1250
1259
  try {
1251
1260
  data = JSON.parse(rawText);
1252
1261
  } catch {
1253
- throw new Error("Application launch request submitted. Run 'vibed app list' to check status.");
1262
+ throw new Error(`Gateway returned unexpected response (${res.status}): ${rawText.slice(0, 150)}`);
1254
1263
  }
1255
1264
 
1256
1265
  if (!res.ok || !data.success) {
@@ -1258,27 +1267,98 @@ async function handleApp() {
1258
1267
  process.exit(1);
1259
1268
  }
1260
1269
 
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}`);
1270
+ console.log("Building application container in background...");
1271
+
1272
+ // Progressive status polling loop (up to 90 seconds)
1273
+ const startTime = Date.now();
1274
+ let isLive = false;
1275
+ let isFailed = false;
1276
+ const finalAppName = data.name || appName;
1277
+
1278
+ while (!isLive && !isFailed && Date.now() - startTime < 90000) {
1279
+ await new Promise((r) => setTimeout(r, 2500));
1280
+ const elapsedSec = Math.round((Date.now() - startTime) / 1000);
1281
+ try {
1282
+ const checkRes = await fetch(
1283
+ `${API_BASE_URL}/api/cli/logs?appName=${encodeURIComponent(finalAppName)}`,
1284
+ { headers: { Authorization: `Bearer ${config.token}` } }
1285
+ );
1286
+ const checkData = (await checkRes.json()) as any;
1287
+
1288
+ if (checkData.status === "active") {
1289
+ isLive = true;
1290
+ break;
1291
+ } else if (checkData.status === "failed") {
1292
+ isFailed = true;
1293
+ break;
1294
+ } else {
1295
+ process.stdout.write(`\rBuilding application container in background... (${elapsedSec}s)`);
1296
+ }
1297
+ } catch {}
1269
1298
  }
1270
- if (data.defaultPassword) {
1271
- console.log(`Admin Pass: ${data.defaultPassword}`);
1299
+
1300
+ process.stdout.write("\r" + " ".repeat(65) + "\r");
1301
+
1302
+ if (isLive) {
1303
+ console.log(`
1304
+ Application Ready & Online!
1305
+ ------------------------------------------------------------
1306
+ Service Name: ${data.name}
1307
+ Catalog Type: ${data.catalogKey}
1308
+ Workspace: ${data.workspaceName}
1309
+ Status: Active
1310
+
1311
+ Live URL: https://${data.domain}`);
1312
+ if (data.adminPath) {
1313
+ console.log(`Admin URL: https://${data.domain}${data.adminPath}`);
1314
+ }
1315
+ if (data.defaultUser) {
1316
+ console.log(`Admin User: ${data.defaultUser}`);
1317
+ }
1318
+ if (data.defaultPassword) {
1319
+ console.log(`Admin Pass: ${data.defaultPassword}`);
1320
+ }
1321
+ console.log(`------------------------------------------------------------\n`);
1322
+ } else if (isFailed) {
1323
+ console.error(`
1324
+ Application Launch Unsuccessful
1325
+ ------------------------------------------------------------
1326
+ Service: ${finalAppName}
1327
+ Workspace: ${data.workspaceName}
1328
+ Status: Failed
1329
+
1330
+ Launch unsuccessful.
1331
+ Run 'vibed logs ${finalAppName}' to view container error logs.
1332
+ ------------------------------------------------------------
1333
+ `);
1334
+ process.exit(1);
1335
+ } else {
1336
+ console.log(`
1337
+ Application Launch in Progress
1338
+ ------------------------------------------------------------
1339
+ Service Name: ${data.name}
1340
+ Catalog Type: ${data.catalogKey}
1341
+ Workspace: ${data.workspaceName}
1342
+ Status: Building
1343
+
1344
+ Your application is continuing to initialize in the background.
1345
+ Run 'vibed status ${finalAppName}' to check real-time status.
1346
+ Run 'vibed logs ${finalAppName}' to view live startup logs.`);
1347
+ if (data.defaultUser) {
1348
+ console.log(`Admin User: ${data.defaultUser}`);
1349
+ }
1350
+ if (data.defaultPassword) {
1351
+ console.log(`Admin Pass: ${data.defaultPassword}`);
1352
+ }
1353
+ console.log(`------------------------------------------------------------\n`);
1272
1354
  }
1273
- console.log("------------------------------------------------------------");
1274
- console.log(`Check live build and startup logs with: vibed logs ${data.name}\n`);
1275
1355
  } catch (err: any) {
1276
- console.error(`Connection error: ${err.message}`);
1356
+ console.error(`\nConnection error: ${err.message}`);
1277
1357
  }
1278
1358
  return;
1279
1359
  }
1280
1360
 
1281
- console.log("Usage: vibed app [create|list] (or npx @vibedhost/cli app [create|list])");
1361
+ console.log("Usage: vibed app [create|list|status] (or npx @vibedhost/cli app [create|list|status])");
1282
1362
  }
1283
1363
 
1284
1364
  main().catch((err) => {