-
Notifications
You must be signed in to change notification settings - Fork 0
CLI Reference
SaddleRAG ships a command-line interface (saddlerag.exe) for scripting, automation, and direct operator use. The CLI provides the same core capabilities as the MCP tools but in a form suitable for batch scripts and CI/CD pipelines.
The CLI is installed alongside the MCP server and added to the system PATH by the installer.
| Option | Description |
|---|---|
--profile <name> |
MongoDB profile to use (overrides MongoDB.ActiveProfile) |
--server <url> |
SaddleRAG server URL (default: http://localhost:6100) |
--help |
Show help for any command |
--version |
Show CLI version |
Index documentation for a library.
saddlerag ingest `
--url https://www.pollydocs.org/ `
--library polly `
--version 8.2.0 `
[--allowed-patterns "pollydocs\.org/docs/,pollydocs\.org/api/"] `
[--excluded-patterns "pollydocs\.org/blog/"] `
[--budget 500] `
[--profile team] `
[--wait]| Option | Description |
|---|---|
--url |
Root URL of the documentation site |
--library |
Library identifier (short, no spaces, e.g., polly) |
--version |
Version string (e.g., 8.2.0) |
--allowed-patterns |
Comma-separated regex patterns for allowed URLs |
--excluded-patterns |
Comma-separated regex patterns for excluded URLs |
--budget |
Maximum number of pages to crawl |
--profile |
MongoDB profile |
--wait |
Block until the scrape job completes (default: returns immediately after queuing) |
Without --wait, the command queues the scrape job and exits immediately. The scrape runs in the background in the SaddleRAGMcp service. Use saddlerag status to monitor.
Preview the crawl scope without indexing anything.
saddlerag dryrun `
--url https://www.pollydocs.org/ `
--library polly `
--version 8.2.0Outputs the list of URLs that would be fetched and an estimated page count. Nothing is written to the database. Useful for validating URL patterns before a full scrape.
Show recent scrape job status.
# All recent jobs
saddlerag status
# Specific job
saddlerag status --job-id <jobId>
# Jobs for a specific library
saddlerag status --library polly
# Long-poll until a job completes
saddlerag status --job-id <jobId> --waitOutput includes job state, pages crawled/classified/chunked/embedded, start time, and elapsed time.
Run library reconnaissance using the local Ollama model (fallback path when a frontier LLM is not available).
saddlerag recon `
--url https://www.pollydocs.org/ `
--library polly `
--version 8.2.0Generates and persists a LibraryProfile using the configured Ollama.ReconModels model. The profile shapes subsequent indexing (URL patterns, symbol extraction, chunking).
Under normal circumstances this is invoked automatically by the start_ingest state machine. Run it manually to pre-populate a profile or override an existing one.
Scan a project's dependency files and queue scrape jobs for any undocumented dependencies.
saddlerag scan `
--project E:\MyProject `
[--profile team] `
[--dry-run]| Option | Description |
|---|---|
--project |
Path to the project root (default: current directory) |
--profile |
MongoDB profile |
--dry-run |
List what would be indexed without queuing scrape jobs |
scan discovers dependencies from:
-
*.csprojfiles (NuGet packages) -
package.json/package-lock.json(npm packages) -
requirements.txt/pyproject.toml(pip packages)
For each dependency, it checks whether that library and version is already in the SaddleRAG index. If not, it resolves the documentation URL from the package registry metadata and queues a scrape job.
This command is designed for CI/CD integration: run it on every dependency update and new library versions will be indexed automatically before developers need them.
Register SaddleRAG with installed AI tools.
saddlerag register-clientsWrites MCP configuration entries to:
-
~/.claude.json— Claude Code -
%APPDATA%\Claude\claude_desktop_config.json— Claude Desktop - VS Code user
settings.json— VS Code Copilot MCP - GitHub Copilot CLI config
Also installs the SaddleRAG skill file for Claude Code (.claude/saddlerag-first.md) that instructs Claude to always query SaddleRAG before answering questions about indexed libraries.
Run this after installation or after moving the server to a different port.
Remove SaddleRAG from all AI tool configurations.
saddlerag unregister-clientsReverses all changes made by register-clients.
Search the indexed documentation from the command line.
saddlerag search "retry policy configuration" `
[--library polly] `
[--version 8.2.0] `
[--category ApiReference] `
[--results 10] `
[--profile team]Outputs formatted search results to the terminal. Useful for testing search quality and verifying that a library is correctly indexed.
List indexed libraries and their versions.
saddlerag list [--profile team]Show library health diagnostics.
saddlerag health --library polly [--version 8.2.0] [--profile team]Equivalent to the get_library_health MCP tool. Shows chunk counts, category distribution, and suspect markers.
# .github/workflows/index-docs.yml
name: Index documentation
on:
push:
paths:
- '**/*.csproj'
- '**/package.json'
- '**/requirements.txt'
jobs:
index:
runs-on: [self-hosted, saddlerag] # runner with SaddleRAG installed
steps:
- uses: actions/checkout@v4
- name: Scan and index new dependencies
run: saddlerag scan --project . --profile team --waitThis workflow triggers whenever dependency files change, automatically indexing documentation for newly added or updated libraries into the team's shared SaddleRAG index.