MCPcopy Index your code
hub / github.com/egoist/sitefetch

github.com/egoist/sitefetch @v0.0.17

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.0.17 ↗ · + Follow
21 symbols 54 edges 8 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

sitefetch

Fetch an entire site and save it as a text file (to be used with AI models).

image

Install

One-off usage (choose one of the followings):

bunx sitefetch
npx sitefetch
pnpx sitefetch

Install globally (choose one of the followings):

bun i -g sitefetch
npm i -g sitefetch
pnpm i -g sitefetch

Usage

sitefetch https://egoist.dev -o site.txt

# or better concurrency
sitefetch https://egoist.dev -o site.txt --concurrency 10

Match specific pages

Use the -m, --match flag to specify the pages you want to fetch:

sitefetch https://vite.dev -m "/blog/**" -m "/guide/**"

The match pattern is tested against the pathname of target pages, powered by micromatch, you can check out all the supported matching features.

Content selector

We use mozilla/readability to extract readable content from the web page, but on some pages it might return irrelevant contents, in this case you can specify a CSS selector so we know where to find the readable content:

sitefetch https://vite.dev --content-selector ".content"

Plug

If you like this, please check out my LLM chat app: https://chatwise.app

API

import { fetchSite } from "sitefetch"

await fetchSite("https://egoist.dev", {
  //...options
})

Check out options in types.ts.

License

MIT.

Core symbols most depended-on inside this repo

warn
called by 6
src/logger.ts
info
called by 3
src/logger.ts
#limitReached
called by 2
src/index.ts
serializePages
called by 2
src/index.ts
fetchSite
called by 1
src/index.ts
#getContentSelector
called by 1
src/index.ts
fetchSite
called by 1
src/index.ts
#fetchPage
called by 1
src/index.ts

Shape

Function 9
Method 8
Class 4

Languages

TypeScript100%

Modules by API surface

src/index.ts9 symbols
src/logger.ts5 symbols
src/utils.ts3 symbols
rolldown.config.js3 symbols
src/to-markdown.ts1 symbols

For agents

$ claude mcp add sitefetch \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page