pagecast 0.1.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/.codex/skills/publish-report/SKILL.md +140 -0
- package/.codex/skills/publish-report/agents/openai.yaml +7 -0
- package/LICENSE +21 -0
- package/README.md +318 -0
- package/llms.txt +50 -0
- package/package.json +51 -0
- package/plugin/.claude-plugin/plugin.json +10 -0
- package/plugin/README.md +99 -0
- package/plugin/hooks/detect-report.mjs +109 -0
- package/plugin/hooks/hooks.json +16 -0
- package/plugin/skills/publish-report/SKILL.md +117 -0
- package/public/assets/code-mirror-html-CwFouvGT.js +24 -0
- package/public/assets/dnd-vendor-BtfBOykZ.js +1 -0
- package/public/assets/index-BTCh8CIt.js +54 -0
- package/public/assets/index-XOrnLHdD.css +1 -0
- package/public/assets/inter-latin-400-normal-C38fXH4l.woff2 +0 -0
- package/public/assets/inter-latin-400-normal-CyCys3Eg.woff +0 -0
- package/public/assets/inter-latin-500-normal-BL9OpVg8.woff +0 -0
- package/public/assets/inter-latin-500-normal-Cerq10X2.woff2 +0 -0
- package/public/assets/inter-latin-600-normal-CiBQ2DWP.woff +0 -0
- package/public/assets/inter-latin-600-normal-LgqL8muc.woff2 +0 -0
- package/public/assets/inter-latin-700-normal-BLAVimhd.woff +0 -0
- package/public/assets/inter-latin-700-normal-Yt3aPRUw.woff2 +0 -0
- package/public/assets/motion-vendor-CDgKLzlB.js +9 -0
- package/public/index.html +16 -0
- package/src/cli.js +333 -0
- package/src/markdown.js +0 -0
- package/src/server.js +3918 -0
|
@@ -0,0 +1,140 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: publish-report
|
|
3
|
+
description: Publish finished local HTML, Markdown, or built static web projects with Pagecast. Use when the user asks Codex to publish, share, make a public link for, or send a local report/doc/dashboard/web project from terminal, Codex CLI, or Codex desktop, or when Codex has just created a substantial shareable .html, .htm, .md, .markdown, or static build output.
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# Publish With Pagecast
|
|
7
|
+
|
|
8
|
+
## Overview
|
|
9
|
+
|
|
10
|
+
Use Pagecast to turn a finished local artifact into a shareable public URL backed
|
|
11
|
+
by the user's Cloudflare Pages project. Prefer `pagecast publish <file>` for
|
|
12
|
+
reports, docs, and built entry files. Use `pagecast publish site <dir>` only when
|
|
13
|
+
the user intentionally wants to deploy a whole static folder to a named
|
|
14
|
+
Cloudflare Pages project.
|
|
15
|
+
|
|
16
|
+
Never publish without explicit confirmation. Publishing makes the selected
|
|
17
|
+
artifact publicly reachable.
|
|
18
|
+
|
|
19
|
+
## What To Publish
|
|
20
|
+
|
|
21
|
+
Offer once for finished, shareable artifacts:
|
|
22
|
+
|
|
23
|
+
- HTML reports, dashboards, coverage reports, Playwright/Lighthouse output, or
|
|
24
|
+
static single-page mini apps.
|
|
25
|
+
- Markdown reports, plans, docs, proposals, release notes, or summaries meant to
|
|
26
|
+
be read by someone else.
|
|
27
|
+
- Static web projects after they are built. Publish the generated entry file,
|
|
28
|
+
usually `dist/index.html`, `build/index.html`, `out/index.html`, or
|
|
29
|
+
`public/index.html`; Pagecast stages sibling assets from that output folder.
|
|
30
|
+
|
|
31
|
+
Do not offer for scratch notes, source files, repo metadata, README/CHANGELOG,
|
|
32
|
+
AGENTS.md/CLAUDE.md, task files, secrets, config files, dependency/build folders,
|
|
33
|
+
hidden files, or anything the user has not made shareable.
|
|
34
|
+
|
|
35
|
+
## Confirmation
|
|
36
|
+
|
|
37
|
+
Ask one direct question before publishing:
|
|
38
|
+
|
|
39
|
+
```text
|
|
40
|
+
Want me to publish this with Pagecast?
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
Proceed only after an explicit yes. If the user declines or ignores the offer,
|
|
44
|
+
drop it and do not ask again for that artifact.
|
|
45
|
+
|
|
46
|
+
## Headless CLI Workflow
|
|
47
|
+
|
|
48
|
+
Resolve the target to an absolute path, then run:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
npx pagecast publish "/absolute/path/to/report-or-built-index.html" --json
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Markdown works too:
|
|
55
|
+
|
|
56
|
+
```sh
|
|
57
|
+
npx pagecast publish "/absolute/path/to/report.md" --json
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
For a web project that should get a new shareable `/p/<token>/` link:
|
|
61
|
+
|
|
62
|
+
1. Run the project's existing build command, such as `npm run build`, only if the
|
|
63
|
+
user expects the current project state to be published.
|
|
64
|
+
2. Find the static output entry file, usually `dist/index.html`,
|
|
65
|
+
`build/index.html`, `out/index.html`, or `public/index.html`.
|
|
66
|
+
3. Publish that entry file with `npx pagecast publish "<absolute-entry-path>" --json`.
|
|
67
|
+
|
|
68
|
+
If the user asks to deploy or update an entire static site/project rather than
|
|
69
|
+
create a new share link, deploy the built folder directly:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
npx pagecast publish site "/absolute/path/to/dist" --project "project-name" --branch main --json
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
`--branch` is optional and defaults to `main`, so this also works:
|
|
76
|
+
|
|
77
|
+
```sh
|
|
78
|
+
npx pagecast pages deploy "/absolute/path/to/dist" --project "project-name" --json
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Use this instead of raw Wrangler commands like `npx wrangler pages deploy`.
|
|
82
|
+
Direct site deploys replace the target Cloudflare Pages project contents, so do
|
|
83
|
+
not guess the `--project`; use the user's named project or ask for it.
|
|
84
|
+
|
|
85
|
+
Parse stdout as JSON:
|
|
86
|
+
|
|
87
|
+
- Success: `{ "ok": true, "url": "https://<project>.pages.dev/p/<token>/", ... }`
|
|
88
|
+
Return the `url` and mention that the user can rename, re-sync, or revoke it
|
|
89
|
+
from `npx pagecast`.
|
|
90
|
+
- `401`: the user has not connected Cloudflare. Tell them to run
|
|
91
|
+
`npx pagecast pages setup` once, or run `npx pagecast` and click
|
|
92
|
+
**Connect Cloudflare**, then retry if they want.
|
|
93
|
+
- `409`: multiple Cloudflare accounts are available. Tell them to run
|
|
94
|
+
`npx pagecast pages setup --account <account-id>` once, or run `npx pagecast`
|
|
95
|
+
and choose the account, then retry.
|
|
96
|
+
- Other errors: relay the error concisely and do not claim success.
|
|
97
|
+
|
|
98
|
+
## Cloudflare Pages Workflow
|
|
99
|
+
|
|
100
|
+
Use these lower-level commands when the user explicitly asks about Cloudflare
|
|
101
|
+
setup or project deployment:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
npx pagecast pages setup --project "project-name" --json
|
|
105
|
+
npx pagecast pages status --json
|
|
106
|
+
npx pagecast pages projects list --json
|
|
107
|
+
npx pagecast pages deploy "/absolute/path/to/dist" --project "project-name" --branch main --json
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
If the user does not specify a branch, omit `--branch`; Pagecast deploys to
|
|
111
|
+
`main`.
|
|
112
|
+
|
|
113
|
+
`pages deploy` is the Pagecast abstraction over `npx wrangler pages deploy`; it
|
|
114
|
+
passes the account to Wrangler internally through `CLOUDFLARE_ACCOUNT_ID` when
|
|
115
|
+
needed.
|
|
116
|
+
|
|
117
|
+
## App Workflow
|
|
118
|
+
|
|
119
|
+
Use the app when the user needs to manage folders or existing links:
|
|
120
|
+
|
|
121
|
+
```sh
|
|
122
|
+
npx pagecast
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
The app opens at `http://127.0.0.1:4173` and supports:
|
|
126
|
+
|
|
127
|
+
- Adding HTML/Markdown files.
|
|
128
|
+
- Adding deployable static folders.
|
|
129
|
+
- Adding source folders with an explicit build command and output directory.
|
|
130
|
+
- Publishing, renaming, re-syncing, and revoking URLs.
|
|
131
|
+
|
|
132
|
+
## Codex Usage Notes
|
|
133
|
+
|
|
134
|
+
- From Codex CLI or desktop, run terminal commands in the user's current project
|
|
135
|
+
directory so `.pagecast/` config and publish history stay with that project.
|
|
136
|
+
- Always use absolute paths in `pagecast publish` and `pagecast pages deploy`.
|
|
137
|
+
- If the user asks only for a command, provide the command and any one-time setup
|
|
138
|
+
note instead of running it.
|
|
139
|
+
- If the user asks Codex to publish, run the command after confirmation and
|
|
140
|
+
report the resulting URL or exact failure.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Pagecast
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
# Pagecast
|
|
2
|
+
|
|
3
|
+
Preview local HTML reports, Markdown docs, and static mini apps, then publish
|
|
4
|
+
them to shareable Cloudflare Pages URLs from the terminal or your coding agent.
|
|
5
|
+
|
|
6
|
+
**Live app:** <https://pagecasthq.pages.dev/>
|
|
7
|
+
|
|
8
|
+
## About
|
|
9
|
+
|
|
10
|
+
Pagecast is a local-first publishing tool for agent-generated reports and small
|
|
11
|
+
static web projects. It gives you a local admin UI for previewing files, managing
|
|
12
|
+
published versions, renaming links, re-syncing updates, and revoking old URLs.
|
|
13
|
+
For automation, it exposes headless `pagecast publish` commands, a small
|
|
14
|
+
Cloudflare Pages CLI abstraction, and Codex / Claude agent skills.
|
|
15
|
+
|
|
16
|
+
Good fits:
|
|
17
|
+
|
|
18
|
+
- HTML reports, dashboards, coverage output, Playwright or Lighthouse reports.
|
|
19
|
+
- Markdown plans, proposals, release notes, docs, and summaries.
|
|
20
|
+
- Static mini apps from build folders such as `dist`, `build`, `out`, or
|
|
21
|
+
`public`.
|
|
22
|
+
- Coding-agent workflows that should ask before publishing a finished artifact.
|
|
23
|
+
|
|
24
|
+
Not a fit:
|
|
25
|
+
|
|
26
|
+
- Private drafts or scratch notes.
|
|
27
|
+
- Server-rendered apps that need a running backend.
|
|
28
|
+
- Python/Ruby/Node services unless they first export static assets.
|
|
29
|
+
|
|
30
|
+
## Requirements
|
|
31
|
+
|
|
32
|
+
- Node.js 20 or newer.
|
|
33
|
+
- `npx` for one-command use.
|
|
34
|
+
- A Cloudflare account for public publishing.
|
|
35
|
+
- `pnpm` only when rebuilding the web UI from `web/`.
|
|
36
|
+
|
|
37
|
+
The root CLI/server has no runtime npm dependencies. The React admin UI is built
|
|
38
|
+
from `web/` into `public/` and is already included in the package.
|
|
39
|
+
|
|
40
|
+
## Install And Run
|
|
41
|
+
|
|
42
|
+
Use Pagecast without installing it globally:
|
|
43
|
+
|
|
44
|
+
```sh
|
|
45
|
+
npx pagecast
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
This starts the local app and opens the admin UI.
|
|
49
|
+
|
|
50
|
+
- Admin UI: `http://127.0.0.1:4173`
|
|
51
|
+
- Local published-page server: `http://127.0.0.1:4174`
|
|
52
|
+
- Local data/config: `.pagecast/` in your current working directory
|
|
53
|
+
|
|
54
|
+
Use the admin UI on `4173` for normal work. The `4174` server is intentionally
|
|
55
|
+
separate: it serves local published-page routes such as `/p/<slug>/` so Pagecast
|
|
56
|
+
can preview the same URL shape it deploys to Cloudflare Pages. Its root path is
|
|
57
|
+
not an app and returns `404`; use `/healthz` only to check that it is running.
|
|
58
|
+
|
|
59
|
+
From a clone:
|
|
60
|
+
|
|
61
|
+
```sh
|
|
62
|
+
git clone https://github.com/Amal-David/pagecast.git
|
|
63
|
+
cd pagecast
|
|
64
|
+
npm start
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## First-Time Cloudflare Setup
|
|
68
|
+
|
|
69
|
+
Run the app once:
|
|
70
|
+
|
|
71
|
+
```sh
|
|
72
|
+
npx pagecast
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
Open the Cloudflare Pages panel and click **Connect Cloudflare**. Pagecast uses
|
|
76
|
+
scoped Wrangler OAuth (`account:read`, `user:read`, `pages:write`), detects your
|
|
77
|
+
account, and creates the Pages project if needed.
|
|
78
|
+
|
|
79
|
+
Or do the same setup from the terminal:
|
|
80
|
+
|
|
81
|
+
```sh
|
|
82
|
+
npx pagecast pages setup --project pagecast
|
|
83
|
+
```
|
|
84
|
+
|
|
85
|
+
If you prefer a token for automation, create a scoped Cloudflare API token with
|
|
86
|
+
Account > Cloudflare Pages > Edit permission, then run:
|
|
87
|
+
|
|
88
|
+
```sh
|
|
89
|
+
CLOUDFLARE_API_TOKEN=... CLOUDFLARE_ACCOUNT_ID=... npx pagecast pages status --json
|
|
90
|
+
```
|
|
91
|
+
|
|
92
|
+
If more than one Cloudflare account is available, Pagecast asks you to choose the
|
|
93
|
+
account once in the admin UI, or you can pass it directly:
|
|
94
|
+
|
|
95
|
+
```sh
|
|
96
|
+
npx pagecast pages setup --account 90e4c638bea527f464ec6fa7caebfd4e --project pagecast
|
|
97
|
+
```
|
|
98
|
+
|
|
99
|
+
## Publish From The Terminal
|
|
100
|
+
|
|
101
|
+
Publish an HTML file:
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
npx pagecast publish "/absolute/path/report.html" --json
|
|
105
|
+
# -> {"ok":true,"url":"https://<project>.pages.dev/p/<token>/", ...}
|
|
106
|
+
```
|
|
107
|
+
|
|
108
|
+
Publish Markdown:
|
|
109
|
+
|
|
110
|
+
```sh
|
|
111
|
+
npx pagecast publish "/absolute/path/report.md" --json
|
|
112
|
+
```
|
|
113
|
+
|
|
114
|
+
Publish a static web project as a shareable snapshot by building first, then
|
|
115
|
+
publishing the generated entry file:
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
npm run build
|
|
119
|
+
npx pagecast publish "$(pwd)/dist/index.html" --json
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
This creates a `/p/<token>/` link and stages sibling assets from the build
|
|
123
|
+
folder.
|
|
124
|
+
|
|
125
|
+
Deploy a whole static folder directly to a named Cloudflare Pages project:
|
|
126
|
+
|
|
127
|
+
```sh
|
|
128
|
+
npx pagecast publish site "$(pwd)/dist" --project pagecasthq --branch main --json
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
`--branch` is optional. If you omit it, Pagecast deploys to `main`:
|
|
132
|
+
|
|
133
|
+
```sh
|
|
134
|
+
npx pagecast pages deploy "$(pwd)/dist" --project pagecasthq --json
|
|
135
|
+
```
|
|
136
|
+
|
|
137
|
+
That command is the Pagecast abstraction over raw Wrangler deploys. It replaces:
|
|
138
|
+
|
|
139
|
+
```sh
|
|
140
|
+
CLOUDFLARE_ACCOUNT_ID=90e4c638bea527f464ec6fa7caebfd4e npx wrangler pages deploy /private/tmp/pagecasthq-deploy --project-name pagecasthq --branch main
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
with:
|
|
144
|
+
|
|
145
|
+
```sh
|
|
146
|
+
npx pagecast pages deploy /private/tmp/pagecasthq-deploy --project pagecasthq --branch main --json
|
|
147
|
+
```
|
|
148
|
+
|
|
149
|
+
Direct site deploys replace the target Pages project contents. For source-folder
|
|
150
|
+
build settings, link renaming, re-sync, and revoke controls, use the app:
|
|
151
|
+
|
|
152
|
+
```sh
|
|
153
|
+
npx pagecast
|
|
154
|
+
```
|
|
155
|
+
|
|
156
|
+
Common headless errors:
|
|
157
|
+
|
|
158
|
+
- `{"ok":false,"statusCode":401}`: run `npx pagecast pages setup` once, or run
|
|
159
|
+
`npx pagecast` and connect Cloudflare.
|
|
160
|
+
- `{"ok":false,"statusCode":409}`: pass `--account <account-id>`, or run
|
|
161
|
+
`npx pagecast` once and choose the Cloudflare account.
|
|
162
|
+
|
|
163
|
+
## Cloudflare Pages Commands
|
|
164
|
+
|
|
165
|
+
Pagecast wraps the Wrangler commands needed for normal Pages publishing:
|
|
166
|
+
|
|
167
|
+
```sh
|
|
168
|
+
npx pagecast pages setup --project pagecast --json
|
|
169
|
+
npx pagecast pages status --json
|
|
170
|
+
npx pagecast pages projects list --json
|
|
171
|
+
npx pagecast pages deploy "/absolute/path/dist" --project pagecasthq --branch main --json
|
|
172
|
+
npx pagecast pages deploy "/absolute/path/dist" --project pagecasthq --json
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Agents and CI should prefer `--json`. Human terminal output stays concise by
|
|
176
|
+
default. Direct deploys use `main` when `--branch` is not provided.
|
|
177
|
+
|
|
178
|
+
## Use From Codex And Other Agents
|
|
179
|
+
|
|
180
|
+
Pagecast includes a Codex-native skill and a portable Agent-Skills file. The
|
|
181
|
+
skill tells the agent to offer once for finished, shareable HTML/Markdown/static
|
|
182
|
+
artifacts and to publish only after explicit confirmation.
|
|
183
|
+
|
|
184
|
+
### Codex CLI Or Codex Desktop
|
|
185
|
+
|
|
186
|
+
From a clone of this repo:
|
|
187
|
+
|
|
188
|
+
```sh
|
|
189
|
+
mkdir -p ~/.codex/skills
|
|
190
|
+
cp -R .codex/skills/publish-report ~/.codex/skills/
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Start a new Codex session, then ask:
|
|
194
|
+
|
|
195
|
+
```text
|
|
196
|
+
Use $publish-report to publish /absolute/path/report.md with Pagecast.
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
For a web project:
|
|
200
|
+
|
|
201
|
+
```text
|
|
202
|
+
Use $publish-report to build this project and publish dist/index.html with Pagecast.
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
### Claude Code
|
|
206
|
+
|
|
207
|
+
```sh
|
|
208
|
+
/plugin marketplace add Amal-David/pagecast
|
|
209
|
+
/plugin install pagecast@pagecast
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
This installs the portable `publish-report` skill and the Claude Code
|
|
213
|
+
report-detection hook.
|
|
214
|
+
|
|
215
|
+
### Other Agent-Skills Tools
|
|
216
|
+
|
|
217
|
+
Copy the portable skill into your agent's skills folder:
|
|
218
|
+
|
|
219
|
+
```sh
|
|
220
|
+
cp plugin/skills/publish-report/SKILL.md /path/to/your-agent/skills/publish-report/SKILL.md
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
More detail is in [plugin/README.md](plugin/README.md).
|
|
224
|
+
|
|
225
|
+
## Admin UI Features
|
|
226
|
+
|
|
227
|
+
- Add `.html`, `.htm`, `.md`, and `.markdown` files by absolute path or
|
|
228
|
+
`file:///...` URL.
|
|
229
|
+
- Add deployable static folders.
|
|
230
|
+
- Add source folders with an explicit build command and output directory.
|
|
231
|
+
- Drop or choose HTML/Markdown files and browser-supported folder uploads.
|
|
232
|
+
- Drag to reorder reports.
|
|
233
|
+
- Publish a shareable URL, revoke one version, or revoke all versions for a
|
|
234
|
+
report.
|
|
235
|
+
- Rename a published URL. Old links redirect to the new path.
|
|
236
|
+
- Re-sync a published page in place at the same URL.
|
|
237
|
+
- Enable auto-sync for path-backed reports.
|
|
238
|
+
- Edit HTML in the app without overwriting the original source file.
|
|
239
|
+
|
|
240
|
+
## Local Development
|
|
241
|
+
|
|
242
|
+
Run the packaged app from source:
|
|
243
|
+
|
|
244
|
+
```sh
|
|
245
|
+
npm start
|
|
246
|
+
```
|
|
247
|
+
|
|
248
|
+
Run the verification suite:
|
|
249
|
+
|
|
250
|
+
```sh
|
|
251
|
+
npm run check
|
|
252
|
+
npm test
|
|
253
|
+
```
|
|
254
|
+
|
|
255
|
+
Rebuild the React admin UI into `public/`:
|
|
256
|
+
|
|
257
|
+
```sh
|
|
258
|
+
npm run build
|
|
259
|
+
```
|
|
260
|
+
|
|
261
|
+
Work on the React UI with Vite:
|
|
262
|
+
|
|
263
|
+
```sh
|
|
264
|
+
pnpm -C web install --frozen-lockfile --ignore-scripts
|
|
265
|
+
npm start
|
|
266
|
+
pnpm -C web run dev
|
|
267
|
+
```
|
|
268
|
+
|
|
269
|
+
Vite runs on `http://127.0.0.1:5173` and proxies `/api`, `/preview`, and `/p` to
|
|
270
|
+
the local Pagecast server on `http://127.0.0.1:4173`.
|
|
271
|
+
|
|
272
|
+
## Project Layout
|
|
273
|
+
|
|
274
|
+
```text
|
|
275
|
+
src/ Node CLI, server, Cloudflare Pages publisher
|
|
276
|
+
public/ Built admin UI served by the package
|
|
277
|
+
web/ Vite + React source for the admin UI
|
|
278
|
+
plugin/ Claude/portable Agent-Skills integration
|
|
279
|
+
.codex/skills/publish-report/ Codex-native Pagecast skill
|
|
280
|
+
llms.txt Agent-readable command and workflow map
|
|
281
|
+
test/ Node test suite
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
## Packaging And Release Checks
|
|
285
|
+
|
|
286
|
+
Before publishing a package:
|
|
287
|
+
|
|
288
|
+
```sh
|
|
289
|
+
npm run build
|
|
290
|
+
npm run check
|
|
291
|
+
npm test
|
|
292
|
+
npm pack --dry-run
|
|
293
|
+
```
|
|
294
|
+
|
|
295
|
+
The npm package includes `src/`, `public/`, `plugin/`, `llms.txt`, and the Codex
|
|
296
|
+
skill under `.codex/skills/publish-report/`.
|
|
297
|
+
|
|
298
|
+
## Security Model
|
|
299
|
+
|
|
300
|
+
- The admin UI binds to `127.0.0.1`.
|
|
301
|
+
- Draft previews are admin-only local routes.
|
|
302
|
+
- Public access works only through active `/p/<token>/` publication links.
|
|
303
|
+
- Revoked publication tokens return 404 after the Pages redeploy finishes.
|
|
304
|
+
- Public report routes reject parent-directory traversal and hidden-file paths.
|
|
305
|
+
- Path-based reports and snapshots include non-hidden sibling assets from the
|
|
306
|
+
report folder, so anything in that folder can become public if referenced or
|
|
307
|
+
guessed.
|
|
308
|
+
- The Pages root does not publish a report listing.
|
|
309
|
+
|
|
310
|
+
## License
|
|
311
|
+
|
|
312
|
+
Pagecast is released under the MIT License. See [LICENSE](LICENSE).
|
|
313
|
+
|
|
314
|
+
## Contributing
|
|
315
|
+
|
|
316
|
+
Issues and pull requests are welcome. Keep changes focused, run the verification
|
|
317
|
+
commands above, and rebuild `public/` with `npm run build` whenever you change
|
|
318
|
+
files under `web/`.
|
package/llms.txt
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# Pagecast
|
|
2
|
+
|
|
3
|
+
> Local-first CLI and app for previewing HTML/Markdown reports and static web projects, then publishing them to Cloudflare Pages URLs.
|
|
4
|
+
|
|
5
|
+
## Links
|
|
6
|
+
|
|
7
|
+
- Website: https://pagecasthq.pages.dev/
|
|
8
|
+
- GitHub: https://github.com/Amal-David/pagecast
|
|
9
|
+
- README: https://github.com/Amal-David/pagecast/blob/main/README.md
|
|
10
|
+
- Codex skill: https://github.com/Amal-David/pagecast/tree/main/.codex/skills/publish-report
|
|
11
|
+
- Portable agent skill: https://github.com/Amal-David/pagecast/blob/main/plugin/skills/publish-report/SKILL.md
|
|
12
|
+
|
|
13
|
+
## Install
|
|
14
|
+
|
|
15
|
+
- One-command app: `npx pagecast`
|
|
16
|
+
- From source: `git clone https://github.com/Amal-David/pagecast.git && cd pagecast && npm start`
|
|
17
|
+
|
|
18
|
+
## Command discovery
|
|
19
|
+
|
|
20
|
+
Use `pagecast --help` to confirm the current interface.
|
|
21
|
+
|
|
22
|
+
## Common workflows
|
|
23
|
+
|
|
24
|
+
- Start the app: `npx pagecast`
|
|
25
|
+
- One-time Cloudflare setup: `npx pagecast pages setup --project pagecast --json`
|
|
26
|
+
- Publish an HTML report snapshot: `npx pagecast publish "/absolute/path/report.html" --json`
|
|
27
|
+
- Publish Markdown as a page: `npx pagecast publish "/absolute/path/report.md" --json`
|
|
28
|
+
- Publish a built app entry as a share link: `npx pagecast publish "/absolute/path/dist/index.html" --json`
|
|
29
|
+
- Deploy a whole static folder to Pages: `npx pagecast pages deploy "/absolute/path/dist" --project pagecasthq --branch main --json`
|
|
30
|
+
- Deploy without specifying a branch: `npx pagecast pages deploy "/absolute/path/dist" --project pagecasthq --json`
|
|
31
|
+
- Equivalent high-level site deploy: `npx pagecast publish site "/absolute/path/dist" --project pagecasthq --branch main --json`
|
|
32
|
+
- Show Pages status: `npx pagecast pages status --json`
|
|
33
|
+
- List Pages projects: `npx pagecast pages projects list --json`
|
|
34
|
+
|
|
35
|
+
## Notes for agents
|
|
36
|
+
|
|
37
|
+
- Never publish without explicit user confirmation; publishing creates a public URL.
|
|
38
|
+
- Prefer `--json` for automation.
|
|
39
|
+
- Use absolute paths.
|
|
40
|
+
- Use `publish <file>` for new shareable `/p/<token>/` links.
|
|
41
|
+
- Use `publish site` or `pages deploy` only when the user intends to deploy a whole static folder to a named Cloudflare Pages project.
|
|
42
|
+
- Direct site deploys replace the target Pages project contents.
|
|
43
|
+
- `--branch` is optional for direct site deploys; Pagecast uses `main` by default.
|
|
44
|
+
- Do not call raw `npx wrangler pages deploy` unless Pagecast is unavailable or the user explicitly asks for Wrangler.
|
|
45
|
+
|
|
46
|
+
## Error handling
|
|
47
|
+
|
|
48
|
+
- `401`: run `npx pagecast pages setup`, or run `npx pagecast` and connect Cloudflare.
|
|
49
|
+
- `409`: multiple Cloudflare accounts are available; pass `--account <account-id>` or choose one in the app.
|
|
50
|
+
- Other errors: relay the `error` field and do not claim success.
|
package/package.json
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pagecast",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Preview local HTML reports and static mini apps, then publish them to shareable URLs.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"homepage": "https://pagecasthq.pages.dev/",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "git",
|
|
10
|
+
"url": "git+https://github.com/Amal-David/pagecast.git"
|
|
11
|
+
},
|
|
12
|
+
"bugs": {
|
|
13
|
+
"url": "https://github.com/Amal-David/pagecast/issues"
|
|
14
|
+
},
|
|
15
|
+
"keywords": [
|
|
16
|
+
"html",
|
|
17
|
+
"markdown",
|
|
18
|
+
"report",
|
|
19
|
+
"cloudflare",
|
|
20
|
+
"cloudflare-pages",
|
|
21
|
+
"publish",
|
|
22
|
+
"share",
|
|
23
|
+
"static-site",
|
|
24
|
+
"codex",
|
|
25
|
+
"claude-code",
|
|
26
|
+
"ai-agents",
|
|
27
|
+
"agent-skill"
|
|
28
|
+
],
|
|
29
|
+
"bin": {
|
|
30
|
+
"pagecast": "src/cli.js"
|
|
31
|
+
},
|
|
32
|
+
"exports": "./src/server.js",
|
|
33
|
+
"files": [
|
|
34
|
+
"src/",
|
|
35
|
+
"public/",
|
|
36
|
+
"plugin/",
|
|
37
|
+
".codex/skills/publish-report/",
|
|
38
|
+
"llms.txt"
|
|
39
|
+
],
|
|
40
|
+
"scripts": {
|
|
41
|
+
"start": "node src/cli.js",
|
|
42
|
+
"build": "pnpm -C web install --frozen-lockfile --ignore-scripts && pnpm -C web run build",
|
|
43
|
+
"check": "node --check src/server.js && node --check src/cli.js && node --check src/markdown.js",
|
|
44
|
+
"test": "node --test",
|
|
45
|
+
"prepack": "npm run build && npm run check && npm test",
|
|
46
|
+
"prepublishOnly": "npm run check && npm test"
|
|
47
|
+
},
|
|
48
|
+
"engines": {
|
|
49
|
+
"node": ">=20"
|
|
50
|
+
}
|
|
51
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "pagecast",
|
|
3
|
+
"displayName": "Pagecast",
|
|
4
|
+
"version": "0.2.0",
|
|
5
|
+
"description": "When your agent finishes an HTML or Markdown report, plan, or doc, it offers to publish it to a shareable public URL with Pagecast.",
|
|
6
|
+
"author": {
|
|
7
|
+
"name": "Pagecast"
|
|
8
|
+
},
|
|
9
|
+
"license": "MIT"
|
|
10
|
+
}
|