@sylphx/cli 0.1.8 → 0.1.9

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 (2) hide show
  1. package/dist/index.js +16 -8
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -30,7 +30,7 @@ var import_commander16 = require("commander");
30
30
  // package.json
31
31
  var package_default = {
32
32
  name: "@sylphx/cli",
33
- version: "0.1.8",
33
+ version: "0.1.9",
34
34
  description: "Sylphx Platform CLI \u2014 deploy, manage logs, env vars, and more",
35
35
  type: "commonjs",
36
36
  bin: {
@@ -1378,11 +1378,14 @@ var openCommand = new import_commander10.Command("open").description("Open the a
1378
1378
  try {
1379
1379
  const status = await api.getDeploymentStatus(linked.appId);
1380
1380
  spinner.stop();
1381
- if (!status.url) {
1381
+ const envType = opts.env ?? linked.defaultEnv ?? "production";
1382
+ const envMatch = status.environments?.find((e) => e.envType === envType) ?? status.environments?.find((e) => e.envType === "production") ?? status.environments?.[0];
1383
+ const resolvedUrl = status.url ?? envMatch?.url ?? null;
1384
+ if (!resolvedUrl) {
1382
1385
  url = `https://sylphx.com/console/apps/${linked.appId}`;
1383
1386
  console.log(import_chalk11.default.yellow(" No URL found, opening console instead."));
1384
1387
  } else {
1385
- url = status.url;
1388
+ url = resolvedUrl;
1386
1389
  }
1387
1390
  } catch {
1388
1391
  spinner.stop();
@@ -1394,9 +1397,7 @@ var openCommand = new import_commander10.Command("open").description("Open the a
1394
1397
  await open(url);
1395
1398
  } catch (err) {
1396
1399
  console.log(
1397
- import_chalk11.default.red(
1398
- `Failed to open browser: ${err instanceof Error ? err.message : String(err)}`
1399
- )
1400
+ import_chalk11.default.red(`Failed to open browser: ${err instanceof Error ? err.message : String(err)}`)
1400
1401
  );
1401
1402
  console.log(import_chalk11.default.dim(` URL: ${url}`));
1402
1403
  process.exit(1);
@@ -1608,8 +1609,15 @@ var statusCommand = new import_commander13.Command("status").description("Show d
1608
1609
  const date = new Date(status.deployedAt);
1609
1610
  console.log(` Deployed: ${import_chalk14.default.white(date.toLocaleString())}`);
1610
1611
  }
1611
- if (status.url) {
1612
- console.log(` URL: ${import_chalk14.default.cyan(status.url)}`);
1612
+ const envMatch = status.environments?.find((e) => e.envType === env) ?? status.environments?.find((e) => e.envType === "production") ?? status.environments?.[0];
1613
+ const displayUrl = status.url ?? envMatch?.url ?? null;
1614
+ if (displayUrl) {
1615
+ console.log(` URL: ${import_chalk14.default.cyan(displayUrl)}`);
1616
+ }
1617
+ if (envMatch?.lastDeployedAt) {
1618
+ console.log(
1619
+ ` Deployed: ${import_chalk14.default.white(new Date(envMatch.lastDeployedAt).toLocaleString())}`
1620
+ );
1613
1621
  }
1614
1622
  if (status.replicas) {
1615
1623
  const { ready, desired } = status.replicas;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sylphx/cli",
3
- "version": "0.1.8",
3
+ "version": "0.1.9",
4
4
  "description": "Sylphx Platform CLI — deploy, manage logs, env vars, and more",
5
5
  "type": "commonjs",
6
6
  "bin": {