Standalone Node CLI for fetching web pages as Markdown and crawling bounded documentation sets. It does not depend on Pi.
npx skills add trotsky1997/webfetch-cliThe package can be run directly from this repository:
npm exec --yes --package=github:trotsky1997/webfetch-cli -- webfetch-cli --helpFetch one page:
npm exec --yes --package=github:trotsky1997/webfetch-cli -- \
webfetch-cli fetch https://example.com --output toc-onlyCrawl a documentation subtree:
npm exec --yes --package=github:trotsky1997/webfetch-cli -- \
webfetch-cli crawl https://docs.python.org/3/library/index.html --max-hops 1 --max-pages 30npm install
npm exec -- webfetch-cli --helpnpx webfetch-cli fetch https://example.com --output toc-only
npx webfetch-cli crawl https://docs.python.org/3/library/index.html --max-hops 1 --max-pages 30Fetch one page:
npm exec --yes --package=github:trotsky1997/webfetch-cli -- \
webfetch-cli fetch https://example.com --output toc-onlyCrawl a documentation subtree:
npm exec --yes --package=github:trotsky1997/webfetch-cli -- \
webfetch-cli crawl https://docs.python.org/3/library/index.html --max-hops 1 --max-pages 30Both commands write cache files under .md/ in the current directory by default. Use --cwd <path> to write elsewhere.
Unless --raw-only is set, page fetching tries:
https://r.jina.ai/{url}https://defuddle.md/{url}https://markdown.new/{url}https://pure.md/{url}- Raw HTML converted to Markdown with
turndown
--raw-only skips hosted services and fetches the target URL directly. This is useful for local sites and tests.
Fetch:
npm exec --yes --package=github:trotsky1997/webfetch-cli -- \
webfetch-cli fetch <url> \
--output all|path-only|toc-only \
--timeout 20000 \
--cwd . \
--raw-only \
--jsonCrawl:
npm exec --yes --package=github:trotsky1997/webfetch-cli -- \
webfetch-cli crawl <url> \
--parent-domain docs.example.com \
--max-hops 2 \
--max-pages 30 \
--max-links 40 \
--concurrency 4 \
--allow-query \
--output summary|path-only|all \
--timeout 20000 \
--cwd . \
--raw-only \
--verbose \
--jsonSingle-page fetches:
.md/<title>-<domain>-<timestamp>-<hash>.md
Crawls:
.md/<hostname>/<original-path>.md
.md/crawls/crawl-<root>-<timestamp>-<hash>.json
npm run smoke