/** brainbank help — Show CLI usage. */ import { c } from '@/cli/utils.ts'; export function showHelp(): void { console.log(c.bold('\n━━━ BrainBank — Semantic Knowledge Bank ━━━\n')); console.log(c.bold('Indexing:')); console.log(` ${c.cyan('index')} ${c.dim('(i)')} [path] Index code + git history`); console.log(` ${c.cyan('collection add')} --name Add a document collection`); console.log(` ${c.cyan('collection list')} List collections`); console.log(` ${c.cyan('collection remove')} Remove a collection`); console.log(` ${c.cyan('docs')} [--collection ] Index document collections`); console.log(''); console.log(c.bold('Search:')); console.log(` ${c.cyan('search')} Semantic search (vector)`); console.log(` ${c.cyan('hsearch')} Hybrid search (${c.bold('best quality')})`); console.log(` ${c.cyan('ksearch')} Keyword search (BM25, instant)`); console.log(` ${c.cyan('dsearch')} Document search`); console.log(c.dim(' All accept --repo --path -- ')); console.log(''); console.log(c.bold('Query:')); console.log(` ${c.cyan('query')} ${c.dim('(q)')} Get AI-pruned context for a task`); console.log(` ${c.cyan('context')} ${c.dim('(deprecated → use query)')}`); console.log(` ${c.cyan('context add')} Add context metadata`); console.log(` ${c.cyan('context list')} List all context metadata`); console.log(` ${c.cyan('files')} [...] [--lines] View full indexed files directly`); console.log(''); console.log(c.bold('KV Store:')); console.log(` ${c.cyan('kv add')} Add item to a collection`); console.log(` ${c.cyan('kv search')} Search a collection`); console.log(` ${c.cyan('kv list')} [coll] List collections or items`); console.log(` ${c.cyan('kv trim')} --keep Keep only N most recent`); console.log(` ${c.cyan('kv clear')} Clear all items`); console.log(''); console.log(c.bold('Utility:')); console.log(` ${c.cyan('stats')} Show index statistics`); console.log(` ${c.cyan('reembed')} Re-embed all vectors`); console.log(` ${c.cyan('reindex')} [path] Nuke data + re-index from scratch`); console.log(` ${c.cyan('watch')} Watch files, auto-re-index`); console.log(` ${c.cyan('mcp')} Start MCP server (stdio)`); console.log(` ${c.cyan('mcp:export')} [target] Export MCP config (antigravity)`); console.log(` ${c.cyan('daemon')} Start HTTP daemon (foreground)`); console.log(` ${c.cyan('daemon start')} Start HTTP daemon (background)`); console.log(` ${c.cyan('daemon stop')} Stop background daemon`); console.log(` ${c.cyan('daemon restart')} Restart background daemon`); console.log(` ${c.cyan('status')} Show daemon status`); console.log(` ${c.cyan('--version')} ${c.dim('(-v)')} Show version`); console.log(''); console.log(c.bold('Options:')); console.log(` ${c.dim('--repo ')} Repository path (default: .)`); console.log(` ${c.dim('--force')} Force re-index all files`); console.log(` ${c.dim('--depth ')} Git history depth (default: 500)`); console.log(` ${c.dim('--collection ')} Filter by collection`); console.log(` ${c.dim('--pattern ')} Collection glob (default: **/*.md)`); console.log(` ${c.dim('--context ')} General task context for pruner (inline or @file)`); console.log(` ${c.dim('--pruner ')} Specific pruning focus (inline or @file)`); console.log(` ${c.dim('-- ')} Source filter: max results from (0 = skip)`); console.log(` ${c.dim('--path ')} Filter context results to files under this path prefix`); console.log(` ${c.dim('--ignore ')} Ignore glob patterns for code indexing (comma-separated)`); console.log(` ${c.dim('--include ')} Include only these paths for code indexing (comma-separated)`); console.log(` ${c.dim('--yes / -y')} Skip interactive prompt (auto-select all available)`); console.log(` ${c.dim('--setup')} Re-run interactive setup (modules, folders, config)`); console.log(` ${c.dim('--port ')} HTTP daemon port (default: 8181)`); console.log(''); console.log(c.bold('Examples:')); console.log(c.dim(' brainbank index .')); console.log(c.dim(' brainbank index . --ignore "sdk/**,vendor/**"')); console.log(c.dim(' brainbank index . --include "src/**,lib/**"')); console.log(c.dim(' brainbank kv add errors "Fixed null pointer in api.ts"')); console.log(c.dim(' brainbank kv search errors "null pointer"')); console.log(c.dim(' brainbank kv list')); console.log(c.dim(' brainbank hsearch "authentication middleware"')); console.log(c.dim(' brainbank hsearch "auth" --code 0 --git 10 # git only')); console.log(c.dim(' brainbank search "handler" --git 0 # code only')); console.log(c.dim(' brainbank hsearch "api" --docs 10 --code 0 --git 0 # docs only')); console.log(c.dim(' brainbank query "auth flow" | pbcopy # → clipboard')); console.log(c.dim(' brainbank query "auth" --context @issue.md # with task context')); console.log(c.dim(' brainbank query "auth" --pruner "JWT refresh" # focused pruning')); console.log(c.dim(' brainbank daemon start # background HTTP')); console.log(c.dim(' brainbank mcp # MCP stdio')); console.log(c.dim(' brainbank mcp:export antigravity # export MCP config')); }