Markdown source

Shell Completions

mdvdb generates version-matched completion scripts for Bash, Zsh, Fish, and PowerShell. The generator is the hidden completions utility, so it does not appear in mdvdb --help.

Generate a script

mdvdb completions <SHELL>
ShellValue
Bashbash
Zshzsh
Fishfish
PowerShellpower-shell

The script is written to stdout. Generate it with the same mdvdb binary users will run, and regenerate it after an upgrade.

Current command coverage

Generated scripts expose all 21 visible top-level commands from the current CLI:

WorkflowCommands
Retrieval and indexingsearch, ingest, status, info, collection, watch
Metadata and analysisschema, clusters, tree, get, modules
Setupshards, init, config, embedding, doctor
Graphlinks, backlinks, orphans, edges, graph

Beyond top-level names, coverage is shell-specific. Current scripts include a curated selection of embedding actions, cluster Topic actions, Shard management actions, module actions, collection query flags, and Shard selectors; PowerShell currently focuses on top-level commands. mdvdb <COMMAND> --help remains authoritative for every option.

Bash

Load completions for the current session:

source <(mdvdb completions bash)

Install for the current user:

mkdir -p ~/.local/share/bash-completion/completions
mdvdb completions bash > ~/.local/share/bash-completion/completions/mdvdb

Open a new shell after installation. The bash-completion package must be installed and loaded.

Zsh

Create a completion directory and generate _mdvdb:

mkdir -p ~/.zsh/completions
mdvdb completions zsh > ~/.zsh/completions/_mdvdb

Add the directory to fpath before compinit in ~/.zshrc:

fpath=(~/.zsh/completions $fpath)
autoload -Uz compinit
compinit

Then open a new shell. If an older definition remains cached, remove ~/.zcompdump once and run compinit again.

Fish

Install for the current user:

mkdir -p ~/.config/fish/completions
mdvdb completions fish > ~/.config/fish/completions/mdvdb.fish

Fish loads files from that directory automatically. For the current session only:

mdvdb completions fish | source

PowerShell

Load completions for the current session:

mdvdb completions power-shell | Out-String | Invoke-Expression

For persistent use, generate a separate script and dot-source it from $PROFILE:

$profileDir = Split-Path $PROFILE
New-Item -ItemType Directory -Force $profileDir | Out-Null
$completionPath = Join-Path $profileDir "mdvdb-completions.ps1"
mdvdb completions power-shell | Set-Content $completionPath
Add-Content $PROFILE ". `"$completionPath`""

Regenerate mdvdb-completions.ps1 after upgrading instead of appending duplicate completer blocks to the profile.

Verify

After loading the script, type mdvdb and request completion. The list should include newer surfaces such as:

embedding  info  shards  collection  modules  graph

You can also inspect the generated script directly:

mdvdb completions zsh | less

If completion does not appear, first confirm the generated output is non-empty, then check the shell-specific loader (bash-completion, Zsh compinit, Fish’s completion directory, or the PowerShell profile execution policy).