cd kb-backend/apps/cli, then npm install and npm pack. This produces sarv-kb-cli-1.0.0.tgz.Scrape, crawl, search, upload and manage knowledge bases straight from your terminal — a beautiful command line styled to match SarvCrawl, with live job spinners and clean tables.
The CLI installs two commands — sarv-kb and sarvcrawl. Both are identical; use whichever you prefer.
A single binary that wraps the entire SarvCrawl backend. It is a thin layer over the sarvcrawl, so every endpoint the SDK supports is one command away.
Manage KBs
Create, list, inspect, and delete knowledge bases.
Ingest content
Scrape, crawl, web-search, map, or upload files.
Search & export
Full-text search, browse pages, export JSONL/ZIP.
Built the same way as the SDK and MCP packages — npm pack for local dev, then a global install.
Pack the CLI
cd kb-backend/apps/cli, then npm install and npm pack. This produces sarv-kb-cli-1.0.0.tgz.Install it globally
sarv-kb and kb on your PATH.Verify
sarv-kb --help — you should see the branded help screen.Prefer not to install globally? Run it in place with node bin/sarv-kb.js --help.
The backend authenticates with an x-api-key. Log in once and it is stored in ~/.sarv-kb/config.json.
Or use environment variables
Resolution precedence is flag → env var → config file → default.
sarv-kb login
Interactive, masked key prompt + validation.
sarv-kb config
Show config and where each value came from.
sarv-kb --status
Version, auth, and backend service health.
Health at a glance
Everything the CLI can do, grouped by what you are trying to accomplish.
Create and inspect the containers your content lives in.
Five ways to get content into a KB. Every command targets a KB with --kb and accepts --wait to poll to completion with a live spinner.
search vs find: search ingests new web results into the KB.find retrieves from what is already stored. Two different commands.
List jobs, follow one to completion, or act on it — logs, audit, cancel, delete.
Other actions on a job: --wait, --audit,--source-md, --source-pdf out.pdf,--cancel, --delete.
Query stored content and browse the pages inside a KB.
Browse with sarv-kb pages --kb <id> and fetch one in any format withsarv-kb page <pageId> --kb <id> --format markdown (json · markdown · html · links · images).
Download the raw files behind a job, or export an entire KB for RAG pipelines.
Stream export
export --format jsonl|csv → stdout or a file.
ZIP archives
files export-job / export-kb for full snapshots.
These work on every command.
--jsonEmit raw JSON instead of the pretty view--prettyPretty-print JSON (indent 2)-o, --output <path>Write the result to a file-k, --api-key <key>Override the stored API key for one command--api-url <url>Override the backend URL for one commandPretty UI goes to stderr; stdout stays clean so you can pipe into jq and friends.
Develop against a local backend without installing globally.
The CLI never talks HTTP directly (except the keyless /health ping) — all API access goes through a built-in client under src/api/ that mirrors thesarvcrawl surface. It is vendored (not a file: dependency), so the published package is fully self-contained and npm install -g works anywhere.
Explore the other integrations
Node SDK · Python SDK · MCP Server · n8n node