create-markdown-edge-for-agents
v0.2.1
Published
Scaffolder CLI for markdown-edge-for-agents
Readme
create-markdown-edge-for-agents
Scaffold a Markdown-for-Agents worker in one command.
CLI companion to @adhenawer-pkg/markdown-edge-for-agents. Detects your framework, generates a Cloudflare Worker with the right preset, installs dependencies, and points you to deploy.
Quick start
npx create-markdown-edge-for-agents initThat's it. The CLI will:
- Detect your framework (Astro, Hugo, or custom)
- Ask for your Cloudflare zone and route patterns
- Generate a worker at
workers/markdown-agent/ - Install dependencies
- Print next steps for deployment
What it generates
workers/markdown-agent/
├── src/
│ └── index.ts # 5-line worker using the lib
├── wrangler.toml # Configured with your zone + routes
└── package.json # With @adhenawer-pkg/markdown-edge-for-agents depGenerated worker (Astro example)
import { createMarkdownWorker } from "@adhenawer-pkg/markdown-edge-for-agents";
export default createMarkdownWorker({
preset: "astro",
});Generated wrangler.toml
name = "markdown-agent"
main = "src/index.ts"
compatibility_date = "2026-04-15"
routes = [
{ pattern = "yoursite.com/posts/*", zone_name = "yoursite.com" }
]Framework detection
The CLI auto-detects your framework:
| Signal | Detected as |
|---|---|
| astro in package.json dependencies | Astro |
| hugo.toml, hugo.yaml, or config.toml present | Hugo |
| Nothing matches | Custom (you configure selectors manually) |
Deploy
After scaffolding:
cd workers/markdown-agent
npx wrangler login # First time only
npx wrangler deployVerify
# Should return markdown with YAML frontmatter
curl -H "Accept: text/markdown" https://yoursite.com/any-page.html
# Should return normal HTML (browser behavior)
curl https://yoursite.com/any-page.htmlAliases
Both commands work:
npx create-markdown-edge-for-agents init
npx mdea initWhat this does NOT do
- Does not modify your existing site or HTML
- Does not require a Cloudflare Pro plan (works on Free tier)
- Does not send any data to third parties
- Does not run any background processes
The generated worker runs entirely on Cloudflare's edge network, intercepting requests only when AI agents ask for markdown.
Requirements
- Node.js 22+
- A Cloudflare account (Free tier works)
- A site deployed behind Cloudflare DNS
Related
@adhenawer-pkg/markdown-edge-for-agents— the core library- GitHub repo — source code, examples, contributing guide
License
MIT
