| name | md-fetch-cli |
| description | Use the md-fetch CLI to retrieve web content as clean Markdown, save output to files, or run the local HTTP API server. Activate when users ask to fetch web pages, convert pages to Markdown, batch fetch URLs via API, or troubleshoot browser selection and fetch failures in this repository. |
| compatibility | Requires the md-fetch binary and at least one supported fetch backend (chrome/chromium, firefox, or curl). |
| metadata | {"author":"nathabonfim59","version":"1.0"} |
md-fetch CLI skill
Use this skill for tasks that operate the md-fetch command-line tool (not for general web browsing through unrelated tools).
What this tool does
- Fetches
http/https URLs and returns Markdown or plain text/JSON output.
- Uses browser backends in this priority when
--browser is not set: chrome, firefox, curl.
- Can save output to a
.md file.
- Can run as an HTTP service for single or batch URL fetches.
Operating procedure
- Confirm the request type:
- Single fetch to terminal
- Fetch and save to file
- Start/operate API server mode
- Always use the installed CLI executable:
- Prefer explicit browser selection when troubleshooting:
--browser chrome
--browser firefox
--browser curl
- For file output, use
--save and optionally --filename <name>.md.
- For API mode, run
serve and call POST /fetch with JSON body containing urls and optional browser.
Canonical commands
md-fetch https://example.com
md-fetch --browser chrome https://example.com
md-fetch --save https://example.com
md-fetch --save --filename example.md https://example.com
md-fetch serve
md-fetch serve --port 9090
API usage
curl -X POST http://localhost:8080/fetch \
-H "Content-Type: application/json" \
-d '{
"urls": ["https://example.com", "https://github.com"],
"browser": "chrome"
}'
OpenAPI document:
http://localhost:8080/openapi.yaml
Behavior notes
- If URL has no scheme,
https:// is automatically added.
- Supported explicit backends:
chrome (or chromium), firefox, curl.
- JSON responses are pretty-printed and wrapped in fenced Markdown.
- Invalid method on
/fetch returns 405; invalid JSON body returns 400.
Troubleshooting checklist
- "failed to initialize browser": install/verify a backend executable (
chrome/chromium, firefox, or curl) on PATH.
- "site cannot be reached": verify URL/network and retry with a different backend.
- Empty/poor output: retry with
--browser chrome for JS-heavy pages.
- Save issues: ensure write permissions for target directory.
References
See references/COMMANDS.md for concise command snippets.