@iannuttall/librarian
v0.1.5
Published
Local-first docs CLI
Readme
Librarian
Librarian fetches and searches up-to-date developer docs on your machine.
Use it to give AI agents real context so they stop guessing and writing bad code.
Supports GitHub repos and public websites.
Install
npm
npm i -g @iannuttall/librarianlibrarian setupbun
bun add -g @iannuttall/librarianlibrarian setupNote: npm installs still require Bun at runtime; the CLI will prompt you to install it if missing.
Install Bun (optional):
curl -fsSL https://bun.sh/install | bashUpdates
Check your current version
librarian versionUpdate (auto-detects bun vs npm)
librarian updateLibrarian also checks for updates once per day when you run any command and will suggest the right update command.
Quick start (from repo)
bun installbun setupIf you choose the global install during setup, use librarian below.
Otherwise use ./librarian.
librarian add https://github.com/honojs/website --docs docslibrarian add https://hono.dev/docslibrarian ingest --embedlibrarian library "honojs"librarian search --library honojs/website "middleware"Sources
GitHub repos
librarian add https://github.com/owner/repo --docs docs --ref mainlibrarian add https://github.com/owner/repo --version 16.xWebsites
Basic - auto-discovers via llms.txt, sitemap.xml, robots.txt
librarian add https://docs.example.comWith options
librarian add https://docs.example.com/api --depth 3 --pages 500Specific paths
librarian add https://example.com --allow /docs,/api --deny /blogIngest
Ingest all sources
librarian ingestIngest with concurrency (default: 5)
librarian ingest --concurrency 10Force re-ingest
librarian ingest --forceIngest and embed
librarian ingest --embedSeed sources
Add the built-in seed list and auto-ingest
librarian seedThe default seed list lives in data/libraries.yml in this repo.
Search
Hybrid search (word + meaning)
librarian search --library vercel/next.js "middleware"Word search only
librarian search --library vercel/next.js --mode word "middleware"Meaning search only
librarian search --library vercel/next.js --mode vector "middleware"JSON output
librarian search --library vercel/next.js --json "middleware"Filter by version
librarian search --library vercel/next.js --version 16.x "middleware"To avoid mixed results, scope searches to a library version label. If you are in a repo, run:
librarian detectThen pass the label to search. If you are not in a repo, run a library search first: librarian library "<name>" to see the available version labels.
Library search
Find a library and list versions
librarian library "nextjs"Other commands
List sources
librarian source listRemove source
librarian source remove 1Add sources from the seed list
librarian seedRead a doc
librarian get --library vercel/next.js docs/guide.mdRead a slice
librarian get --library vercel/next.js --doc 69 --slice 19:73Show counts
librarian statusDetect versions in cwd
librarian detectUpdate Librarian
librarian updateRemove inactive docs
librarian cleanupMCP server
Start the MCP server (stdio)
librarian mcpTools:
- search (use
modefor word/vector/hybrid) - library
- get
Configuration
Config file: ~/.config/librarian/config.yml
github:
token: ghp_xxx # For private repos
proxy:
endpoint: http://user:[email protected]:8080
# Any HTTP proxy works; tested with Webshare.
headless:
enabled: true
proxy: http://proxy.example.com:9999 # IP-whitelisted, no auth
chromePath: /path/to/chrome # Optional, auto-detected
crawl:
concurrency: 5
ingest:
maxMajorVersions: 3Notes
setupdownloads the local embedding model- Public repos don't need a GitHub token
- Website crawling auto-detects CSR/SPA sites and uses headless Chrome
- Chrome is auto-detected but can be configured manually
- Run
librarian setupto check Chrome availability - If
librariandoes not work in a repo checkout, use./librarian - More examples in
docs/usage.md
Agent skills
Skills use progressive disclosure, so only the skill name and description load at startup.
Codex
- Copy the bundled skill to your Codex skills folder:
mkdir -p ~/.codex/skillscp -R skills/librarian ~/.codex/skills/librarian- Direct invocation works in Codex CLI: use
$librarianor/skills - Codex web and iOS do not support direct invocation yet, so just ask to use the librarian skill
Claude Code
- Copy the skill to your Claude Code skills folder:
mkdir -p ~/.claude/skillscp -R skills/librarian ~/.claude/skills/librarianFactory
- Copy the skill to your Factory skills folder:
mkdir -p ~/.factory/skillscp -R skills/librarian ~/.factory/skills/librarian