-
Notifications
You must be signed in to change notification settings - Fork 0
CLI Usage
Kritarth-Dandapat edited this page Jul 19, 2026
·
1 revision
dkraft-publish is the publish-side CLI, published to npm as freeflow-dkraft-publisher.
npm install -g freeflow-dkraft-publisherOr run without installing:
npx freeflow-dkraft-publisher ./plan.html| Variable | Meaning |
|---|---|
DK_PUBLISH_KEY |
Must match the Worker's SECRET_API_KEY secret |
DK_PUBLISH_URL |
Base URL of your deployed Worker (e.g. https://freeflow.example.workers.dev) |
export DK_PUBLISH_KEY="<your SECRET_API_KEY>"
export DK_PUBLISH_URL="https://<your-worker-domain>"If either is missing, the CLI prints a setup guide and exits non-zero without attempting a network call.
dkraft-publish <file> [-s, --secure <pin>]| Arg / flag | Required | Description |
|---|---|---|
<file> |
yes | Path to a local HTML file (relative to CWD) |
-s, --secure <pin> |
no | Locks the published draft behind a PIN; viewers must supply ?key=<pin>
|
dkraft-publish ./templates/plan-template.html
dkraft-publish ./my-plan.html --secure 1234🚀 Published successfully! View your live plan at: https://<your-worker-domain>/d/<id>
- Missing env vars — prints the setup guide (see above), exits 1.
-
File not readable (
accesscheck viafs.constants.R_OK) — fails with the underlying error. -
Empty file —
"Error: The target HTML file is empty." -
Non-2xx from Worker —
"Upload failed (<status>): <body>"(e.g. 401 = badDK_PUBLISH_KEY). -
Response missing
url—"Upload succeeded but response was missing a URL." -
Any other network/parse error —
"Failed to publish draft."plus the underlying error message.
.claude/skills/freeflow-publish/SKILL.md in the repo documents this entire flow (credential checks, invocation, error interpretation) in plain language. Claude Code auto-discovers it; any other agent can be pointed at the file directly.
- API Reference for what the CLI actually calls
- Security for what the PIN option does and doesn't protect against