rag-cli-operator
Installation
SKILL.md
rag-cli Operator
Purpose
Run this project's local RAG workflow safely and consistently using uv run rag-cli ....
When To Use
Use this skill when requests mention:
rag-cliuvinit,ingest,query, ordocs- document indexing/search in this repo
- tool-friendly JSON outputs (
--format json)
Command Order
Follow this order unless the user asks otherwise:
uv syncuv run rag-cli init --workspace <path>uv run rag-cli ingest --workspace <path> --src <path> [--recursive] [--ext ...] --format jsonuv run rag-cli query --workspace <path> --question "<question>" --mode hybrid --top-k 3 --format jsonuv run rag-cli docs --workspace <path> --format json
Standard Command Templates
uv sync
uv run rag-cli --help
uv run rag-cli init --workspace .
uv run rag-cli ingest --workspace . --src ./docs --recursive --ext "pdf,docx,md" --format json
uv run rag-cli query --workspace . --question "What is SPI timing?" --mode hybrid --top-k 3 --format json
uv run rag-cli docs --workspace . --format json
Output Contract
Default to --format json when output will be consumed by an agent/tool.
Expected success shape:
answer: stringsnippets: [{ doc, section, text }]meta: object
Expected error shape:
error: { code, message, details }
If command output is for humans only, --format text is acceptable.
Workspace And Config Rules
- Always pass
--workspaceexplicitly when not operating in repo root. initcreates.rag/and baseline config/index state.- Required environment/config keys:
POE_API_KEY(preferred)OPENAI_BASE_URL(default:https://api.poe.com/v1)LLM_MODEL(default:gemini-3.1-flash-lite)EMBEDDING_MODEL(optional)
- Backward compatibility:
OPENAI_API_KEYis accepted ifPOE_API_KEYis not set.
PowerShell Machine-Level Env Setup
[Environment]::SetEnvironmentVariable("POE_API_KEY", "your-key", "Machine")
[Environment]::SetEnvironmentVariable("OPENAI_BASE_URL", "https://api.poe.com/v1", "Machine")
[Environment]::SetEnvironmentVariable("LLM_MODEL", "gemini-3.1-flash-lite", "Machine")
# Optional if your provider supports embeddings:
[Environment]::SetEnvironmentVariable("EMBEDDING_MODEL", "", "Machine")
Agent Integration Notes
Keep parameter naming aligned with:
skills/search_docs_cli.jsonworkspace,question,mode,top_k
skills/index_files_cli.jsonworkspace,path,recursive,ext
When mapping tool calls, preserve these names to avoid wrapper drift.
Troubleshooting
Missing .rag index
Symptoms:
docsorqueryfails with missing index messages.
Action:
- Run
uv run rag-cli init --workspace <path> - Re-run
ingest - Retry
queryordocs
Empty ingest results
Symptoms:
ingestreports no files found or indexed count is zero.
Action:
- Check
--srcpath exists. - Confirm extension filter via
--ext. - Add
--recursivefor nested folders. - Re-run ingest with
--format jsonand inspectmeta.
Missing API/env values
Symptoms:
- model/provider errors when running query pipelines that require remote backends.
Action:
- Set required env keys.
- Re-run from same shell/session.
- Verify with a simple
querycall.
Non-zero exit code
Action sequence:
- Re-run same command with
--format json. - Parse
error.codeanderror.message. - Apply minimal fix.
- Re-run only the failed step, then continue command order.