/tea-rags-setup:install [project path]from tea-rags-setup
One-step TeaRAGs install for Claude Code, Cursor, Codex and ZCode: detects host, profiles languages, picks embedding model, installs tea-rags, llama-server pool, model, plugin + MCP server, registers and indexes the project.
Ships in tea-rags-setup. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
None: SKILL.md is the whole skill.
Same flow in every harness and OS. Order fixed: detect → ignore → profile → plan → ONE confirmation → apply → verify. No question before the plan, none after the confirmation.
choose-model result. Show its rule string verbatim; never derive
the model yourself.tea-rags server (global binary, never npx), config WITHOUT
env — project registry holds embedding config.<project> = argument, else cwd (absolute). Helper scripts live in
${CLAUDE_PLUGIN_ROOT}/scripts/. Variable not expanded in your harness → use
the scripts/ folder two levels above this SKILL.md
(<this skill dir>/../../scripts) in its place.
node --version. Missing or major < 22 → STOP before Step 1, print the install
line for the OS, ask user to re-run after a new terminal:
| OS | Command |
|---|---|
| macOS (Homebrew) | brew install node@24 |
| Windows | winget install OpenJS.NodeJS.LTS |
| Linux (Debian/Ubuntu) | curl -fsSL https://deb.nodesource.com/setup_24.x | sudo -E bash - && sudo apt-get install -y nodejs |
| other | installer from https://nodejs.org (v24) |
node "${CLAUDE_PLUGIN_ROOT}/scripts/detect.mjs" "<project>" → JSON:
{ os, arch, ramGb, gpuBackend, node: { version, ok }, teaRags: { version } | null, harness, registered: { name } | null }.
node.ok false → Step 0 table, STOP. harness decides the Step 5 row.
Latest published client: npm view tea-rags version.
node "${CLAUDE_PLUGIN_ROOT}/scripts/contextignore.mjs" "<project>" →
{ added, kept }. Merges build outputs, vendored dirs, lockfiles, minified
assets into <project>/.contextignore.local; user lines never removed. Runs
before the profile so shares exclude generated code.
node "${CLAUDE_PLUGIN_ROOT}/scripts/profile.mjs" "<project>" →
{ files, loc, languages: { <lang>: { files, loc, share } }, estimatedChunks }.
Shares JSON = { "<lang>": <share>, … } from languages.
Model — client installed:
tea-rags llama-server choose-model --shares '<shares json>'; client missing →
npx -y tea-rags@latest llama-server choose-model --shares '<shares json>'.
Windows PowerShell 5.1 strips inner quotes → escape them:
--shares '{\"ruby\":0.06,\"typescript\":0.94}' (PowerShell 7.3+ and POSIX
shells take the plain form). Output { model, rule, window, dimensions }.
Alias = registered.name when present, else project folder name lowercased, non
[a-z0-9_-] → -, matching ^[a-z0-9][a-z0-9_-]{0,63}$. Existing alias →
tea-rags projects info --name <alias>; embeddingModel set and ≠ <model> →
Index: line carries --force (Step 5.8).
Print this block, slots filled, then ask:
TeaRAGs install plan — <project>
Host: <os>/<arch>, <ramGb> GB RAM, GPU backend <gpuBackend>, harness <harness>
Client: tea-rags <installed version | not installed> → <latest> (npm i -g tea-rags@latest | up to date)
Project: <files> files, <loc> LOC, ~<estimatedChunks> chunks; top languages <lang share%, …>
Ignore: .contextignore.local +<added count> patterns
Model: <model> (<dimensions>d, window <window>) — <rule>
Embeddings: llama-server pool, instances by bench (≥ 2), loopback ports 20000–29999
Rust: rustc driver install | not needed (no Rust)
Register: alias <alias> (<new | existing — env updated>), git analytics on
Plugin+MCP: <harness>: tea-rags plugin pinned v<latest> + MCP `tea-rags server`, no env
Index: EMBEDDING_MODEL=<model> tea-rags index-codebase --project <alias> [--force if model changed] --wait-enrichments --json (foreground)
Thresholds: Ruby ≥ 5% or Swift ≥ 5% → CodeRankEmbed; Muninn languages ≥ 80% → Muninn-small; else jina
ONE AskUserQuestion (no such tool → ask the user), options: Install /
Change model / Cancel.
Install → Step 5, no further question.Change model → one pick among nomic-ai/CodeRankEmbed,
jinaai/jina-embeddings-v2-base-code, brokkai/Muninn-small; the pick IS the
confirmation → Step 5 with that model.Cancel → stop; .contextignore.local stays (harmless, user-editable).Each command foreground, waited on (long ones: timeout ≥ 10 min).
Client missing or older than latest → npm i -g tea-rags@latest; then
tea-rags --version = <ver>. Say once: "Client auto-update is ON (runs
from tea-rags prime); turn off: tea-rags update --auto off."
tea-rags llama-server install
tea-rags llama-server fetch-model <model>
tea-rags llama-server start --model <model> --instances auto → JSON
{ model, endpoints, instances, bench }. <endpoints> = endpoints joined
with ,.
Rust in profile → tea-rags rustc-driver install, then
tea-rags rustc-driver status.
Register (registry = env source of truth):
tea-rags projects register --path "<project>" --name <alias> --env EMBEDDING_PROVIDER=llama-server --env "EMBEDDING_BASE_URL=<endpoints>" --env TRAJECTORY_GIT_ENABLED=truetea-rags projects set-env --name <alias> EMBEDDING_PROVIDER=llama-server "EMBEDDING_BASE_URL=<endpoints>" TRAJECTORY_GIT_ENABLED=trueNever EMBEDDING_MODEL in register / set-env: CLI rejects it (index run
alone records the model). Step 8 exports it.
Plugin + MCP, block for harness (pin = v<ver>, never a branch):
claude plugin marketplace add https://github.com/artk0de/TeaRAGs-MCP.git#v<ver>
→ claude plugin install tea-rags@tea-rags --scope user →
claude mcp add --scope user tea-rags -- tea-rags server.codex plugin marketplace add artk0de/TeaRAGs-MCP --ref v<ver> --sparse .agents --sparse harness/codex
→ codex plugin add tea-rags@tea-rags.<npm root -g>/tea-rags/harness/cursor/tea-rags into
~/.cursor/plugins/local/. POSIX:
cp -R "$(npm root -g)/tea-rags/harness/cursor/tea-rags" ~/.cursor/plugins/local/
· PowerShell:
Copy-Item -Recurse "$(npm root -g)\tea-rags\harness\cursor\tea-rags" "$HOME\.cursor\plugins\local\".tea-rags update refreshes:
zcode plugins marketplace add "$(npm root -g)/tea-rags/harness/zcode" →
zcode plugins install tea-rags@tea-rags. ZCode CLI not on PATH → run the
bundled one: /Applications/ZCode.app/Contents/Resources/glm/zcode.cjs
(macOS).Marketplace already added at another ref → tea-rags update re-pins it to
v<ver> instead of the add. Never add an env block to any MCP config;
project-level MCP entry for tea-rags (<project>/.mcp.json,
.cursor/mcp.json, <project>/.zcode/config.json) → report it as duplicate,
never write one.
Index, model exported for this run — registry records it, later runs,
tea-rags server, tea-rags call and auto-update replay it unexported.
POSIX:
EMBEDDING_MODEL=<model> tea-rags index-codebase --project <alias> --wait-enrichments --json
· PowerShell:
$env:EMBEDDING_MODEL="<model>"; tea-rags index-codebase --project <alias> --wait-enrichments --json.
Foreground, timeout ≥ 60 min on large repos. Read outcome.measured, then
outcome.failed / outcome.degraded.
Existing alias, index built with another model
(tea-rags projects info --name <alias> → embeddingModel ≠ <model>):
plain run stops with Embedding model mismatch (model guard). Add --force
to the same command — full re-embed into a new collection, alias swaps at the
end, search stays up. Step 4 put it on the Index: line; the one
confirmation covers it.
MCP server live in this session (after harness reload) →
get_index_status(project: "<alias>"), then one
semantic_search(project: "<alias>", path: "<project>", query: "<main entry point concept of the top language>", limit: 3).
Not live yet → same calls via CLI:
tea-rags call get_index_status '{"project":"<alias>"}'.
Report, slots filled:
TeaRAGs installed — <alias>
Model: <model> on <instances> llama-server instances (<endpoints>)
Index: <chunks> chunks, status <status>, enrichment <measured: ok | failed: … | degraded: …>
Search: <top hit relativePath> — <ok | no hits>
Next: restart / reload <harness> so the plugin hooks and MCP server load
Auto-update: on (`tea-rags update --auto off` to disable)
HTTPS_PROXY (POSIX export HTTPS_PROXY=http://host:port, PowerShell
$env:HTTPS_PROXY="http://host:port"), re-run.npm i -g → fix npm prefix ownership or use a Node version manager;
never sudo npm.command not found after install → new terminal (PATH refresh), re-run.rule string.env in an MCP config or write a project-level MCP duplicate.&, nohup, Start-Process, background job).What SKILL.md sets; muted values are Claude Code's defaults
npx claudepluginhub artk0de/tearags-mcp --plugin tea-rags-setup2 skills in this plugin
Other plugins' skills for the same job