v0.9.3 is live! — Read the latest technical documentation and migration guides.

docmd-search provides a command-line interface to index documentation and search your files directly.

Usage Syntax

docmd-search [directory] [options]

If no target directory is specified, docmd-search indexes the current directory (.).

Primary Commands & Modes

docmd-search ./docs

Indexes the specified folder and launches an interactive terminal search interface. Incremental indexing automatically skips unchanged files.

Index & Web Interface Server

docmd-search ./docs --ui

Indexes the folder and starts a local web server to preview the web search interface.

Interactive Settings Menu

docmd-search --settings

Opens the terminal configuration menu to select embedding models or update global preferences.

Help

docmd-search --help

Version

docmd-search --version

Command Line Flags

Flag Abbreviation Description
--ui Starts a local browser preview server after indexing completes
--dev Enables verbose logging output (file paths, model settings, debug timing)
--model <id> Overrides the embedding model for the current run
--settings Opens the interactive terminal settings menu
--version -v Displays the installed package version number
--help -h Displays usage syntax and available flags

Usage Examples

Directory Indexing
Web Interface Server
Model Overrides
CI/CD Build Pipelines
# Index the docs/ subfolder in your workspace
docmd-search ./docs

# Index current directory
docmd-search .

# Run without arguments (indexes current directory)
docmd-search
# Index and launch browser preview UI
docmd-search ./docs --ui

# Launch with verbose logging enabled
docmd-search ./docs --ui --dev
# Force multilingual model for i18n site build
docmd-search ./docs --model Xenova/paraphrase-multilingual-MiniLM-L12-v2

# Force high-dimensional multilingual model
docmd-search ./docs --model Xenova/paraphrase-multilingual-mpnet-base-v2

# Override model without changing global config.json
docmd-search ./docs --model Xenova/all-MiniLM-L6-v2
# Index docs as part of a build script
docmd-search ./docs
# The _docmd-search/ folder is generated as a static output asset

Exit Codes

Exit Code Meaning
0 Success (indexing completed, terminal search exited normally, or help/version printed)
1 Failure (missing required peer dependencies, invalid path, or unexpected error)

File & Configuration Paths

  • Global Config File: ~/.docmd-search/config.json (Stores global model selection and settings)
  • Project Config File: _docmd-search/config.json (Stores project-level overrides)
  • Model Weight Cache: ~/.docmd-search/models/ (Stores cached ONNX model files)
Peer Dependencies

Generating vector embeddings requires @huggingface/transformers and onnxruntime-node. If they are not installed, the CLI displays installation instructions and exits with code 1.