From grug-brain
Add documentation to grug-brain for FTS-indexed search. Ingest from local directories or GitHub repos. Supports subfolder paths like github:owner/repo/path/to/section.
How this command is triggered — by the user, by Claude, or both
Slash command
/grug-brain:ingest sourceThis command is limited to the following tools:
The summary Claude sees in its command listing — used to decide when to auto-load this command
Add documentation to grug-brain as a brain entry. Each doc set lives in a directory that grug-brain indexes on startup. Docs are searchable via `grug-search` and `grug-read`. ## 1. Determine the source `$ARGUMENTS` contains the source. Handle each type: - **Local directory** (path exists on disk): Use directly. - **GitHub repo** (`github:<owner>/<repo>`): Clone entire repo, ingest all markdown. - **GitHub subfolder** (`github:<owner>/<repo>/<path>`): Clone repo, ingest only the specified subfolder. Examples: - `github:ryanthedev/grug-docs/agentic-planning` — entire category - `github...
Add documentation to grug-brain as a brain entry. Each doc set lives in a directory that grug-brain indexes on startup. Docs are searchable via grug-search and grug-read.
$ARGUMENTS contains the source. Handle each type:
github:<owner>/<repo>): Clone entire repo, ingest all markdown.github:<owner>/<repo>/<path>): Clone repo, ingest only the specified subfolder. Examples:
github:ryanthedev/grug-docs/agentic-planning — entire categorygithub:ryanthedev/grug-docs/agentic-planning/extractions — just extractionsParse the GitHub source by splitting on / after github: — first two segments are owner/repo, the rest is the path within the repo.
Short, lowercase, hyphens only (e.g., react-native, agentic-planning).
agentic-planning from agentic-planning/extractions).The target directory is where docs will live on disk. Default: ~/.grug-brain/<brain-name>/. Ask the user if they prefer a different location.
Check if a brain with this name already exists in ~/.grug-brain/brains.json:
cat ~/.grug-brain/brains.json 2>/dev/null
If a brain with this name already exists and has a source field, offer to re-ingest from the stored source without asking for the source again. If the user confirms, skip step 1 and use the stored source. If no source is stored, ask: update (provide source again), or cancel?
rsync -av --include='*/' --include='*.md' --include='*.mdx' --exclude='_*' --exclude='.*' --exclude='*' <source>/ <target-dir>/
Clone shallowly:
git clone --depth 1 <repo-url> /tmp/grug-ingest
Where <repo-url> is https://github.com/<owner>/<repo>.git (only owner/repo, not the subfolder path).
Determine the source directory inside the clone:
find /tmp/grug-ingest -maxdepth 3 -type d -name docs -o -name documentation -o -name content | head -5). If no obvious docs dir, list top-level and ask the user./tmp/grug-ingest/<path> directly. If it doesn't exist, list what's available and ask.Copy the files, preserving structure relative to the source:
rsync -av --include='*/' --include='*.md' --include='*.mdx' --exclude='_*' --exclude='.*' --exclude='*' /tmp/grug-ingest/<source-dir>/ <target-dir>/
rm -rf /tmp/grug-ingest
If zero files were copied, report the error and do not proceed. Check:
find <target-dir> -name '*.md' -o -name '*.mdx' | wc -l
After files are in place, add (or update) the brain entry in ~/.grug-brain/brains.json.
Read the current config:
cat ~/.grug-brain/brains.json 2>/dev/null || echo '[]'
Add the new entry. Ingested docs brains are read-only and non-primary. Include the source field using the original source argument so re-ingestion can use it without re-asking:
{
"name": "<brain-name>",
"dir": "<target-dir>",
"primary": false,
"writable": false,
"flat": false,
"git": null,
"source": "<original source argument, e.g. github:owner/repo/path or local absolute path>"
}
If the directory structure is flat (all files at top level, no category subdirectories), use "flat": true instead.
Write the updated array back to ~/.grug-brain/brains.json. Preserve all existing entries — only add or replace the entry for this brain name.
Tell the user:
/setup)github:org/grug-docs/agentic-planning/extractions~/.grug-brain/brains.json and restart the MCP server.npx claudepluginhub ryanthedev/grug-brain.mcp/ingestIngests URLs, file paths, freeform text, or inbox files into a wiki. Auto-detects type; handles tweets via Grok, GitHub repos, articles/papers; supports custom titles, types, wiki selection.
/ingestFetches paper via URL, arXiv ID, DOI, or PDF path and generates 4-section triage summary (Key Takeaways, Background, Main Idea & Summary, Critique). Adds to vault if new.
/ingestIngests a source (paper, article, transcript, PDF, notes) into the LLM Wiki: reads/chunks content, discusses takeaways, updates pages, handles ontology graph, logs changes, reports actions.
/ingestSummarizes current conversation (user request, solution, decisions, insights) and ingests it into CORE memory using memory_ingest tool. Optionally associates with a space and confirms success.
/ingestManually adds entries to a Weaviate knowledge store. Supports single or bulk ingest from text, files, or URLs, with automatic schema detection and collection mapping.