creek 0.3.0 → 0.3.2

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 (49) hide show
  1. package/bin.js +2 -0
  2. package/hono.d.ts +1 -0
  3. package/hono.js +1 -0
  4. package/index.d.ts +1 -0
  5. package/index.js +1 -0
  6. package/package.json +30 -35
  7. package/react.d.ts +1 -0
  8. package/react.js +1 -0
  9. package/README.md +0 -184
  10. package/dist/commands/claim.d.ts +0 -18
  11. package/dist/commands/claim.js +0 -93
  12. package/dist/commands/deploy.d.ts +0 -38
  13. package/dist/commands/deploy.js +0 -807
  14. package/dist/commands/deployments.d.ts +0 -18
  15. package/dist/commands/deployments.js +0 -84
  16. package/dist/commands/env.d.ts +0 -2
  17. package/dist/commands/env.js +0 -104
  18. package/dist/commands/init.d.ts +0 -18
  19. package/dist/commands/init.js +0 -69
  20. package/dist/commands/login.d.ts +0 -23
  21. package/dist/commands/login.js +0 -120
  22. package/dist/commands/projects.d.ts +0 -13
  23. package/dist/commands/projects.js +0 -38
  24. package/dist/commands/status.d.ts +0 -18
  25. package/dist/commands/status.js +0 -115
  26. package/dist/commands/whoami.d.ts +0 -13
  27. package/dist/commands/whoami.js +0 -43
  28. package/dist/index.d.ts +0 -3
  29. package/dist/index.js +0 -36
  30. package/dist/utils/auth-server.d.ts +0 -22
  31. package/dist/utils/auth-server.js +0 -91
  32. package/dist/utils/bundle.d.ts +0 -6
  33. package/dist/utils/bundle.js +0 -39
  34. package/dist/utils/config.d.ts +0 -12
  35. package/dist/utils/config.js +0 -37
  36. package/dist/utils/git-clone.d.ts +0 -44
  37. package/dist/utils/git-clone.js +0 -193
  38. package/dist/utils/nextjs.d.ts +0 -48
  39. package/dist/utils/nextjs.js +0 -368
  40. package/dist/utils/output.d.ts +0 -38
  41. package/dist/utils/output.js +0 -45
  42. package/dist/utils/repo-url.d.ts +0 -48
  43. package/dist/utils/repo-url.js +0 -201
  44. package/dist/utils/sandbox.d.ts +0 -50
  45. package/dist/utils/sandbox.js +0 -69
  46. package/dist/utils/ssr-bundle.d.ts +0 -6
  47. package/dist/utils/ssr-bundle.js +0 -48
  48. package/dist/utils/tos.d.ts +0 -28
  49. package/dist/utils/tos.js +0 -95
@@ -1,18 +0,0 @@
1
- export declare const deploymentsCommand: import("citty").CommandDef<{
2
- json: {
3
- type: "boolean";
4
- description: string;
5
- default: boolean;
6
- };
7
- yes: {
8
- type: "boolean";
9
- description: string;
10
- default: boolean;
11
- };
12
- project: {
13
- type: "string";
14
- description: string;
15
- required: false;
16
- };
17
- }>;
18
- //# sourceMappingURL=deployments.d.ts.map
@@ -1,84 +0,0 @@
1
- import { defineCommand } from "citty";
2
- import consola from "consola";
3
- import { CreekClient } from "@solcreek/sdk";
4
- import { getToken, getApiUrl } from "../utils/config.js";
5
- import { existsSync, readFileSync } from "node:fs";
6
- import { join } from "node:path";
7
- import { parseConfig } from "@solcreek/sdk";
8
- import { globalArgs, resolveJsonMode, jsonOutput } from "../utils/output.js";
9
- export const deploymentsCommand = defineCommand({
10
- meta: {
11
- name: "deployments",
12
- description: "List recent deployments for the current project",
13
- },
14
- args: {
15
- project: {
16
- type: "string",
17
- description: "Project slug (default: from creek.toml)",
18
- required: false,
19
- },
20
- ...globalArgs,
21
- },
22
- async run({ args }) {
23
- const jsonMode = resolveJsonMode(args);
24
- const token = getToken();
25
- if (!token) {
26
- if (jsonMode)
27
- jsonOutput({ ok: false, error: "not_authenticated" }, 1);
28
- consola.error("Not authenticated. Run `creek login` first.");
29
- process.exit(1);
30
- }
31
- // Resolve project slug
32
- let slug = args.project;
33
- if (!slug) {
34
- const configPath = join(process.cwd(), "creek.toml");
35
- if (!existsSync(configPath)) {
36
- if (jsonMode)
37
- jsonOutput({ ok: false, error: "no_project", message: "No creek.toml found. Use --project <slug> or run from a project directory." }, 1);
38
- consola.error("No creek.toml found. Use --project <slug> or run from a project directory.");
39
- process.exit(1);
40
- }
41
- slug = parseConfig(readFileSync(configPath, "utf-8")).project.name;
42
- }
43
- const client = new CreekClient(getApiUrl(), token);
44
- let deployments;
45
- try {
46
- deployments = await client.listDeployments(slug);
47
- }
48
- catch (err) {
49
- const msg = err instanceof Error ? err.message : "Failed to list deployments";
50
- if (jsonMode)
51
- jsonOutput({ ok: false, error: "api_error", message: msg }, 1);
52
- consola.error(msg);
53
- process.exit(1);
54
- }
55
- if (jsonMode) {
56
- jsonOutput({ ok: true, project: slug, deployments });
57
- }
58
- if (deployments.length === 0) {
59
- consola.info(`No deployments for ${slug}. Run \`creek deploy\` to create one.`);
60
- return;
61
- }
62
- consola.info(`${deployments.length} deployment(s) for ${slug}\n`);
63
- for (const d of deployments) {
64
- const status = d.status === "active" ? "\x1b[32mactive\x1b[0m" : d.status;
65
- const branch = d.branch ? ` (${d.branch})` : "";
66
- const age = timeAgo(d.created_at);
67
- consola.log(` ${d.id.slice(0, 8)} ${status} ${age}${branch}`);
68
- }
69
- },
70
- });
71
- function timeAgo(dateStr) {
72
- const diff = Date.now() - new Date(dateStr).getTime();
73
- const mins = Math.floor(diff / 60_000);
74
- if (mins < 1)
75
- return "just now";
76
- if (mins < 60)
77
- return `${mins}m ago`;
78
- const hours = Math.floor(mins / 60);
79
- if (hours < 24)
80
- return `${hours}h ago`;
81
- const days = Math.floor(hours / 24);
82
- return `${days}d ago`;
83
- }
84
- //# sourceMappingURL=deployments.js.map
@@ -1,2 +0,0 @@
1
- export declare const envCommand: import("citty").CommandDef<import("citty").ArgsDef>;
2
- //# sourceMappingURL=env.d.ts.map
@@ -1,104 +0,0 @@
1
- import { defineCommand } from "citty";
2
- import consola from "consola";
3
- import { CreekClient, parseConfig } from "@solcreek/sdk";
4
- import { getToken, getApiUrl } from "../utils/config.js";
5
- import { existsSync, readFileSync } from "node:fs";
6
- import { join } from "node:path";
7
- import { globalArgs, resolveJsonMode, jsonOutput } from "../utils/output.js";
8
- function getProjectSlug() {
9
- const configPath = join(process.cwd(), "creek.toml");
10
- if (!existsSync(configPath)) {
11
- consola.error("No creek.toml found. Run `creek init` first.");
12
- process.exit(1);
13
- }
14
- return parseConfig(readFileSync(configPath, "utf-8")).project.name;
15
- }
16
- function getClient() {
17
- const token = getToken();
18
- if (!token) {
19
- consola.error("Not authenticated. Run `creek login` first.");
20
- process.exit(1);
21
- }
22
- return new CreekClient(getApiUrl(), token);
23
- }
24
- const envSet = defineCommand({
25
- meta: { name: "set", description: "Set an environment variable" },
26
- args: {
27
- key: { type: "positional", description: "Variable name (e.g. DATABASE_URL)", required: true },
28
- value: { type: "positional", description: "Variable value", required: true },
29
- ...globalArgs,
30
- },
31
- async run({ args }) {
32
- const jsonMode = resolveJsonMode(args);
33
- const client = getClient();
34
- const slug = getProjectSlug();
35
- await client.setEnvVar(slug, args.key, args.value);
36
- if (jsonMode)
37
- jsonOutput({ ok: true, key: args.key, project: slug });
38
- consola.success(`Set ${args.key}`);
39
- },
40
- });
41
- function redact(value) {
42
- if (value.length <= 4)
43
- return "••••";
44
- return value.slice(0, 2) + "•".repeat(Math.min(value.length - 4, 20)) + value.slice(-2);
45
- }
46
- const envGet = defineCommand({
47
- meta: { name: "ls", description: "List environment variables" },
48
- args: {
49
- show: { type: "boolean", description: "Show values in plaintext (default: redacted)", default: false },
50
- ...globalArgs,
51
- },
52
- async run({ args }) {
53
- const jsonMode = resolveJsonMode(args);
54
- const client = getClient();
55
- const slug = getProjectSlug();
56
- const vars = await client.listEnvVars(slug);
57
- if (jsonMode) {
58
- jsonOutput({
59
- ok: true,
60
- project: slug,
61
- vars: vars.map((v) => ({ key: v.key, value: args.show ? v.value : redact(v.value) })),
62
- });
63
- }
64
- if (vars.length === 0) {
65
- consola.info("No environment variables set.");
66
- return;
67
- }
68
- for (const v of vars) {
69
- const displayed = args.show ? v.value : redact(v.value);
70
- consola.log(` ${v.key} = ${displayed}`);
71
- }
72
- if (!args.show) {
73
- consola.info(" (use --show to reveal values)");
74
- }
75
- },
76
- });
77
- const envRm = defineCommand({
78
- meta: { name: "rm", description: "Remove an environment variable" },
79
- args: {
80
- key: { type: "positional", description: "Variable name to remove", required: true },
81
- ...globalArgs,
82
- },
83
- async run({ args }) {
84
- const jsonMode = resolveJsonMode(args);
85
- const client = getClient();
86
- const slug = getProjectSlug();
87
- await client.deleteEnvVar(slug, args.key);
88
- if (jsonMode)
89
- jsonOutput({ ok: true, key: args.key, removed: true, project: slug });
90
- consola.success(`Removed ${args.key}`);
91
- },
92
- });
93
- export const envCommand = defineCommand({
94
- meta: {
95
- name: "env",
96
- description: "Manage environment variables",
97
- },
98
- subCommands: {
99
- set: envSet,
100
- ls: envGet,
101
- rm: envRm,
102
- },
103
- });
104
- //# sourceMappingURL=env.js.map
@@ -1,18 +0,0 @@
1
- export declare const initCommand: import("citty").CommandDef<{
2
- json: {
3
- type: "boolean";
4
- description: string;
5
- default: boolean;
6
- };
7
- yes: {
8
- type: "boolean";
9
- description: string;
10
- default: boolean;
11
- };
12
- name: {
13
- type: "string";
14
- description: string;
15
- required: false;
16
- };
17
- }>;
18
- //# sourceMappingURL=init.d.ts.map
@@ -1,69 +0,0 @@
1
- import { defineCommand } from "citty";
2
- import consola from "consola";
3
- import { existsSync, readFileSync, writeFileSync } from "node:fs";
4
- import { join, basename } from "node:path";
5
- import { stringify } from "smol-toml";
6
- import { detectFramework } from "@solcreek/sdk";
7
- import { globalArgs, resolveJsonMode, jsonOutput, shouldAutoConfirm } from "../utils/output.js";
8
- export const initCommand = defineCommand({
9
- meta: {
10
- name: "init",
11
- description: "Initialize a new Creek project",
12
- },
13
- args: {
14
- name: {
15
- type: "string",
16
- description: "Project name",
17
- required: false,
18
- },
19
- ...globalArgs,
20
- },
21
- async run({ args }) {
22
- const jsonMode = resolveJsonMode(args);
23
- const cwd = process.cwd();
24
- const configPath = join(cwd, "creek.toml");
25
- if (existsSync(configPath)) {
26
- if (!shouldAutoConfirm(args)) {
27
- consola.warn("creek.toml already exists");
28
- const overwrite = await consola.prompt("Overwrite?", { type: "confirm" });
29
- if (!overwrite)
30
- return;
31
- }
32
- }
33
- // Detect framework
34
- const pkgPath = join(cwd, "package.json");
35
- let framework;
36
- if (existsSync(pkgPath)) {
37
- const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
38
- const detected = detectFramework(pkg);
39
- if (detected) {
40
- framework = detected;
41
- if (!jsonMode)
42
- consola.info(`Detected framework: ${framework}`);
43
- }
44
- }
45
- const defaultName = basename(cwd).toLowerCase().replace(/[^a-z0-9-]/g, "-");
46
- const name = args.name ?? defaultName;
47
- const config = {
48
- project: {
49
- name,
50
- ...(framework ? { framework } : {}),
51
- },
52
- build: {
53
- command: "npm run build",
54
- output: "dist",
55
- },
56
- resources: {
57
- d1: false,
58
- kv: false,
59
- r2: false,
60
- },
61
- };
62
- writeFileSync(configPath, stringify(config));
63
- if (jsonMode) {
64
- jsonOutput({ ok: true, name, framework: framework ?? null, path: configPath });
65
- }
66
- consola.success(`Created creek.toml for "${name}"`);
67
- },
68
- });
69
- //# sourceMappingURL=init.js.map
@@ -1,23 +0,0 @@
1
- export declare const loginCommand: import("citty").CommandDef<{
2
- json: {
3
- type: "boolean";
4
- description: string;
5
- default: boolean;
6
- };
7
- yes: {
8
- type: "boolean";
9
- description: string;
10
- default: boolean;
11
- };
12
- token: {
13
- type: "string";
14
- description: string;
15
- required: false;
16
- };
17
- headless: {
18
- type: "boolean";
19
- description: string;
20
- default: false;
21
- };
22
- }>;
23
- //# sourceMappingURL=login.d.ts.map
@@ -1,120 +0,0 @@
1
- import { defineCommand } from "citty";
2
- import consola from "consola";
3
- import { execFileSync } from "node:child_process";
4
- import { CreekClient } from "@solcreek/sdk";
5
- import { writeCliConfig, readCliConfig, getApiUrl } from "../utils/config.js";
6
- import { startAuthServer } from "../utils/auth-server.js";
7
- import { globalArgs, resolveJsonMode, jsonOutput } from "../utils/output.js";
8
- function getDashboardUrl() {
9
- const apiUrl = getApiUrl();
10
- // http://localhost:8787 → http://localhost:3000
11
- // https://api.creek.dev → https://app.creek.dev
12
- return apiUrl
13
- .replace("api.", "app.")
14
- .replace(":8787", ":3000");
15
- }
16
- function openBrowser(url) {
17
- try {
18
- const cmd = process.platform === "darwin"
19
- ? "open"
20
- : process.platform === "win32"
21
- ? "start"
22
- : "xdg-open";
23
- execFileSync(cmd, [url], { stdio: "ignore" });
24
- }
25
- catch {
26
- // Browser open failed — user will need to copy the URL manually
27
- }
28
- }
29
- export const loginCommand = defineCommand({
30
- meta: {
31
- name: "login",
32
- description: "Authenticate with Creek",
33
- },
34
- args: {
35
- token: {
36
- type: "string",
37
- description: "API key (for CI/CD, skips interactive prompt)",
38
- required: false,
39
- },
40
- headless: {
41
- type: "boolean",
42
- description: "Use headless mode (paste API key manually, for SSH/remote)",
43
- default: false,
44
- },
45
- ...globalArgs,
46
- },
47
- async run({ args }) {
48
- const jsonMode = resolveJsonMode(args);
49
- // Mode 1: --token (CI/CD)
50
- if (args.token) {
51
- return await saveAndVerify(args.token, jsonMode);
52
- }
53
- // Mode 2: --headless (SSH/remote — prompt for API key)
54
- if (args.headless) {
55
- return await headlessLogin();
56
- }
57
- // Mode 3: Default — localhost redirect (best UX)
58
- return await browserLogin();
59
- },
60
- });
61
- /**
62
- * Default login: open browser → dashboard creates API key → redirect to localhost callback.
63
- */
64
- async function browserLogin() {
65
- const { port, state, waitForCallback, close } = startAuthServer();
66
- const dashboardUrl = getDashboardUrl();
67
- const authUrl = `${dashboardUrl}/cli-auth?port=${port}&state=${state}`;
68
- consola.info("Opening browser to authenticate...");
69
- consola.info(`If the browser doesn't open, visit: ${authUrl}`);
70
- consola.info("");
71
- openBrowser(authUrl);
72
- consola.start("Waiting for authentication...");
73
- try {
74
- const key = await waitForCallback();
75
- await saveAndVerify(key);
76
- }
77
- catch (err) {
78
- close();
79
- consola.error(err instanceof Error ? err.message : "Authentication failed");
80
- consola.info("Try `creek login --headless` if browser login isn't working.");
81
- process.exit(1);
82
- }
83
- }
84
- /**
85
- * Headless login: prompt user to paste API key from dashboard.
86
- */
87
- async function headlessLogin() {
88
- const dashboardUrl = getDashboardUrl();
89
- consola.info("Create an API key in the Creek dashboard:");
90
- consola.info(` ${dashboardUrl}/api-keys`);
91
- consola.info("");
92
- const apiKey = await consola.prompt("Paste your API key:", { type: "text" });
93
- if (!apiKey || typeof apiKey !== "string") {
94
- consola.error("No API key provided");
95
- process.exit(1);
96
- }
97
- await saveAndVerify(apiKey.trim());
98
- }
99
- /**
100
- * Validate key against API, save to config, print success.
101
- */
102
- async function saveAndVerify(apiKey, jsonMode = false) {
103
- if (!jsonMode)
104
- consola.start("Verifying...");
105
- const client = new CreekClient(getApiUrl(), apiKey);
106
- const session = await client.getSession();
107
- if (!session?.user) {
108
- if (jsonMode)
109
- jsonOutput({ ok: false, error: "invalid_token", message: "Invalid API key" }, 1);
110
- consola.error("Invalid API key. Please check and try again.");
111
- process.exit(1);
112
- }
113
- const config = readCliConfig();
114
- writeCliConfig({ ...config, token: apiKey });
115
- if (jsonMode) {
116
- jsonOutput({ ok: true, user: session.user.name, email: session.user.email });
117
- }
118
- consola.success(`Logged in as ${session.user.name} (${session.user.email})`);
119
- }
120
- //# sourceMappingURL=login.js.map
@@ -1,13 +0,0 @@
1
- export declare const projectsCommand: import("citty").CommandDef<{
2
- json: {
3
- type: "boolean";
4
- description: string;
5
- default: boolean;
6
- };
7
- yes: {
8
- type: "boolean";
9
- description: string;
10
- default: boolean;
11
- };
12
- }>;
13
- //# sourceMappingURL=projects.d.ts.map
@@ -1,38 +0,0 @@
1
- import { defineCommand } from "citty";
2
- import consola from "consola";
3
- import { CreekClient } from "@solcreek/sdk";
4
- import { getToken, getApiUrl } from "../utils/config.js";
5
- import { globalArgs, resolveJsonMode, jsonOutput } from "../utils/output.js";
6
- export const projectsCommand = defineCommand({
7
- meta: {
8
- name: "projects",
9
- description: "List all projects",
10
- },
11
- args: { ...globalArgs },
12
- async run({ args }) {
13
- const jsonMode = resolveJsonMode(args);
14
- const token = getToken();
15
- if (!token) {
16
- if (jsonMode)
17
- jsonOutput({ ok: false, error: "not_authenticated" }, 1);
18
- consola.error("Not authenticated. Run `creek login` first.");
19
- process.exit(1);
20
- }
21
- const client = new CreekClient(getApiUrl(), token);
22
- const projects = await client.listProjects();
23
- if (jsonMode) {
24
- jsonOutput({ ok: true, projects });
25
- }
26
- if (projects.length === 0) {
27
- consola.info("No projects yet. Deploy one with `creek deploy`.");
28
- return;
29
- }
30
- consola.info(`${projects.length} project(s)\n`);
31
- for (const p of projects) {
32
- const framework = p.framework ? ` (${p.framework})` : "";
33
- const deployed = p.production_deployment_id ? "deployed" : "not deployed";
34
- consola.log(` ${p.slug}${framework} — ${deployed}`);
35
- }
36
- },
37
- });
38
- //# sourceMappingURL=projects.js.map
@@ -1,18 +0,0 @@
1
- export declare const statusCommand: import("citty").CommandDef<{
2
- json: {
3
- type: "boolean";
4
- description: string;
5
- default: boolean;
6
- };
7
- yes: {
8
- type: "boolean";
9
- description: string;
10
- default: boolean;
11
- };
12
- id: {
13
- type: "positional";
14
- description: string;
15
- required: false;
16
- };
17
- }>;
18
- //# sourceMappingURL=status.d.ts.map
@@ -1,115 +0,0 @@
1
- import { defineCommand } from "citty";
2
- import consola from "consola";
3
- import { CreekClient } from "@solcreek/sdk";
4
- import { getToken, getApiUrl, getSandboxApiUrl } from "../utils/config.js";
5
- import { existsSync, readFileSync } from "node:fs";
6
- import { join } from "node:path";
7
- import { parseConfig } from "@solcreek/sdk";
8
- import { globalArgs, resolveJsonMode, jsonOutput } from "../utils/output.js";
9
- export const statusCommand = defineCommand({
10
- meta: {
11
- name: "status",
12
- description: "Check deployment or sandbox status",
13
- },
14
- args: {
15
- id: {
16
- type: "positional",
17
- description: "Sandbox ID (optional — defaults to current project)",
18
- required: false,
19
- },
20
- ...globalArgs,
21
- },
22
- async run({ args }) {
23
- const jsonMode = resolveJsonMode(args);
24
- // If an ID is provided, check sandbox status (no auth needed)
25
- if (args.id) {
26
- return await sandboxStatus(args.id, jsonMode);
27
- }
28
- // Otherwise, check current project status (needs auth + creek.toml)
29
- return await projectStatus(jsonMode);
30
- },
31
- });
32
- async function sandboxStatus(sandboxId, jsonMode) {
33
- const sandboxApiUrl = getSandboxApiUrl();
34
- const res = await fetch(`${sandboxApiUrl}/api/sandbox/${sandboxId}/status`);
35
- if (!res.ok) {
36
- if (jsonMode)
37
- jsonOutput({ ok: false, error: "not_found", message: "Sandbox not found" }, 1);
38
- consola.error("Sandbox not found. It may have expired.");
39
- process.exit(1);
40
- }
41
- const status = await res.json();
42
- if (jsonMode) {
43
- jsonOutput({ ok: true, type: "sandbox", ...status });
44
- }
45
- const s = status.status;
46
- const statusColor = s === "active" ? `\x1b[32m${s}\x1b[0m`
47
- : s === "failed" ? `\x1b[31m${s}\x1b[0m`
48
- : s === "expired" ? `\x1b[33m${s}\x1b[0m`
49
- : s;
50
- consola.log(`\n Sandbox ${status.sandboxId}`);
51
- consola.log(` Status: ${statusColor}`);
52
- consola.log(` URL: ${status.previewUrl}`);
53
- if (status.deployDurationMs) {
54
- consola.log(` Duration: ${(status.deployDurationMs / 1000).toFixed(1)}s`);
55
- }
56
- if (s === "active") {
57
- consola.log(` Expires: ${status.expiresInSeconds}s remaining`);
58
- if (status.claimable) {
59
- consola.log(` Claim: creek claim ${status.sandboxId}`);
60
- }
61
- }
62
- if (status.failedStep) {
63
- consola.log(` Failed: ${status.failedStep} — ${status.errorMessage}`);
64
- }
65
- consola.log("");
66
- }
67
- async function projectStatus(jsonMode) {
68
- const token = getToken();
69
- if (!token) {
70
- if (jsonMode)
71
- jsonOutput({ ok: false, error: "not_authenticated" }, 1);
72
- consola.error("Not authenticated. Run `creek login` first.");
73
- consola.info("To check a sandbox: creek status <sandboxId>");
74
- process.exit(1);
75
- }
76
- const configPath = join(process.cwd(), "creek.toml");
77
- if (!existsSync(configPath)) {
78
- if (jsonMode)
79
- jsonOutput({ ok: false, error: "no_project", message: "No creek.toml found" }, 1);
80
- consola.error("No creek.toml found.");
81
- consola.info("To check a sandbox: creek status <sandboxId>");
82
- process.exit(1);
83
- }
84
- const config = parseConfig(readFileSync(configPath, "utf-8"));
85
- const client = new CreekClient(getApiUrl(), token);
86
- let project;
87
- try {
88
- project = await client.getProject(config.project.name);
89
- }
90
- catch {
91
- if (jsonMode)
92
- jsonOutput({ ok: false, error: "not_found", message: `Project "${config.project.name}" not found` }, 1);
93
- consola.error(`Project "${config.project.name}" not found.`);
94
- process.exit(1);
95
- }
96
- if (jsonMode) {
97
- jsonOutput({
98
- ok: true,
99
- type: "project",
100
- project: project.slug,
101
- framework: project.framework,
102
- productionDeploymentId: project.production_deployment_id,
103
- createdAt: project.created_at,
104
- });
105
- }
106
- const deployed = project.production_deployment_id ? "deployed" : "not deployed";
107
- const framework = project.framework ? ` (${project.framework})` : "";
108
- consola.log(`\n Project ${project.slug}${framework}`);
109
- consola.log(` Status: ${deployed}`);
110
- if (project.production_deployment_id) {
111
- consola.log(` Deploy: ${project.production_deployment_id.slice(0, 8)}`);
112
- }
113
- consola.log("");
114
- }
115
- //# sourceMappingURL=status.js.map
@@ -1,13 +0,0 @@
1
- export declare const whoamiCommand: import("citty").CommandDef<{
2
- json: {
3
- type: "boolean";
4
- description: string;
5
- default: boolean;
6
- };
7
- yes: {
8
- type: "boolean";
9
- description: string;
10
- default: boolean;
11
- };
12
- }>;
13
- //# sourceMappingURL=whoami.d.ts.map