percher 0.2.10 → 0.3.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.
- package/dist/bin/percher.js +6803 -2955
- package/dist/package.json +45 -0
- package/dist/src/ci-env.d.ts +6 -0
- package/dist/src/ci-env.d.ts.map +1 -0
- package/dist/src/ci-env.js +35 -0
- package/dist/src/ci-env.js.map +1 -0
- package/dist/src/cli-utils.d.ts +44 -0
- package/dist/src/cli-utils.d.ts.map +1 -0
- package/dist/src/cli-utils.js +129 -0
- package/dist/src/cli-utils.js.map +1 -0
- package/dist/src/commands/account.d.ts +4 -0
- package/dist/src/commands/account.d.ts.map +1 -0
- package/dist/src/commands/account.js +280 -0
- package/dist/src/commands/account.js.map +1 -0
- package/dist/src/commands/apps.d.ts +13 -0
- package/dist/src/commands/apps.d.ts.map +1 -0
- package/dist/src/commands/apps.js +467 -0
- package/dist/src/commands/apps.js.map +1 -0
- package/dist/src/commands/auth.d.ts +4 -0
- package/dist/src/commands/auth.d.ts.map +1 -0
- package/dist/src/commands/auth.js +21 -0
- package/dist/src/commands/auth.js.map +1 -0
- package/dist/src/commands/data.d.ts +4 -0
- package/dist/src/commands/data.d.ts.map +1 -0
- package/dist/src/commands/data.js +148 -0
- package/dist/src/commands/data.js.map +1 -0
- package/dist/src/commands/deploys.d.ts +4 -0
- package/dist/src/commands/deploys.d.ts.map +1 -0
- package/dist/src/commands/deploys.js +197 -0
- package/dist/src/commands/deploys.js.map +1 -0
- package/dist/src/commands/env.d.ts +4 -0
- package/dist/src/commands/env.d.ts.map +1 -0
- package/dist/src/commands/env.js +66 -0
- package/dist/src/commands/env.js.map +1 -0
- package/dist/src/commands/github.d.ts +4 -0
- package/dist/src/commands/github.d.ts.map +1 -0
- package/dist/src/commands/github.js +93 -0
- package/dist/src/commands/github.js.map +1 -0
- package/dist/src/env-set-input.d.ts +13 -0
- package/dist/src/env-set-input.d.ts.map +1 -0
- package/dist/src/env-set-input.js +59 -0
- package/dist/src/env-set-input.js.map +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +17 -761
- package/dist/src/index.js.map +1 -1
- package/dist/src/prompt-hidden.d.ts +15 -0
- package/dist/src/prompt-hidden.d.ts.map +1 -0
- package/dist/src/prompt-hidden.js +104 -0
- package/dist/src/prompt-hidden.js.map +1 -0
- package/dist/src/telemetry.d.ts +1 -1
- package/dist/src/telemetry.d.ts.map +1 -1
- package/dist/src/telemetry.js +8 -1
- package/dist/src/telemetry.js.map +1 -1
- package/package.json +7 -6
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "percher",
|
|
3
|
+
"version": "0.3.0",
|
|
4
|
+
"description": "CLI for the Percher hosting platform — publish apps with one command",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"bin": {
|
|
7
|
+
"percher": "./dist/bin/percher.js"
|
|
8
|
+
},
|
|
9
|
+
"main": "./dist/src/index.js",
|
|
10
|
+
"types": "./dist/src/index.d.ts",
|
|
11
|
+
"exports": {
|
|
12
|
+
".": {
|
|
13
|
+
"types": "./dist/src/index.d.ts",
|
|
14
|
+
"import": "./dist/src/index.js",
|
|
15
|
+
"default": "./dist/src/index.js"
|
|
16
|
+
}
|
|
17
|
+
},
|
|
18
|
+
"files": ["dist"],
|
|
19
|
+
"scripts": {
|
|
20
|
+
"build": "tsc -p tsconfig.json && bun build bin/percher.ts --outfile dist/bin/percher.js --target node --format esm && node -e \"require('fs').chmodSync('dist/bin/percher.js',0o755)\"",
|
|
21
|
+
"test": "bun test",
|
|
22
|
+
"typecheck": "tsc --noEmit"
|
|
23
|
+
},
|
|
24
|
+
"dependencies": {
|
|
25
|
+
"@percher/client": "^0.2.7",
|
|
26
|
+
"@percher/core": "^0.3.0",
|
|
27
|
+
"@percher/toml": "^0.1.3",
|
|
28
|
+
"cac": "^7.0.0",
|
|
29
|
+
"picocolors": "^1.1.1"
|
|
30
|
+
},
|
|
31
|
+
"devDependencies": {
|
|
32
|
+
"bun-types": "^1.1.0"
|
|
33
|
+
},
|
|
34
|
+
"engines": {
|
|
35
|
+
"bun": ">=1.0.0",
|
|
36
|
+
"node": ">=20.19.0"
|
|
37
|
+
},
|
|
38
|
+
"license": "MIT",
|
|
39
|
+
"author": "Mattias Malmborg",
|
|
40
|
+
"repository": {
|
|
41
|
+
"type": "git",
|
|
42
|
+
"url": "https://github.com/mattiasmalmborg/percher"
|
|
43
|
+
},
|
|
44
|
+
"keywords": ["hosting", "deploy", "cli", "paas", "bun", "ai"]
|
|
45
|
+
}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export interface CiBranchMessage {
|
|
2
|
+
source: "github-actions-pr" | "github-actions" | "vercel" | "gitlab-ci" | "netlify";
|
|
3
|
+
message: string;
|
|
4
|
+
}
|
|
5
|
+
export declare function detectCiBranchMessage(env: Record<string, string | undefined>): CiBranchMessage | null;
|
|
6
|
+
//# sourceMappingURL=ci-env.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-env.d.ts","sourceRoot":"","sources":["../../src/ci-env.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,eAAe;IAC9B,MAAM,EAAE,mBAAmB,GAAG,gBAAgB,GAAG,QAAQ,GAAG,WAAW,GAAG,SAAS,CAAC;IACpF,OAAO,EAAE,MAAM,CAAC;CACjB;AAeD,wBAAgB,qBAAqB,CACnC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,GACtC,eAAe,GAAG,IAAI,CAsBxB"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
const MAX_BRANCH_LEN = 80;
|
|
2
|
+
function nonEmpty(v) {
|
|
3
|
+
if (!v)
|
|
4
|
+
return null;
|
|
5
|
+
const trimmed = v.trim();
|
|
6
|
+
return trimmed.length === 0 ? null : trimmed;
|
|
7
|
+
}
|
|
8
|
+
function fmt(branch) {
|
|
9
|
+
const safe = branch.slice(0, MAX_BRANCH_LEN);
|
|
10
|
+
return `preview: ${safe}`;
|
|
11
|
+
}
|
|
12
|
+
export function detectCiBranchMessage(env) {
|
|
13
|
+
// Order matters — PR-aware sources first.
|
|
14
|
+
const ghPr = nonEmpty(env.GITHUB_HEAD_REF);
|
|
15
|
+
if (ghPr)
|
|
16
|
+
return { source: "github-actions-pr", message: fmt(ghPr) };
|
|
17
|
+
const gh = nonEmpty(env.GITHUB_REF_NAME);
|
|
18
|
+
if (gh)
|
|
19
|
+
return { source: "github-actions", message: fmt(gh) };
|
|
20
|
+
const vercel = nonEmpty(env.VERCEL_GIT_COMMIT_REF);
|
|
21
|
+
if (vercel)
|
|
22
|
+
return { source: "vercel", message: fmt(vercel) };
|
|
23
|
+
if (nonEmpty(env.GITLAB_CI)) {
|
|
24
|
+
const gl = nonEmpty(env.CI_COMMIT_REF_NAME);
|
|
25
|
+
if (gl)
|
|
26
|
+
return { source: "gitlab-ci", message: fmt(gl) };
|
|
27
|
+
}
|
|
28
|
+
if (nonEmpty(env.NETLIFY)) {
|
|
29
|
+
const nl = nonEmpty(env.BRANCH) ?? nonEmpty(env.HEAD);
|
|
30
|
+
if (nl)
|
|
31
|
+
return { source: "netlify", message: fmt(nl) };
|
|
32
|
+
}
|
|
33
|
+
return null;
|
|
34
|
+
}
|
|
35
|
+
//# sourceMappingURL=ci-env.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ci-env.js","sourceRoot":"","sources":["../../src/ci-env.ts"],"names":[],"mappings":"AAKA,MAAM,cAAc,GAAG,EAAE,CAAC;AAE1B,SAAS,QAAQ,CAAC,CAAqB;IACrC,IAAI,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IACpB,MAAM,OAAO,GAAG,CAAC,CAAC,IAAI,EAAE,CAAC;IACzB,OAAO,OAAO,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC;AAC/C,CAAC;AAED,SAAS,GAAG,CAAC,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G,CAAC,EAAE,CAAC,EAAE,CAAC;IACzD,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import type { Context } from "@percher/core";
|
|
2
|
+
/** Thrown after output is already printed, to signal non-zero exit without an error message. */
|
|
3
|
+
export declare class SilentExitError {
|
|
4
|
+
readonly exitCode: number;
|
|
5
|
+
constructor(exitCode?: number);
|
|
6
|
+
}
|
|
7
|
+
export declare function writeLine(ctx: Context, line: string): Promise<void>;
|
|
8
|
+
/** ISO timestamp → "YYYY-MM-DD HH:MM:SS" in UTC for stable, sortable output. */
|
|
9
|
+
export declare function formatDeployTimestamp(iso: string): string;
|
|
10
|
+
export declare function formatStatus(status: string): string;
|
|
11
|
+
/**
|
|
12
|
+
* Pick the first non-flag positional in `argv` after index `from`. Used by
|
|
13
|
+
* the manual subcommand dispatch (cac doesn't natively support multi-token
|
|
14
|
+
* command names) to find the user's app/id argument regardless of whether
|
|
15
|
+
* flags came before or after it.
|
|
16
|
+
*
|
|
17
|
+
* `valueFlags` lists flags that consume the next argv token (e.g. `--app
|
|
18
|
+
* my-app`). Without it, the walker would grab "my-app" as the positional
|
|
19
|
+
* even though it's the value bound to `--app`. `--flag=value` is one
|
|
20
|
+
* token and never causes that ambiguity. Boolean flags like `--reveal`
|
|
21
|
+
* or `--latest-failed` don't need to be listed.
|
|
22
|
+
*/
|
|
23
|
+
export declare function firstNonFlagAfter(argv: string[], from: number, valueFlags?: ReadonlySet<string>): string | undefined;
|
|
24
|
+
/**
|
|
25
|
+
* Print the result of a superuser rotation. The password is only present
|
|
26
|
+
* when the user explicitly opted in with `--reveal`; without it the CLI
|
|
27
|
+
* confirms the rotation but doesn't print any credential.
|
|
28
|
+
*/
|
|
29
|
+
export declare function printSuperuserResetResult(ctx: Context, result: {
|
|
30
|
+
message: string;
|
|
31
|
+
email: string;
|
|
32
|
+
password?: string;
|
|
33
|
+
}): Promise<void>;
|
|
34
|
+
/**
|
|
35
|
+
* Shared body of the `deploys inspect [id]` command. Extracted so the
|
|
36
|
+
* subcommand-dispatch path in the parent `deploys` action can reuse it
|
|
37
|
+
* without duplicating output formatting.
|
|
38
|
+
*/
|
|
39
|
+
export declare function runDeploysInspect(ctx: Context, input: {
|
|
40
|
+
id?: string;
|
|
41
|
+
app?: string;
|
|
42
|
+
latestFailed?: boolean;
|
|
43
|
+
}): Promise<void>;
|
|
44
|
+
//# sourceMappingURL=cli-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-utils.d.ts","sourceRoot":"","sources":["../../src/cli-utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,eAAe,CAAC;AAG7C,gGAAgG;AAChG,qBAAa,eAAe;IACd,QAAQ,CAAC,QAAQ,EAAE,MAAM;gBAAhB,QAAQ,GAAE,MAAU;CAC1C;AAED,wBAAsB,SAAS,CAAC,GAAG,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAOzE;AAED,gFAAgF;AAChF,wBAAgB,qBAAqB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAKzD;AAED,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAInD;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,iBAAiB,CAC/B,IAAI,EAAE,MAAM,EAAE,EACd,IAAI,EAAE,MAAM,EACZ,UAAU,GAAE,WAAW,CAAC,MAAM,CAAa,GAC1C,MAAM,GAAG,SAAS,CAsBpB;AAED;;;;GAIG;AACH,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,GAC5D,OAAO,CAAC,IAAI,CAAC,CAYf;AAED;;;;GAIG;AACH,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,OAAO,EACZ,KAAK,EAAE;IAAE,EAAE,CAAC,EAAE,MAAM,CAAC;IAAC,GAAG,CAAC,EAAE,MAAM,CAAC;IAAC,YAAY,CAAC,EAAE,OAAO,CAAA;CAAE,GAC3D,OAAO,CAAC,IAAI,CAAC,CAsCf"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import * as core from "@percher/core";
|
|
2
|
+
import pc from "picocolors";
|
|
3
|
+
/** Thrown after output is already printed, to signal non-zero exit without an error message. */
|
|
4
|
+
export class SilentExitError {
|
|
5
|
+
exitCode;
|
|
6
|
+
constructor(exitCode = 1) {
|
|
7
|
+
this.exitCode = exitCode;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export async function writeLine(ctx, line) {
|
|
11
|
+
const writer = ctx.stdout.getWriter();
|
|
12
|
+
try {
|
|
13
|
+
await writer.write(new TextEncoder().encode(`${line}\n`));
|
|
14
|
+
}
|
|
15
|
+
finally {
|
|
16
|
+
writer.releaseLock();
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
/** ISO timestamp → "YYYY-MM-DD HH:MM:SS" in UTC for stable, sortable output. */
|
|
20
|
+
export function formatDeployTimestamp(iso) {
|
|
21
|
+
const d = new Date(iso);
|
|
22
|
+
if (Number.isNaN(d.getTime()))
|
|
23
|
+
return iso;
|
|
24
|
+
const pad = (n) => n.toString().padStart(2, "0");
|
|
25
|
+
return `${d.getUTCFullYear()}-${pad(d.getUTCMonth() + 1)}-${pad(d.getUTCDate())} ${pad(d.getUTCHours())}:${pad(d.getUTCMinutes())}:${pad(d.getUTCSeconds())}`;
|
|
26
|
+
}
|
|
27
|
+
export function formatStatus(status) {
|
|
28
|
+
if (status === "live")
|
|
29
|
+
return pc.green(status);
|
|
30
|
+
if (status === "failed")
|
|
31
|
+
return pc.red(status);
|
|
32
|
+
return pc.yellow(status);
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Pick the first non-flag positional in `argv` after index `from`. Used by
|
|
36
|
+
* the manual subcommand dispatch (cac doesn't natively support multi-token
|
|
37
|
+
* command names) to find the user's app/id argument regardless of whether
|
|
38
|
+
* flags came before or after it.
|
|
39
|
+
*
|
|
40
|
+
* `valueFlags` lists flags that consume the next argv token (e.g. `--app
|
|
41
|
+
* my-app`). Without it, the walker would grab "my-app" as the positional
|
|
42
|
+
* even though it's the value bound to `--app`. `--flag=value` is one
|
|
43
|
+
* token and never causes that ambiguity. Boolean flags like `--reveal`
|
|
44
|
+
* or `--latest-failed` don't need to be listed.
|
|
45
|
+
*/
|
|
46
|
+
export function firstNonFlagAfter(argv, from, valueFlags = new Set()) {
|
|
47
|
+
let i = from + 1;
|
|
48
|
+
while (i < argv.length) {
|
|
49
|
+
const t = argv[i];
|
|
50
|
+
if (!t) {
|
|
51
|
+
i += 1;
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (t.startsWith("-")) {
|
|
55
|
+
// For `--flag=value` the value is part of the token; skip just one.
|
|
56
|
+
// For `--flag value` where the flag is in our value-flag set, skip
|
|
57
|
+
// both the flag and the next token.
|
|
58
|
+
if (!t.includes("=") && valueFlags.has(t)) {
|
|
59
|
+
i += 2;
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
i += 1;
|
|
63
|
+
}
|
|
64
|
+
continue;
|
|
65
|
+
}
|
|
66
|
+
return t;
|
|
67
|
+
}
|
|
68
|
+
return undefined;
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* Print the result of a superuser rotation. The password is only present
|
|
72
|
+
* when the user explicitly opted in with `--reveal`; without it the CLI
|
|
73
|
+
* confirms the rotation but doesn't print any credential.
|
|
74
|
+
*/
|
|
75
|
+
export async function printSuperuserResetResult(ctx, result) {
|
|
76
|
+
await writeLine(ctx, `${pc.green("✓")} ${result.message}`);
|
|
77
|
+
if (result.password) {
|
|
78
|
+
await writeLine(ctx, "");
|
|
79
|
+
await writeLine(ctx, ` ${pc.bold("Email:")} ${result.email}`);
|
|
80
|
+
await writeLine(ctx, ` ${pc.bold("Password:")} ${result.password}`);
|
|
81
|
+
await writeLine(ctx, "");
|
|
82
|
+
await writeLine(ctx, pc.yellow(" ⚠ This password is shown only once. Save it now if you need it."));
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
/**
|
|
86
|
+
* Shared body of the `deploys inspect [id]` command. Extracted so the
|
|
87
|
+
* subcommand-dispatch path in the parent `deploys` action can reuse it
|
|
88
|
+
* without duplicating output formatting.
|
|
89
|
+
*/
|
|
90
|
+
export async function runDeploysInspect(ctx, input) {
|
|
91
|
+
const result = await core.deploysInspect(ctx, input);
|
|
92
|
+
const { deploy, buildLog } = result;
|
|
93
|
+
await writeLine(ctx, `${pc.bold("Deploy:")} ${deploy.id}`);
|
|
94
|
+
await writeLine(ctx, `${pc.bold("Status:")} ${formatStatus(deploy.status)}`);
|
|
95
|
+
if (deploy.type) {
|
|
96
|
+
await writeLine(ctx, `${pc.bold("Type:")} ${deploy.type}`);
|
|
97
|
+
}
|
|
98
|
+
await writeLine(ctx, `${pc.bold("Created:")} ${formatDeployTimestamp(deploy.createdAt)}`);
|
|
99
|
+
if (deploy.url) {
|
|
100
|
+
await writeLine(ctx, `${pc.bold("URL:")} ${deploy.url}`);
|
|
101
|
+
}
|
|
102
|
+
if (deploy.previewUrl) {
|
|
103
|
+
await writeLine(ctx, `${pc.bold("Preview:")} ${deploy.previewUrl}`);
|
|
104
|
+
}
|
|
105
|
+
if (deploy.errorMessage) {
|
|
106
|
+
await writeLine(ctx, "");
|
|
107
|
+
await writeLine(ctx, pc.bold(pc.red("Error:")));
|
|
108
|
+
for (const line of deploy.errorMessage.split("\n")) {
|
|
109
|
+
await writeLine(ctx, ` ${line}`);
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
if (buildLog) {
|
|
113
|
+
await writeLine(ctx, "");
|
|
114
|
+
const lines = buildLog.split("\n");
|
|
115
|
+
const tail = lines.slice(-200);
|
|
116
|
+
const header = lines.length > tail.length
|
|
117
|
+
? `${pc.bold("Build log")} ${pc.dim(`(last 200 of ${lines.length} lines)`)}`
|
|
118
|
+
: pc.bold("Build log");
|
|
119
|
+
await writeLine(ctx, header);
|
|
120
|
+
for (const line of tail) {
|
|
121
|
+
await writeLine(ctx, ` ${line}`);
|
|
122
|
+
}
|
|
123
|
+
}
|
|
124
|
+
else if (deploy.status === "failed" || deploy.status === "live") {
|
|
125
|
+
await writeLine(ctx, "");
|
|
126
|
+
await writeLine(ctx, pc.dim("(no build log available for this deploy)"));
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
//# sourceMappingURL=cli-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cli-utils.js","sourceRoot":"","sources":["../../src/cli-utils.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,MAAM,YAAY,CAAC;AAE5B,gGAAgG;AAChG,MAAM,OAAO,eAAe;IACL;IAArB,YAAqB,WAAmB,CAAC;QAApB,aAAQ,GAAR,QAAQ,CAAY;IAAG,CAAC;CAC9C;AAED,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,GAAY,EAAE,IAAY;IACxD,MAAM,MAAM,GAAG,GAAG,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC;IACtC,IAAI,CAAC;QACH,MAAM,MAAM,CAAC,KAAK,CAAC,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,CAAC,CAAC;IAC5D,CAAC;YAAS,CAAC;QACT,MAAM,CAAC,WAAW,EAAE,CAAC;IACvB,CAAC;AACH,CAAC;AAED,gFAAgF;AAChF,MAAM,UAAU,qBAAqB,CAAC,GAAW;IAC/C,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAAE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E,GAAG,EAAE,OAAO,GAAG,IAAI,CAuUpE"}
|
|
@@ -0,0 +1,280 @@
|
|
|
1
|
+
import * as core from "@percher/core";
|
|
2
|
+
import pc from "picocolors";
|
|
3
|
+
import { SilentExitError, writeLine } from "../cli-utils";
|
|
4
|
+
export function registerAccountCommands(cli, ctx) {
|
|
5
|
+
// cac matches commands by single first-token equality (see comment in
|
|
6
|
+
// github.ts). Multi-word `account export` / `account delete` would
|
|
7
|
+
// never match argv[0]="account", so dispatch via a parent `account
|
|
8
|
+
// [action] ...` and keep the multi-word registrations below for
|
|
9
|
+
// --help discoverability only.
|
|
10
|
+
cli
|
|
11
|
+
.command("account [action] [...rest]", "Account management: export (GDPR data portability) | delete (GDPR erasure)")
|
|
12
|
+
.option("--out <file>", "(export only) Output file path")
|
|
13
|
+
.option("--include-app-data", "(export only) Also download per-app PocketBase tarballs (creates a directory)")
|
|
14
|
+
.option("--confirm <email>", "(delete only) Your email — must match the signed-in account")
|
|
15
|
+
.option("--yes", "(delete only) Skip the interactive confirmation prompt")
|
|
16
|
+
.action(async (action, _rest, options) => {
|
|
17
|
+
if (action === "export") {
|
|
18
|
+
if (!ctx.client.token) {
|
|
19
|
+
await writeLine(ctx, `${pc.red("✗")} Not logged in. Run: percher login`);
|
|
20
|
+
throw new SilentExitError();
|
|
21
|
+
}
|
|
22
|
+
const result = await core.accountExport(ctx, {
|
|
23
|
+
out: options.out,
|
|
24
|
+
includeAppData: options.includeAppData,
|
|
25
|
+
});
|
|
26
|
+
const kb = (result.bytes / 1024).toFixed(1);
|
|
27
|
+
await writeLine(ctx, `${pc.green("✓")} Exported ${kb} KB → ${result.path}`);
|
|
28
|
+
if (result.appTarballs && result.appTarballs.length > 0) {
|
|
29
|
+
for (const t of result.appTarballs) {
|
|
30
|
+
const mb = (t.bytes / 1024 / 1024).toFixed(1);
|
|
31
|
+
await writeLine(ctx, ` ${pc.green("✓")} ${t.app}: ${mb} MB → ${t.path}`);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
if (result.appTarballsFailed && result.appTarballsFailed.length > 0) {
|
|
35
|
+
for (const f of result.appTarballsFailed) {
|
|
36
|
+
await writeLine(ctx, ` ${pc.yellow("⚠")} ${f.app}: ${f.error} (skipped)`);
|
|
37
|
+
}
|
|
38
|
+
await writeLine(ctx, pc.yellow(`Export is partial — ${result.appTarballsFailed.length} app(s) could not be downloaded. Re-run after the rate-limit window to get the rest.`));
|
|
39
|
+
}
|
|
40
|
+
await writeLine(ctx, pc.dim("Note: encrypted env-var values are not included (only the keys + metadata). Build logs are excluded too — request via `percher logs` if needed."));
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
if (action === "delete") {
|
|
44
|
+
if (!ctx.client.token) {
|
|
45
|
+
await writeLine(ctx, `${pc.red("✗")} Not logged in. Run: percher login`);
|
|
46
|
+
throw new SilentExitError();
|
|
47
|
+
}
|
|
48
|
+
if (!options.confirm) {
|
|
49
|
+
await writeLine(ctx, `${pc.red("✗")} Pass --confirm <your-email> to proceed. This is a permanent, cascading delete.`);
|
|
50
|
+
throw new SilentExitError();
|
|
51
|
+
}
|
|
52
|
+
if (!options.yes) {
|
|
53
|
+
const answer = await ctx.prompt(`${pc.red("!")} This will permanently delete your account, all apps, deploys, env vars, domains, and shared access. Type "delete my account" to confirm:`);
|
|
54
|
+
if (answer.trim().toLowerCase() !== "delete my account") {
|
|
55
|
+
await writeLine(ctx, "Cancelled.");
|
|
56
|
+
return;
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
await core.accountDelete(ctx, { confirm: options.confirm });
|
|
60
|
+
await writeLine(ctx, `${pc.green("✓")} Account deleted.`);
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
throw new Error(`Unknown account action "${action ?? ""}". Use: export | delete.`);
|
|
64
|
+
});
|
|
65
|
+
// Help-only registrations. Unreachable in practice (cac falls through
|
|
66
|
+
// to the parent `account [action] ...` above), but kept so the help
|
|
67
|
+
// listing surfaces the GDPR rationale on each subcommand.
|
|
68
|
+
cli
|
|
69
|
+
.command("account export", "Download all data Percher stores about your account (GDPR Art. 20)")
|
|
70
|
+
.option("--out <file>", "Output file path (defaults to ./percher-export-<timestamp>.json)")
|
|
71
|
+
.option("--include-app-data", "Also download PocketBase data tarballs for every app (creates a directory instead of a single file)")
|
|
72
|
+
.action(async () => {
|
|
73
|
+
// Unreachable — handled by parent `account [action] ...` action.
|
|
74
|
+
});
|
|
75
|
+
cli
|
|
76
|
+
.command("account delete", "Permanently delete your account and all apps (GDPR Art. 17)")
|
|
77
|
+
.option("--confirm <email>", "Your email address — must match the signed-in account")
|
|
78
|
+
.option("--yes", "Skip the interactive confirmation prompt (still requires --confirm)")
|
|
79
|
+
.action(async () => {
|
|
80
|
+
// Unreachable — handled by parent `account [action] ...` action.
|
|
81
|
+
});
|
|
82
|
+
cli
|
|
83
|
+
.command("mcp", "Print the MCP server config for AI assistants (Claude Code, Cursor, Windsurf)")
|
|
84
|
+
.option("--json", "Output JSON only (paste-ready)")
|
|
85
|
+
.action(async (options) => {
|
|
86
|
+
const result = core.mcp(ctx, {});
|
|
87
|
+
if (options.json) {
|
|
88
|
+
await writeLine(ctx, JSON.stringify(result.config, null, 2));
|
|
89
|
+
return;
|
|
90
|
+
}
|
|
91
|
+
await writeLine(ctx, pc.bold("Percher MCP server"));
|
|
92
|
+
await writeLine(ctx, pc.dim("Add this entry to your MCP-aware client:"));
|
|
93
|
+
await writeLine(ctx, "");
|
|
94
|
+
await writeLine(ctx, JSON.stringify(result.config, null, 2));
|
|
95
|
+
await writeLine(ctx, "");
|
|
96
|
+
await writeLine(ctx, pc.bold("Where to paste:"));
|
|
97
|
+
for (const loc of result.installLocations) {
|
|
98
|
+
await writeLine(ctx, ` ${loc.client.padEnd(28)} ${pc.dim(loc.path)}`);
|
|
99
|
+
}
|
|
100
|
+
await writeLine(ctx, "");
|
|
101
|
+
await writeLine(ctx, pc.dim("Once installed, your assistant gets percher_publish + 28 other tools."));
|
|
102
|
+
});
|
|
103
|
+
cli
|
|
104
|
+
.command("ai-files <action>", "Manage AI-assistant rules files (install | update | status | remove)")
|
|
105
|
+
.option("--force", "Overwrite or remove user-modified / foreign files")
|
|
106
|
+
.option("--json", "Output JSON")
|
|
107
|
+
.action(async (action, options) => {
|
|
108
|
+
if (action === "install") {
|
|
109
|
+
const r = await core.aiFilesInstall(ctx, { force: options.force });
|
|
110
|
+
if (options.json) {
|
|
111
|
+
await writeLine(ctx, JSON.stringify(r, null, 2));
|
|
112
|
+
return;
|
|
113
|
+
}
|
|
114
|
+
for (const i of r.installed) {
|
|
115
|
+
await writeLine(ctx, `${pc.green("✓")} installed ${i.path} (v${i.templateVersion})`);
|
|
116
|
+
}
|
|
117
|
+
for (const s of r.skipped) {
|
|
118
|
+
const why = s.reason === "already-installed"
|
|
119
|
+
? "already installed"
|
|
120
|
+
: s.reason === "modified"
|
|
121
|
+
? "user-modified — use --force to overwrite"
|
|
122
|
+
: "foreign file — use --force to overwrite";
|
|
123
|
+
await writeLine(ctx, `${pc.yellow("!")} skipped ${s.path}: ${why}`);
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
else if (action === "update") {
|
|
127
|
+
const r = await core.aiFilesUpdate(ctx, { force: options.force });
|
|
128
|
+
if (options.json) {
|
|
129
|
+
await writeLine(ctx, JSON.stringify(r, null, 2));
|
|
130
|
+
return;
|
|
131
|
+
}
|
|
132
|
+
for (const u of r.updated) {
|
|
133
|
+
const tag = u.reason === "reinstalled" ? "reinstalled" : `${u.from ?? "new"} → ${u.to}`;
|
|
134
|
+
await writeLine(ctx, `${pc.green("✓")} updated ${u.path} (${tag})`);
|
|
135
|
+
}
|
|
136
|
+
for (const s of r.skipped) {
|
|
137
|
+
const why = s.reason === "up-to-date"
|
|
138
|
+
? "up to date"
|
|
139
|
+
: s.reason === "modified"
|
|
140
|
+
? "user-modified — use --force to overwrite"
|
|
141
|
+
: s.reason === "foreign"
|
|
142
|
+
? "foreign file"
|
|
143
|
+
: "no manifest entry";
|
|
144
|
+
await writeLine(ctx, `${pc.dim(`· ${s.path}: ${why}`)}`);
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
else if (action === "status") {
|
|
148
|
+
const r = await core.aiFilesStatus(ctx, {});
|
|
149
|
+
if (options.json) {
|
|
150
|
+
await writeLine(ctx, JSON.stringify(r, null, 2));
|
|
151
|
+
return;
|
|
152
|
+
}
|
|
153
|
+
await writeLine(ctx, pc.bold("AI files"));
|
|
154
|
+
for (const f of r.files) {
|
|
155
|
+
const icon = f.status === "managed"
|
|
156
|
+
? pc.green("✓")
|
|
157
|
+
: f.status === "modified"
|
|
158
|
+
? pc.yellow("!")
|
|
159
|
+
: f.status === "missing"
|
|
160
|
+
? pc.dim("·")
|
|
161
|
+
: pc.red("✗");
|
|
162
|
+
const versionTag = f.installedVersion && f.installedVersion !== f.latestVersion
|
|
163
|
+
? pc.yellow(` (v${f.installedVersion} → v${f.latestVersion})`)
|
|
164
|
+
: f.installedVersion
|
|
165
|
+
? pc.dim(` (v${f.installedVersion})`)
|
|
166
|
+
: pc.dim(` (latest v${f.latestVersion})`);
|
|
167
|
+
await writeLine(ctx, ` ${icon} ${f.path.padEnd(40)} ${f.status}${versionTag}`);
|
|
168
|
+
}
|
|
169
|
+
}
|
|
170
|
+
else if (action === "remove") {
|
|
171
|
+
const r = await core.aiFilesRemove(ctx, { force: options.force });
|
|
172
|
+
if (options.json) {
|
|
173
|
+
await writeLine(ctx, JSON.stringify(r, null, 2));
|
|
174
|
+
return;
|
|
175
|
+
}
|
|
176
|
+
for (const x of r.removed) {
|
|
177
|
+
await writeLine(ctx, `${pc.green("✓")} removed ${x.path}`);
|
|
178
|
+
}
|
|
179
|
+
for (const s of r.skipped) {
|
|
180
|
+
await writeLine(ctx, `${pc.yellow("!")} skipped ${s.path}: ${s.reason}${s.reason === "modified" ? " — use --force to delete" : ""}`);
|
|
181
|
+
}
|
|
182
|
+
}
|
|
183
|
+
else {
|
|
184
|
+
throw new Error(`Unknown ai-files action "${action}". Use install | update | status | remove.`);
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
cli
|
|
188
|
+
.command("import", "Convert Vercel or Netlify config to percher.toml")
|
|
189
|
+
.option("--from <provider>", "Provider: vercel | netlify (auto-detected if omitted)")
|
|
190
|
+
.action(async (options) => {
|
|
191
|
+
const result = await core.importProject(ctx, {
|
|
192
|
+
from: options.from,
|
|
193
|
+
});
|
|
194
|
+
if (result.configGenerated) {
|
|
195
|
+
await writeLine(ctx, `${pc.green("✓")} Imported from ${result.provider} — percher.toml generated`);
|
|
196
|
+
}
|
|
197
|
+
for (const w of result.warnings) {
|
|
198
|
+
await writeLine(ctx, `${pc.yellow("!")} ${w}`);
|
|
199
|
+
}
|
|
200
|
+
if (result.envVars.length > 0) {
|
|
201
|
+
await writeLine(ctx, "");
|
|
202
|
+
await writeLine(ctx, "Set these env vars before publishing:");
|
|
203
|
+
for (const v of result.envVars) {
|
|
204
|
+
await writeLine(ctx, ` bunx percher env set ${v}=your-value`);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
if (result.configGenerated) {
|
|
208
|
+
await writeLine(ctx, "");
|
|
209
|
+
await writeLine(ctx, "Next: review percher.toml, then run:");
|
|
210
|
+
await writeLine(ctx, " bunx percher publish");
|
|
211
|
+
}
|
|
212
|
+
});
|
|
213
|
+
cli
|
|
214
|
+
.command("domains <action> [domain]", "Manage custom domains (add | verify | list | remove)")
|
|
215
|
+
.option("--app <name>", "App name (overrides percher.toml)")
|
|
216
|
+
.action(async (action, domain, options) => {
|
|
217
|
+
if (action === "add") {
|
|
218
|
+
if (!domain)
|
|
219
|
+
throw new Error("Domain is required. Usage: percher domains add <domain>");
|
|
220
|
+
const result = await core.domainAdd(ctx, { app: options.app, domain });
|
|
221
|
+
await writeLine(ctx, `${pc.green("✓")} Domain ${result.domain} added.`);
|
|
222
|
+
await writeLine(ctx, "");
|
|
223
|
+
await writeLine(ctx, `Add these DNS records ${result.dnsInstructions.kind === "apex" ? "(this is a root/apex domain — most providers reject CNAME on apex per RFC 1034, use A-record)" : "(this is a subdomain — CNAME works everywhere)"}:`);
|
|
224
|
+
await writeLine(ctx, ` TXT ${result.dnsInstructions.txt.name} ${result.dnsInstructions.txt.value}`);
|
|
225
|
+
const primary = result.dnsInstructions.primary;
|
|
226
|
+
if (primary.type === "A") {
|
|
227
|
+
await writeLine(ctx, ` A ${primary.name} ${primary.values.join(", ")}`);
|
|
228
|
+
}
|
|
229
|
+
else {
|
|
230
|
+
await writeLine(ctx, ` CNAME ${primary.name} ${primary.value}`);
|
|
231
|
+
}
|
|
232
|
+
if (result.dnsInstructions.alternative) {
|
|
233
|
+
const alt = result.dnsInstructions.alternative;
|
|
234
|
+
await writeLine(ctx, "");
|
|
235
|
+
await writeLine(ctx, " Alternative (only for Cloudflare/Route53 with CNAME-flattening):");
|
|
236
|
+
if (alt.type === "A") {
|
|
237
|
+
await writeLine(ctx, ` A ${alt.name} ${alt.values.join(", ")}`);
|
|
238
|
+
}
|
|
239
|
+
else {
|
|
240
|
+
await writeLine(ctx, ` CNAME ${alt.name} ${alt.value}`);
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
await writeLine(ctx, "");
|
|
244
|
+
await writeLine(ctx, "Then run:");
|
|
245
|
+
await writeLine(ctx, ` percher domains verify ${result.domain}${options.app ? ` --app ${options.app}` : ""}`);
|
|
246
|
+
}
|
|
247
|
+
else if (action === "verify") {
|
|
248
|
+
if (!domain)
|
|
249
|
+
throw new Error("Domain is required. Usage: percher domains verify <domain>");
|
|
250
|
+
const result = await core.domainVerify(ctx, { app: options.app, domain });
|
|
251
|
+
if (result.status === "verified") {
|
|
252
|
+
await writeLine(ctx, `${pc.green("✓")} Domain verified. ${result.domain} is now live.`);
|
|
253
|
+
}
|
|
254
|
+
else {
|
|
255
|
+
await writeLine(ctx, `${pc.yellow("!")} ${result.domain}: ${result.failureReason}`);
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
else if (action === "list") {
|
|
259
|
+
const list = await core.domainList(ctx, { app: options.app });
|
|
260
|
+
if (list.length === 0) {
|
|
261
|
+
await writeLine(ctx, "No custom domains.");
|
|
262
|
+
}
|
|
263
|
+
else {
|
|
264
|
+
for (const d of list) {
|
|
265
|
+
await writeLine(ctx, `${d.domain.padEnd(40)} ${d.status}`);
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
else if (action === "remove") {
|
|
270
|
+
if (!domain)
|
|
271
|
+
throw new Error("Domain is required. Usage: percher domains remove <domain>");
|
|
272
|
+
await core.domainRemove(ctx, { app: options.app, domain });
|
|
273
|
+
await writeLine(ctx, `${pc.green("✓")} Domain removed.`);
|
|
274
|
+
}
|
|
275
|
+
else {
|
|
276
|
+
throw new Error(`Unknown domains action "${action}". Use add | verify | list | remove.`);
|
|
277
|
+
}
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
//# sourceMappingURL=account.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"account.js","sourceRoot":"","sources":["../../../src/commands/account.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,IAAI,MAAM,eAAe,CAAC;AAEtC,OAAO,EAAE,MAAM,YAAY,CAAC;AAC5B,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAE1D,MAAM,UAAU,uBAAuB,CAAC,GAAQ,EAAE,GAAY;IAC5D,sEAAsE;IACtE,mEAAmE;IACnE,mEAAmE;IACnE,gEAAgE;IAChE,+BAA+B;IAC/B,GAAG;SACA,OAAO,CACN,4BAA4B,EAC5B,4EAA4E,CAC7E;SACA,MAAM,CAAC,cAAc,EAAE,gCAAgC,CAAC;SACxD,MAAM,CACL,oBAAoB,EACpB,+EAA+E,CAChF;SACA,MAAM,CAAC,mBAAmB,EAAE,6DAA6D,CAAC;SAC1F,MAAM,CAAC,OAAO,EAAE,wDAAwD,CAAC;SACzE,MAAM,CACL,KAAK,EACH,MAA0B,EAC1B,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E,CAAC;gBACtB,MAAM,SAAS,CAAC,GAAG,EAAE,oBAAoB,CAAC,CAAC;YAC7C,CAAC;iBAAM,CAAC;gBACN,KAAK,MAAM,CAAC,IAAI,IAAI,EAAE,CAAC;oBACrB,MAAM,SAAS,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC;gBAC7D,CAAC;YACH,CAAC;QACH,CAAC;aAAM,IAAI,MAAM,KAAK,QAAQ,EAAE,CAAC;YAC/B,IAAI,CAAC,MAAM;gBAAE,MAAM,IAAI,KAAK,CAAC,4DAA4D,CAAC,CAAC;YAC3F,MAAM,IAAI,CAAC,YAAY,CAAC,GAAG,EAAE,EAAE,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,MAAM,EAAE,CAAC,CAAC;YAC3D,MAAM,SAAS,CAAC,GAAG,EAAE,GAAG,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC;QAC3D,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,KAAK,CAAC,2BAA2B,MAAM,sCAAsC,CAAC,CAAC;QAC3F,CAAC;IACH,CAAC,CAAC,CAAC;AACP,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Context, PublishResult } from "@percher/core";
|
|
2
|
+
import type { CAC } from "cac";
|
|
3
|
+
/**
|
|
4
|
+
* Render a `PublishResult` to the CLI. Extracted so a unit test can
|
|
5
|
+
* exercise the exhaustive switch with a synthesised out-of-union status
|
|
6
|
+
* (cast through `unknown`) without needing to mock the entire publish
|
|
7
|
+
* pipeline.
|
|
8
|
+
*/
|
|
9
|
+
export declare function handlePublishResult(ctx: Context, result: PublishResult, options?: {
|
|
10
|
+
preview?: boolean;
|
|
11
|
+
}): Promise<void>;
|
|
12
|
+
export declare function registerAppsCommands(cli: CAC, ctx: Context): void;
|
|
13
|
+
//# sourceMappingURL=apps.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"apps.d.ts","sourceRoot":"","sources":["../../../src/commands/apps.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,aAAa,EAAE,MAAM,eAAe,CAAC;AAE5D,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AA0B/B;;;;;GAKG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,OAAO,EACZ,MAAM,EAAE,aAAa,EACrB,OAAO,GAAE;IAAE,OAAO,CAAC,EAAE,OAAO,CAAA;CAAO,GAClC,OAAO,CAAC,IAAI,CAAC,CA+Lf;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,OAAO,GAAG,IAAI,CA8TjE"}
|