DocuBrowse

Reference

CLI, configuration and security details for v1.5.2. On an installed system use docubrowser; from a cloned repo use ./docubrowser.py.

Command-line interface

docubrowser <command> [options]
CommandDescription
start / stop / restartControl the search server (start runs the Ollama check first)
statusServer status, document, embedding and tag counts
scan [TYPE ...]Scan, index and embed documents. --no-embed skips embedding
rescan [TYPE ...]Alias for scan
scan-file --file PATHIndex a single file, then embed it
embedGenerate embeddings for un-embedded documents
openOpen the UI in your default browser
purgeScan the index for PII and remove matching documents
ignore add|remove|list DIRManage excluded directories (auto-purges on add)
reportFile-type breakdown, no DB changes
scan-missing [--dry-run]Remove rows for genuinely missing files; leaves unmounted paths alone
stopallStop all scans, embeds and the server
duplist / dupcleanList duplicates / interactively review and remove them

Global options

--db PATH      SQLite database path (overrides config)
--port PORT    Server port (overrides config)
--config FILE  Config file path

Examples

docubrowser start --port 9000
docubrowser scan pdf txt              # only PDFs and plain text
docubrowser scan --limit 100          # first 100 unindexed files
docubrowser scan --workers 4          # 4 extraction workers
docubrowser scan-file --file /path/to/document.pdf
docubrowser purge --dry-run           # preview PII matches (safe)
docubrowser ignore add ~/Documents/myWorkDocs
docubrowser duplist --near-dups --threshold 0.95
docubrowser scan-missing --dry-run

Type filters for scan: pdf, txt, md, html; the default is all supported types.

scan-file is for retrying problem files: it removes the file from scan_blacklist.txt, refuses files in pii_blacklist.txt, and routes scanned PDFs to ocr_list_pdfs.txt.

Configuration

DocuBrowse reads the first config file it finds: /etc/docubrowse.config, then ./docubrowse.config next to docubrowser.py.

# docubrowse.config
doc_dir      = ~/Documents
db_path      = /home/user/DocuBrowse/du-docs.db
port         = 8643
work_dir     = /home/user/DocuBrowse
lang         = en
KeyDefault
doc_dirNone. Must be configured via Settings or the config file
db_path<script dir>/du-docs.db
port8643
work_dir<script dir>
langen (also ja, ko, zh, zh-hant)

Environment variables

Environment variables override matching config keys. CLI flags still win.

VariableDescription
DOCUBROWSE_DOC_DIRPrimary document directory
DOCUBROWSE_DB / DOCUBROWSE_DB_PATHPath to du-docs.db
DOCUBROWSE_PORTHTTP port (default 8643)
DOCUBROWSE_WORK_DIRWorking directory for runtime data
OLLAMA_HOSTOllama base URL (default http://localhost:11434); also DOCUBROWSE_OLLAMA_HOST

Architecture

docubrowser.py (CLI)  ──►  scan_docs.py (ProcessPoolExecutor, extractors, embed_docs.py)
ensure_ollama.py            doc_search.py (HTTP :8643)
                                   │                   │
                                   └────────┬──────────┘
                                            ▼
                         du-docs.db (SQLite FTS5)  +  Ollama
                         (nomic-embed-text, dolphin3)

Keyword scoring uses FTS5 BM25 with title and author weighted above body and tags. Semantic scoring compares query embeddings with document embeddings. Hybrid keeps the stronger of the two scores per document. See the README for the full algorithm.

Security

DocuBrowse binds to 127.0.0.1 and is meant for single-user local use. It is hardened so a malicious web page you visit cannot reach it:

There is no user login because only you, on your own machine, can reach the server.