@solcreek/cli 0.3.9 → 0.4.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.
@@ -14,5 +14,9 @@ export declare const opsCommand: import("citty").CommandDef<{
14
14
  description: string;
15
15
  required: false;
16
16
  };
17
+ env: {
18
+ type: "string";
19
+ description: string;
20
+ };
17
21
  }>;
18
22
  //# sourceMappingURL=ops.d.ts.map
@@ -12,13 +12,17 @@ export const opsCommand = defineCommand({
12
12
  description: "Subcommand: deployments | health",
13
13
  required: false,
14
14
  },
15
+ env: {
16
+ type: "string",
17
+ description: "Filter by environment: sandbox | production",
18
+ },
15
19
  ...globalArgs,
16
20
  },
17
21
  async run({ args }) {
18
22
  const jsonMode = resolveJsonMode(args);
19
23
  const sub = args.sub || "deployments";
20
24
  if (sub === "deployments") {
21
- return await listDeployments(jsonMode);
25
+ return await listDeployments(jsonMode, args.env);
22
26
  }
23
27
  if (sub === "health") {
24
28
  return await health(jsonMode);
@@ -26,7 +30,7 @@ export const opsCommand = defineCommand({
26
30
  jsonOutput({ error: `Unknown subcommand: ${sub}`, usage: "creek ops [deployments|health]" }, 1);
27
31
  },
28
32
  });
29
- async function listDeployments(jsonMode) {
33
+ async function listDeployments(jsonMode, envFilter) {
30
34
  const apiUrl = getApiUrl();
31
35
  const token = getToken();
32
36
  if (!token) {
@@ -38,7 +42,10 @@ async function listDeployments(jsonMode) {
38
42
  if (!res.ok) {
39
43
  jsonOutput({ error: `Failed to fetch deployments: ${res.status}` }, 1);
40
44
  }
41
- const deploys = await res.json();
45
+ let deploys = await res.json();
46
+ if (envFilter) {
47
+ deploys = deploys.filter((d) => d.environment === envFilter);
48
+ }
42
49
  if (jsonMode) {
43
50
  jsonOutput({
44
51
  ok: true,
@@ -54,7 +61,8 @@ async function listDeployments(jsonMode) {
54
61
  console.log("\n No recent deployments (last 1 hour)\n");
55
62
  return;
56
63
  }
57
- console.log(`\n Web Deploys (${deploys.length} in last hour)\n`);
64
+ const label = envFilter ? `Deployments — ${envFilter}` : "Deployments";
65
+ console.log(`\n ${label} (${deploys.length})\n`);
58
66
  const statusColors = {
59
67
  active: "\x1b[32m", // green
60
68
  building: "\x1b[34m", // blue
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solcreek/cli",
3
- "version": "0.3.9",
3
+ "version": "0.4.0",
4
4
  "description": "CLI for the Creek deployment platform",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -41,9 +41,6 @@
41
41
  "smol-toml": "^1.3.1",
42
42
  "ws": "^8.20.0"
43
43
  },
44
- "optionalDependencies": {
45
- "@solcreek/adapter-creek": "*"
46
- },
47
44
  "devDependencies": {
48
45
  "@testing-library/dom": "^10.4.1",
49
46
  "@testing-library/react": "^16.3.2",