Rabbithole can be configured via command-line flags or a TOML configuration file. Command-line flags always take precedence over values set in the config file. The config file is optional; Rabbithole will run with defaults if none is provided.
The source of truth is always the binary. Run rabbithole --help to see the
current list of flags and their defaults.
| Flag | Type | Default | Description |
|---|---|---|---|
--seed |
path | (required) |
Path to a plain-text file containing the seed prompt for the homepage
(/). This prompt describes what the root page of the
generated site should contain. Every other page is derived from links
that the root page (and subsequent pages) produce. See
Writing a Seed Prompt.
|
--port |
integer | 8080 |
TCP port to listen on. Set to 80 or 443 for
production use (may require elevated privileges or a reverse proxy).
|
--db |
path | rabbithole.db |
Path to the SQLite database file used to cache generated pages and store the URL-to-prompt mapping table. Created automatically if it does not exist. See Cache Invalidation. |
--model |
string | (required) |
The LLM model name to pass to the API. Examples:
claude-sonnet-4-5, gpt-4o,
gpt-4.1. Must be a model accessible via your configured
API key.
|
--api-key |
string | see note |
API key for the LLM provider. If omitted, Rabbithole reads from the
OPENAI_API_KEY or ANTHROPIC_API_KEY
environment variable depending on the model selected. Prefer the
environment variable to avoid exposing secrets in shell history or
process listings.
|
--depth |
integer | 5 |
Maximum link depth from the seed page before generation stops. See Depth Limit for a detailed explanation. |
--web-tools |
boolean flag | false |
When set, enables the web search and web fetch tools for the LLM during page generation. This allows pages to contain real, up-to-date information pulled from the live web. Increases latency and token usage. See Web Tools. |
--system-prompt |
path | (built-in) | Path to a plain-text file that overrides the default system prompt sent to the LLM. The default system prompt instructs the model to act as Rabbithole — generating HTML pages and JSON mappings. Only change this if you know what you are doing; an incorrect system prompt will likely break output parsing. |
--config |
path | (none) | Path to a TOML configuration file. Values in the file are used as defaults; CLI flags override them. |
All CLI flags (except --config itself) may be expressed in a TOML
file. Keys use the long flag name without the leading dashes, with hyphens
replaced by underscores.
rabbithole.toml# Rabbithole configuration file # All fields are optional; shown values are defaults unless marked. # Path to the seed prompt file (required if not passed on CLI) seed = "seed.txt" # TCP port to listen on port = 8080 # SQLite database path (created if missing) db = "rabbithole.db" # LLM model name (required) model = "claude-sonnet-4-5" # API key — prefer environment variables instead of hardcoding here # api_key = "sk-..." # Maximum crawl depth from the seed page (0 = seed page only) depth = 5 # Enable web search and web fetch tools web_tools = false # Override the built-in system prompt (path to a .txt file) # system_prompt = "my_system_prompt.txt"
| Variable | Description |
|---|---|
OPENAI_API_KEY |
API key for OpenAI-compatible endpoints (GPT-4o, etc.). Used when --api-key is not set. |
ANTHROPIC_API_KEY |
API key for Anthropic models (Claude). Used when --api-key is not set. |
RUST_LOG |
Controls log verbosity. Set to info, debug, or trace for more output. Example: RUST_LOG=rabbithole=debug. |
--depth)
Every URL in Rabbithole has an associated depth: the seed page
(/) is at depth 0. Links generated by the seed page are at
depth 1. Links generated by depth-1 pages are at depth 2, and so on.
The --depth flag sets a ceiling. When a page is being generated
and its depth equals or exceeds the limit:
---MAPPINGS--- block produced by the LLM for that page is
ignored. No new URLs are registered from it. This means
that any <a href="..."> links pointing to local paths on
that page will return a 404 if followed, because no prompt was ever stored
for them.
This prevents unbounded, infinite graph growth. Without a depth limit, a sufficiently creative LLM could generate links indefinitely, consuming API credits and disk space.
--depth to 5 will still be served from the cache.
| Value | Typical use |
|---|---|
0 |
Seed page only. No linked pages are ever registered. |
1 |
Seed + one level of direct links from the homepage. |
3 |
Good for small demo sites. Keeps the page count manageable. |
5 |
Default. Suitable for most documentation sites and wikis. |
10+ |
Deep exploratory sites. Watch API costs carefully. |
Generated pages are cached permanently in the SQLite database. Once a URL has been generated and stored, Rabbithole will always serve the cached version without calling the LLM again. There is currently no automatic TTL or expiry mechanism.
To invalidate cached content, you have two options:
This clears all cached pages and all URL-to-prompt mappings. The next request to any URL will regenerate from scratch, beginning with the seed.
rm rabbithole.db
Use the SQLite CLI (or any SQLite client) to remove a single cached page. Rabbithole will regenerate it on next request, using the stored prompt.
sqlite3 rabbithole.db -- See what's cached: SELECT url, length(html), created_at FROM pages ORDER BY created_at DESC; -- Delete a single page so it will be regenerated: DELETE FROM pages WHERE url = '/some-page.html'; -- Remove a URL from the mapping entirely -- (prevents it from being served or re-registered): DELETE FROM mappings WHERE url = '/some-page.html'; .quit
pages but
leave the corresponding row in mappings, Rabbithole will
regenerate the page using the stored prompt on next visit. If you also delete
from mappings, the URL becomes permanently unreachable until a
parent page is regenerated and re-registers the link.
rabbithole --seed seed.txt --model gpt-4o
rabbithole \ --seed seed.txt \ --model claude-sonnet-4-5 \ --port 3000 \ --db /var/lib/rabbithole/site.db
rabbithole \ --seed seed.txt \ --model gpt-4o \ --depth 8 \ --web-tools
ANTHROPIC_API_KEY=sk-ant-... rabbithole --config rabbithole.toml
rabbithole --config rabbithole.toml --port 9000
RUST_LOG=rabbithole=debug rabbithole --seed seed.txt --model gpt-4o
When the same option is set in multiple places, Rabbithole resolves it in this order (highest wins):