frontpage-host 0.1.0 → 0.1.1
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/AGENTS.md +159 -0
- package/README.md +56 -0
- package/dist/bin.js +32 -5
- package/dist/commands/deploy.js +18 -9
- package/dist/commands/diff.js +33 -23
- package/dist/commands/doctor.js +34 -9
- package/dist/commands/help.js +70 -9
- package/dist/commands/history.js +10 -7
- package/dist/commands/ls.js +7 -3
- package/dist/commands/open.js +16 -12
- package/dist/commands/pages.js +10 -5
- package/dist/commands/prompt.js +13 -10
- package/dist/commands/publish.js +21 -9
- package/dist/commands/pull.js +21 -11
- package/dist/commands/push.js +15 -7
- package/dist/commands/revert.js +15 -10
- package/dist/commands/runs.js +52 -24
- package/dist/commands/sites.js +8 -3
- package/dist/commands/status.js +20 -5
- package/dist/commands/whoami.js +12 -6
- package/dist/completions/generate.js +5 -4
- package/dist/flags.d.ts +13 -0
- package/dist/flags.js +31 -0
- package/dist/registry.d.ts +5 -0
- package/dist/registry.js +325 -46
- package/dist/runtime.d.ts +22 -0
- package/dist/runtime.js +73 -0
- package/llms.txt +12 -0
- package/package.json +5 -2
package/dist/registry.js
CHANGED
|
@@ -3,43 +3,304 @@
|
|
|
3
3
|
* Only shipped Phase 0–5 commands appear here.
|
|
4
4
|
*/
|
|
5
5
|
export const COMMANDS = [
|
|
6
|
-
{
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
{
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
{
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
{
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
{
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
6
|
+
{
|
|
7
|
+
name: "help",
|
|
8
|
+
summary: "Show available commands",
|
|
9
|
+
usage: "frontpage help [command|topic] [--json]",
|
|
10
|
+
topics: ["auth", "sync", "agent", "content", "history", "isolation", "exit-codes", "quickstart"],
|
|
11
|
+
examples: ["frontpage help", "frontpage help sync", "frontpage help push", "frontpage help --json"],
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
name: "login",
|
|
15
|
+
summary: "Save an API key to the OS keychain",
|
|
16
|
+
usage: "frontpage login [api-key]",
|
|
17
|
+
topics: ["auth"],
|
|
18
|
+
examples: ['frontpage login', 'frontpage login "$FRONTPAGE_API_KEY"'],
|
|
19
|
+
flags: ["FRONTPAGE_API_KEY env overrides keychain after login for that process"],
|
|
20
|
+
seeAlso: ["whoami", "doctor", "logout"],
|
|
21
|
+
},
|
|
22
|
+
{
|
|
23
|
+
name: "logout",
|
|
24
|
+
summary: "Remove the saved API key",
|
|
25
|
+
usage: "frontpage logout",
|
|
26
|
+
topics: ["auth"],
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
name: "whoami",
|
|
30
|
+
summary: "Show the identity for the current API key",
|
|
31
|
+
usage: "frontpage whoami [--json]",
|
|
32
|
+
topics: ["auth"],
|
|
33
|
+
},
|
|
34
|
+
{
|
|
35
|
+
name: "sites",
|
|
36
|
+
summary: "List sites your key can access",
|
|
37
|
+
usage: "frontpage sites [--json]",
|
|
38
|
+
topics: ["auth"],
|
|
39
|
+
examples: ["frontpage sites", "frontpage sites --json"],
|
|
40
|
+
seeAlso: ["use"],
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: "use",
|
|
44
|
+
summary: "Set the default site subdomain for this folder",
|
|
45
|
+
usage: "frontpage use <subdomain>",
|
|
46
|
+
topics: ["auth", "sync"],
|
|
47
|
+
examples: ["frontpage use arbiter"],
|
|
48
|
+
dangers: ["Clears baseCommitSha when switching sites — run pull again before push"],
|
|
49
|
+
seeAlso: ["link", "pull", "status"],
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
name: "link",
|
|
53
|
+
summary: "Alias for use",
|
|
54
|
+
usage: "frontpage link <subdomain>",
|
|
55
|
+
topics: ["auth", "sync"],
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
name: "doctor",
|
|
59
|
+
summary: "Check CLI auth and API connectivity",
|
|
60
|
+
usage: "frontpage doctor [--json]",
|
|
61
|
+
topics: ["auth"],
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "pull",
|
|
65
|
+
summary: "Download allowlisted site files into this folder",
|
|
66
|
+
usage: "frontpage pull [--site <slug>] [--json]",
|
|
67
|
+
topics: ["sync"],
|
|
68
|
+
examples: ["frontpage pull", "frontpage pull --site arbiter --json"],
|
|
69
|
+
flags: ["--site <slug>"],
|
|
70
|
+
seeAlso: ["push", "status", "diff"],
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: "push",
|
|
74
|
+
summary: "Upload local allowlisted files (CAS + active-run guard)",
|
|
75
|
+
usage: "frontpage push [--site <slug>] [--message …] [--json]",
|
|
76
|
+
topics: ["sync"],
|
|
77
|
+
examples: ['frontpage push --message "Update hero copy"'],
|
|
78
|
+
flags: ["--site <slug>", "--message <text>"],
|
|
79
|
+
dangers: [
|
|
80
|
+
"Requires prior pull (baseCommitSha)",
|
|
81
|
+
"Refused while an agent run is active (exit 3)",
|
|
82
|
+
"CAS fail if remote tip moved (exit 3) — pull and retry",
|
|
83
|
+
"May auto-activate modules when markup references them",
|
|
84
|
+
],
|
|
85
|
+
seeAlso: ["pull", "diff", "status", "deploy"],
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
name: "diff",
|
|
89
|
+
summary: "Compare local allowlisted files to the remote tip",
|
|
90
|
+
usage: "frontpage diff [--site <slug>] [--json]",
|
|
91
|
+
topics: ["sync"],
|
|
92
|
+
examples: ["frontpage diff --json"],
|
|
93
|
+
flags: ["--site <slug>", "JSON data.dirty is true when differences exist"],
|
|
94
|
+
},
|
|
95
|
+
{
|
|
96
|
+
name: "ls",
|
|
97
|
+
summary: "List remote allowlisted files",
|
|
98
|
+
usage: "frontpage ls [prefix] [--site <slug>] [--json]",
|
|
99
|
+
topics: ["sync"],
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
name: "cat",
|
|
103
|
+
summary: "Print a remote file",
|
|
104
|
+
usage: "frontpage cat <path> [--site <slug>]",
|
|
105
|
+
topics: ["sync"],
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
name: "search",
|
|
109
|
+
summary: "Search remote text files",
|
|
110
|
+
usage: "frontpage search <pattern> [path] [--site <slug>]",
|
|
111
|
+
topics: ["sync"],
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
name: "status",
|
|
115
|
+
summary: "Show linked site and tip vs last pull",
|
|
116
|
+
usage: "frontpage status [--site <slug>] [--json]",
|
|
117
|
+
topics: ["sync"],
|
|
118
|
+
},
|
|
119
|
+
{
|
|
120
|
+
name: "open",
|
|
121
|
+
summary: "Open the site subdomain in a browser",
|
|
122
|
+
usage: "frontpage open [--site <slug>] [--prod]",
|
|
123
|
+
topics: ["sync"],
|
|
124
|
+
flags: ["--prod is a no-op stub today — always opens https://<slug>.frontpage.host/"],
|
|
125
|
+
},
|
|
126
|
+
{
|
|
127
|
+
name: "prompt",
|
|
128
|
+
summary: "Enqueue an agent build",
|
|
129
|
+
usage: 'frontpage prompt "..." [--site <slug>] [--path /] [--json]',
|
|
130
|
+
topics: ["agent"],
|
|
131
|
+
examples: ['frontpage prompt "make the hero shorter"'],
|
|
132
|
+
flags: ["--path must start with /", "stdout is bare runId (or JSON with --json)"],
|
|
133
|
+
seeAlso: ["runs", "deploy"],
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
name: "runs",
|
|
137
|
+
summary: "List, wait, cancel, or retry agent runs",
|
|
138
|
+
usage: "frontpage runs [list|current|wait|cancel|retry|get] [runId] [--site <slug>] [--json]",
|
|
139
|
+
topics: ["agent"],
|
|
140
|
+
examples: [
|
|
141
|
+
"frontpage runs",
|
|
142
|
+
"frontpage runs wait",
|
|
143
|
+
"frontpage runs wait <runId>",
|
|
144
|
+
"frontpage runs cancel <runId>",
|
|
145
|
+
"frontpage runs retry <runId>",
|
|
146
|
+
"frontpage runs get <runId>",
|
|
147
|
+
],
|
|
148
|
+
flags: ["There is no runs continue — mid-task continuation is automatic"],
|
|
149
|
+
seeAlso: ["prompt", "deploy"],
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
name: "publish",
|
|
153
|
+
summary: "Promote staging to production",
|
|
154
|
+
usage: "frontpage publish [--site <slug>] [--json]",
|
|
155
|
+
topics: ["agent"],
|
|
156
|
+
dangers: ["Promotes the current staging tip to production"],
|
|
157
|
+
seeAlso: ["unpublish", "deploy"],
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
name: "unpublish",
|
|
161
|
+
summary: "Take the live site offline (admin)",
|
|
162
|
+
usage: "frontpage unpublish [--site <slug>] [--yes] [--json]",
|
|
163
|
+
topics: ["agent"],
|
|
164
|
+
dangers: ["Takes production offline", "Requires --yes when stdin is not a TTY"],
|
|
165
|
+
},
|
|
166
|
+
{
|
|
167
|
+
name: "deploy",
|
|
168
|
+
summary: "Wait for active agent deploy to finish",
|
|
169
|
+
usage: "frontpage deploy wait [--site <slug>] [--json]",
|
|
170
|
+
topics: ["agent"],
|
|
171
|
+
},
|
|
172
|
+
{
|
|
173
|
+
name: "usage",
|
|
174
|
+
summary: "Show plan and AI/bandwidth usage",
|
|
175
|
+
usage: "frontpage usage [--site <slug>]",
|
|
176
|
+
topics: ["agent"],
|
|
177
|
+
},
|
|
178
|
+
{
|
|
179
|
+
name: "analytics",
|
|
180
|
+
summary: "Show analytics dashboard JSON",
|
|
181
|
+
usage: "frontpage analytics [--days 7] [--site <slug>]",
|
|
182
|
+
topics: ["agent"],
|
|
183
|
+
},
|
|
184
|
+
{
|
|
185
|
+
name: "pages",
|
|
186
|
+
summary: "List site pages",
|
|
187
|
+
usage: "frontpage pages [--site <slug>] [--json]",
|
|
188
|
+
topics: ["agent"],
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
name: "modules",
|
|
192
|
+
summary: "List or mutate modules (secret masks only)",
|
|
193
|
+
usage: "frontpage modules [list|enable|disable|archive|config] <key> [--instance <id>] [--config '{…}'] [--site <slug>]",
|
|
194
|
+
topics: ["agent", "content"],
|
|
195
|
+
dangers: ["Secret values are never returned — masks only"],
|
|
196
|
+
},
|
|
197
|
+
{
|
|
198
|
+
name: "extensions",
|
|
199
|
+
summary: "List or mutate extensions (no secret values)",
|
|
200
|
+
usage: "frontpage extensions [list|enable|disable|config] <key> [--config '{…}'] [--site <slug>]",
|
|
201
|
+
topics: ["agent", "content"],
|
|
202
|
+
},
|
|
203
|
+
{
|
|
204
|
+
name: "media",
|
|
205
|
+
summary: "List or upload site media assets",
|
|
206
|
+
usage: "frontpage media list|upload <file> [--site <slug>]",
|
|
207
|
+
topics: ["content"],
|
|
208
|
+
},
|
|
209
|
+
{
|
|
210
|
+
name: "inbox",
|
|
211
|
+
summary: "List leads / subscribers / orders",
|
|
212
|
+
usage: "frontpage inbox [leads|subscribers|orders|…] [--mark-read] [--csv] [--site <slug>]",
|
|
213
|
+
topics: ["content"],
|
|
214
|
+
dangers: ["--mark-read is side-effecting with no confirm"],
|
|
215
|
+
},
|
|
216
|
+
{
|
|
217
|
+
name: "seo",
|
|
218
|
+
summary: "Get or set page SEO",
|
|
219
|
+
usage: "frontpage seo get|set --path / [--title …] [--description …] [--site <slug>]",
|
|
220
|
+
topics: ["content"],
|
|
221
|
+
},
|
|
222
|
+
{
|
|
223
|
+
name: "articles",
|
|
224
|
+
summary: "Articles hub, content, and section ops",
|
|
225
|
+
usage: "frontpage articles list|content|create-section|config-section|archive-section|restore-section|create-article|delete-article|set-draft|set-image|set-tags|set-seo|set-meta … [--site <slug>]",
|
|
226
|
+
topics: ["content"],
|
|
227
|
+
examples: [
|
|
228
|
+
"frontpage articles list",
|
|
229
|
+
"frontpage articles content get --section blog --article my-post",
|
|
230
|
+
"frontpage articles content set --section blog --article my-post --body '…' --base <sha>",
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
{
|
|
234
|
+
name: "settings",
|
|
235
|
+
summary: "Get or set site settings (admin)",
|
|
236
|
+
usage: "frontpage settings get|set [--subdomain-public true|false] [--usage-alerts true|false] [--build-model …] [--brand-name …] [--brand-logo …] [--brand-reset] [--site <slug>]",
|
|
237
|
+
topics: ["content"],
|
|
238
|
+
},
|
|
239
|
+
{
|
|
240
|
+
name: "edit",
|
|
241
|
+
summary: "Click-edit style exact text replace + deploy",
|
|
242
|
+
usage: 'frontpage edit --path / --old "…" --new "…" [--site <slug>]',
|
|
243
|
+
topics: ["content"],
|
|
244
|
+
dangers: [
|
|
245
|
+
"Exact single-occurrence replace (fails if 0 or 2+ matches)",
|
|
246
|
+
"Deploys via click-edit path — not the same as push / gated-write",
|
|
247
|
+
],
|
|
248
|
+
},
|
|
249
|
+
{
|
|
250
|
+
name: "history",
|
|
251
|
+
summary: "List recent commits on the site branch",
|
|
252
|
+
usage: "frontpage history [--limit N] [--page N] [--site <slug>] [--json]",
|
|
253
|
+
topics: ["history", "agent"],
|
|
254
|
+
flags: ["S = staging tip, P = production tip"],
|
|
255
|
+
},
|
|
256
|
+
{
|
|
257
|
+
name: "revert",
|
|
258
|
+
summary: "Restore site to a prior commit (tree restore + deploy)",
|
|
259
|
+
usage: "frontpage revert <40-char-sha> [--site <slug>] [--yes] [--json]",
|
|
260
|
+
topics: ["history"],
|
|
261
|
+
dangers: [
|
|
262
|
+
"Creates a NEW commit whose tree matches the target",
|
|
263
|
+
"Requires full 40-char SHA",
|
|
264
|
+
"Requires --yes when stdin is not a TTY",
|
|
265
|
+
"Refused while an agent run is active",
|
|
266
|
+
],
|
|
267
|
+
seeAlso: ["history"],
|
|
268
|
+
},
|
|
269
|
+
{
|
|
270
|
+
name: "completion",
|
|
271
|
+
summary: "Print shell completion script",
|
|
272
|
+
usage: "frontpage completion bash|zsh|fish",
|
|
273
|
+
topics: ["auth"],
|
|
274
|
+
},
|
|
275
|
+
];
|
|
276
|
+
export const TOPIC_NAMES = [
|
|
277
|
+
"quickstart",
|
|
278
|
+
"auth",
|
|
279
|
+
"sync",
|
|
280
|
+
"agent",
|
|
281
|
+
"content",
|
|
282
|
+
"history",
|
|
283
|
+
"isolation",
|
|
284
|
+
"exit-codes",
|
|
41
285
|
];
|
|
42
286
|
export const TOPICS = {
|
|
287
|
+
quickstart: `Quickstart
|
|
288
|
+
npm i -g frontpage-host # package name ≠ binary name
|
|
289
|
+
# Binary is: frontpage
|
|
290
|
+
# Do NOT install the unrelated npm package named "frontpage"
|
|
291
|
+
|
|
292
|
+
1. Create a key: Frontpage editor → profile → Developers (fp_live_…)
|
|
293
|
+
2. frontpage login # or: frontpage login "$FRONTPAGE_API_KEY"
|
|
294
|
+
3. frontpage sites # use the subdomain column
|
|
295
|
+
4. mkdir work && cd work && frontpage use <subdomain>
|
|
296
|
+
5. frontpage pull
|
|
297
|
+
6. Edit files under src/, public/, or content/
|
|
298
|
+
7. frontpage push --message "…"
|
|
299
|
+
8. frontpage deploy wait # staging
|
|
300
|
+
9. frontpage publish # optional: promote to production
|
|
301
|
+
|
|
302
|
+
Agents: read AGENTS.md in the npm package; use --json for structured I/O.
|
|
303
|
+
More: frontpage help auth | sync | agent | content | history | isolation | exit-codes`,
|
|
43
304
|
auth: `Authentication
|
|
44
305
|
1. Create a key in the Frontpage editor: profile menu → Developers
|
|
45
306
|
2. frontpage login
|
|
@@ -47,24 +308,27 @@ export const TOPICS = {
|
|
|
47
308
|
4. frontpage use <subdomain> (e.g. asimov-press, not a custom domain)
|
|
48
309
|
|
|
49
310
|
Keys act as you on every site you can access. Treat them like passwords.
|
|
50
|
-
Override with FRONTPAGE_API_KEY in CI
|
|
311
|
+
Override with FRONTPAGE_API_KEY in CI.
|
|
312
|
+
FRONTPAGE_API_BASE defaults to https://app.frontpage.host
|
|
313
|
+
PUBLIC_CLI_ENABLED is server-side — the CLI cannot enable it.`,
|
|
51
314
|
sync: `File sync
|
|
52
315
|
frontpage use <subdomain>
|
|
53
316
|
frontpage pull # downloads src/, public/, content/ into cwd
|
|
54
|
-
frontpage diff # local vs remote tip
|
|
317
|
+
frontpage diff # local vs remote tip (--json → data.dirty)
|
|
55
318
|
frontpage push [--message …] # uploads allowlisted files; CAS + active-run guard
|
|
56
319
|
frontpage ls [prefix]
|
|
57
320
|
frontpage cat <path>
|
|
58
321
|
frontpage search <pattern>
|
|
59
322
|
frontpage status
|
|
60
|
-
frontpage open
|
|
323
|
+
frontpage open # opens https://<slug>.frontpage.host/ (--prod is a no-op stub)
|
|
61
324
|
|
|
62
325
|
Local state: .frontpage/state.json { slug, baseCommitSha }
|
|
63
326
|
Pull first so push can compare-and-swap on baseCommitSha.
|
|
64
327
|
Do not push while the editor agent is building (status / runs show active work).
|
|
65
328
|
Pushing module markup may auto-activate modules (same as the agent).
|
|
66
329
|
tokens.ts may be auto-repaired at commit if it would break the build.
|
|
67
|
-
Binaries use base64 (not utf8-corrupted)
|
|
330
|
+
Binaries use base64 (not utf8-corrupted).
|
|
331
|
+
Push updates staging; use frontpage publish to promote production.`,
|
|
68
332
|
agent: `Agent + publish
|
|
69
333
|
frontpage prompt "make the hero shorter"
|
|
70
334
|
frontpage runs # latest + active
|
|
@@ -73,7 +337,7 @@ export const TOPICS = {
|
|
|
73
337
|
frontpage runs retry <runId>
|
|
74
338
|
frontpage deploy wait
|
|
75
339
|
frontpage publish
|
|
76
|
-
frontpage unpublish
|
|
340
|
+
frontpage unpublish --yes # admin only; --yes required when non-TTY
|
|
77
341
|
frontpage usage
|
|
78
342
|
frontpage analytics [--days 7]
|
|
79
343
|
frontpage pages
|
|
@@ -84,10 +348,10 @@ export const TOPICS = {
|
|
|
84
348
|
Do not push while an agent run is active.`,
|
|
85
349
|
content: `Content
|
|
86
350
|
frontpage media list|upload <file>
|
|
87
|
-
frontpage inbox [leads|subscribers|…] [--mark-read] [--csv]
|
|
351
|
+
frontpage inbox [leads|subscribers|orders|…] [--mark-read] [--csv]
|
|
88
352
|
frontpage seo get|set --path /
|
|
89
353
|
frontpage articles list|content|create-section|create-article|set-draft|…
|
|
90
|
-
frontpage modules enable|disable|config <key>
|
|
354
|
+
frontpage modules enable|disable|archive|config <key>
|
|
91
355
|
frontpage extensions enable|disable|config <key>
|
|
92
356
|
frontpage settings get|set
|
|
93
357
|
frontpage edit --path / --old "…" --new "…"
|
|
@@ -97,19 +361,34 @@ export const TOPICS = {
|
|
|
97
361
|
Domains, billing, members, and site delete are out of v1.`,
|
|
98
362
|
history: `History
|
|
99
363
|
frontpage history [--limit 20] [--page 1]
|
|
100
|
-
frontpage revert <40-char-sha>
|
|
364
|
+
frontpage revert <40-char-sha> --yes
|
|
101
365
|
|
|
102
366
|
history lists commits on site/<slug> (plan Time Machine window).
|
|
103
367
|
S = staging tip, P = production tip.
|
|
104
368
|
revert creates a NEW commit whose tree matches the target (linear restore).
|
|
105
369
|
Target SHA must be on this site's history (not another site in the monorepo).
|
|
106
|
-
Refused while an agent run is active. Goes through commitSiteBranch (build gate)
|
|
370
|
+
Refused while an agent run is active. Goes through commitSiteBranch (build gate).
|
|
371
|
+
--yes required when stdin is not a TTY.`,
|
|
372
|
+
isolation: `Isolation
|
|
373
|
+
Every site-scoped call targets subdomain → branch site/<slug> only.
|
|
374
|
+
No client-supplied branch, ref, repo, or clone URL is accepted.
|
|
375
|
+
Non-members get 404 (no site enumeration); under-privileged roles get 403.
|
|
376
|
+
Exit 4 on those 404s can mean "no access / not found", not only a bad key.
|
|
377
|
+
API keys never grant platform-admin fleet override.
|
|
378
|
+
Keys are account-wide: sharing a key shares that user's power on every site they can access.
|
|
379
|
+
Path allowlist only; GitHub tokens and remotes are never returned.
|
|
380
|
+
See also: frontpage help auth | sync`,
|
|
107
381
|
"exit-codes": `Exit codes
|
|
108
382
|
0 success
|
|
109
383
|
2 usage / budget / rate-limit / unavailable
|
|
110
384
|
3 conflict (CAS / active run / unreachable domain / cancel-while-deploying)
|
|
111
|
-
4 authentication or authorization failure
|
|
112
|
-
5 unexpected server or network error
|
|
385
|
+
4 authentication or authorization failure (also many 404s — no access / not found)
|
|
386
|
+
5 unexpected server or network error (including API disabled / PUBLIC_CLI_ENABLED)
|
|
387
|
+
|
|
388
|
+
Global --json envelope:
|
|
389
|
+
{ "ok": true, "command": "…", "data": {…} }
|
|
390
|
+
{ "ok": false, "command": "…", "error": { "message", "code?", "httpStatus?", "exitCode" } }
|
|
391
|
+
Failures with --json still use the process exit code; envelope is on stdout.`,
|
|
113
392
|
};
|
|
114
393
|
export function findCommand(name) {
|
|
115
394
|
return COMMANDS.find((c) => c.name === name);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export declare function setRuntimeFlags(flags: {
|
|
2
|
+
json?: boolean;
|
|
3
|
+
quiet?: boolean;
|
|
4
|
+
yes?: boolean;
|
|
5
|
+
}): void;
|
|
6
|
+
export declare function isJson(): boolean;
|
|
7
|
+
export declare function isQuiet(): boolean;
|
|
8
|
+
/** True when --yes was passed, or stdin is a TTY (interactive confirm not required). */
|
|
9
|
+
export declare function allowDestructive(): boolean;
|
|
10
|
+
export declare function requireYesOrTty(action: string): string | null;
|
|
11
|
+
export type JsonErrorBody = {
|
|
12
|
+
message: string;
|
|
13
|
+
code?: string;
|
|
14
|
+
httpStatus?: number;
|
|
15
|
+
exitCode: number;
|
|
16
|
+
};
|
|
17
|
+
export declare function emitOk(command: string, data: unknown): void;
|
|
18
|
+
export declare function emitErr(command: string, err: unknown): number;
|
|
19
|
+
export declare function emitUsage(command: string, message: string, exitCode?: number): number;
|
|
20
|
+
/** Progress / spinner lines — suppressed when --quiet or --json. */
|
|
21
|
+
export declare function progress(text: string): void;
|
|
22
|
+
export declare function unexpectedExit(): number;
|
package/dist/runtime.js
ADDED
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Process-global CLI runtime flags (set once from argv in bin.ts).
|
|
3
|
+
*/
|
|
4
|
+
import { CliHttpError, EXIT_UNEXPECTED, exitCodeForError } from "./http/client.js";
|
|
5
|
+
let jsonMode = false;
|
|
6
|
+
let quietMode = false;
|
|
7
|
+
let yesMode = false;
|
|
8
|
+
export function setRuntimeFlags(flags) {
|
|
9
|
+
if (flags.json !== undefined)
|
|
10
|
+
jsonMode = flags.json;
|
|
11
|
+
if (flags.quiet !== undefined)
|
|
12
|
+
quietMode = flags.quiet;
|
|
13
|
+
if (flags.yes !== undefined)
|
|
14
|
+
yesMode = flags.yes;
|
|
15
|
+
}
|
|
16
|
+
export function isJson() {
|
|
17
|
+
return jsonMode;
|
|
18
|
+
}
|
|
19
|
+
export function isQuiet() {
|
|
20
|
+
return quietMode;
|
|
21
|
+
}
|
|
22
|
+
/** True when --yes was passed, or stdin is a TTY (interactive confirm not required). */
|
|
23
|
+
export function allowDestructive() {
|
|
24
|
+
return yesMode || Boolean(process.stdin.isTTY);
|
|
25
|
+
}
|
|
26
|
+
export function requireYesOrTty(action) {
|
|
27
|
+
if (allowDestructive())
|
|
28
|
+
return null;
|
|
29
|
+
return `Refusing ${action} without --yes (non-interactive). Re-run with --yes if intentional.`;
|
|
30
|
+
}
|
|
31
|
+
export function emitOk(command, data) {
|
|
32
|
+
console.log(JSON.stringify({ ok: true, command, data }));
|
|
33
|
+
}
|
|
34
|
+
export function emitErr(command, err) {
|
|
35
|
+
const exitCode = exitCodeForError(err);
|
|
36
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
37
|
+
const body = { message, exitCode };
|
|
38
|
+
if (err instanceof CliHttpError) {
|
|
39
|
+
if (err.code)
|
|
40
|
+
body.code = err.code;
|
|
41
|
+
if (err.status)
|
|
42
|
+
body.httpStatus = err.status;
|
|
43
|
+
}
|
|
44
|
+
if (jsonMode) {
|
|
45
|
+
console.log(JSON.stringify({ ok: false, command, error: body }));
|
|
46
|
+
}
|
|
47
|
+
else {
|
|
48
|
+
console.error(message);
|
|
49
|
+
}
|
|
50
|
+
return exitCode;
|
|
51
|
+
}
|
|
52
|
+
export function emitUsage(command, message, exitCode = 2) {
|
|
53
|
+
if (jsonMode) {
|
|
54
|
+
console.log(JSON.stringify({
|
|
55
|
+
ok: false,
|
|
56
|
+
command,
|
|
57
|
+
error: { message, exitCode },
|
|
58
|
+
}));
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
console.error(message);
|
|
62
|
+
}
|
|
63
|
+
return exitCode;
|
|
64
|
+
}
|
|
65
|
+
/** Progress / spinner lines — suppressed when --quiet or --json. */
|
|
66
|
+
export function progress(text) {
|
|
67
|
+
if (quietMode || jsonMode)
|
|
68
|
+
return;
|
|
69
|
+
process.stderr.write(text);
|
|
70
|
+
}
|
|
71
|
+
export function unexpectedExit() {
|
|
72
|
+
return EXIT_UNEXPECTED;
|
|
73
|
+
}
|
package/llms.txt
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# Frontpage CLI (frontpage-host)
|
|
2
|
+
|
|
3
|
+
- Package: frontpage-host (npm). Binary: frontpage. Do NOT install npm package "frontpage".
|
|
4
|
+
- Docs in this package: README.md, AGENTS.md (agent operating manual).
|
|
5
|
+
- Introspect: frontpage help | frontpage help --json | frontpage help <topic|command>
|
|
6
|
+
- Topics: quickstart, auth, sync, agent, content, history, isolation, exit-codes
|
|
7
|
+
- Auth: mint fp_live_ key in Frontpage UI (Developers); frontpage login KEY or FRONTPAGE_API_KEY
|
|
8
|
+
- Site id: subdomain only (frontpage use <subdomain>). Not custom domains.
|
|
9
|
+
- Sync: allowlist src/ public/ content/; pull → edit → push (CAS baseCommitSha); no push during active agent run
|
|
10
|
+
- Staging after push/prompt; frontpage publish promotes to production
|
|
11
|
+
- Machine: global --json / --quiet; exit 0/2/3/4/5 (see help exit-codes)
|
|
12
|
+
- No runs continue, domains, billing, members, MCP, or git remotes in v1
|
package/package.json
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "frontpage-host",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.1",
|
|
4
4
|
"description": "Frontpage CLI — manage your site from the terminal",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
7
7
|
"frontpage": "dist/bin.js"
|
|
8
8
|
},
|
|
9
9
|
"files": [
|
|
10
|
-
"dist"
|
|
10
|
+
"dist",
|
|
11
|
+
"README.md",
|
|
12
|
+
"AGENTS.md",
|
|
13
|
+
"llms.txt"
|
|
11
14
|
],
|
|
12
15
|
"scripts": {
|
|
13
16
|
"build": "tsc -p tsconfig.json",
|