| name | openviking |
| description | Activate when the user asks about any repository listed in the system prompt under 'OpenViking — Indexed Code Repositories', or when they ask about an external library, framework, or project that may have been indexed. Also activate when the user wants to add, remove, or manage repos. Always search the local codebase first before using this skill. |
| license | MIT |
| compatibility | opencode |
OpenViking Code Repository Search
IMPORTANT: All ov commands are terminal (shell) commands — run them via the bash tool. Execute directly — no pre-checks, no test commands. Handle errors when they occur.
How OpenViking Organizes Data
OpenViking stores content in a virtual filesystem under the viking:// namespace. Each URI maps to a file or directory, e.g. viking://resources/fastapi/routing.py. Each directory has AI-generated summaries (abstract / overview). The key principle: narrow the URI scope to improve retrieval efficiency. Instead of searching all repos, lock to a specific repo or subdirectory — this reduces noise and speeds up results significantly.
Search Commands
Choose the right command based on what you're looking for:
| Command | Use when | Example |
|---|
ov search | Semantic search — use for concept/intent based queries | "dependency injection", "how auth works" |
ov grep | You know the exact keyword or symbol | function name, class name, error string |
ov glob | You want to enumerate files by pattern | all *.py files, all test files |
ov search "dependency injection" --uri viking://resources/fastapi --limit 10
ov search "how tokens are refreshed" --uri viking://resources/fastapi/fastapi/security
ov search "JWT authentication" --limit 10
ov search "error handling" --limit 5 --threshold 0.7
ov grep "verify_token" --uri viking://resources/fastapi
ov grep "class.*Session" --uri viking://resources/requests/requests
ov glob "**/*.py" --uri viking://resources/fastapi
ov glob "**/test_*.py" --uri viking://resources/fastapi/tests
ov glob "**/*.py" --uri viking://resources/
Narrowing scope: once you identify a relevant directory, pass it as --uri to restrict subsequent searches to that subtree — this is faster and more precise than searching the whole repo.
Query formulation: write specific, contextual queries rather than single keywords.
ov search "API"
ov search "REST API authentication with JWT tokens"
ov search "JWT token refresh flow" --uri viking://resources/backend
Read Content
ov abstract viking://resources/fastapi/fastapi/dependencies/
ov overview viking://resources/fastapi/fastapi/dependencies/
ov read viking://resources/fastapi/fastapi/dependencies/utils.py
ov read viking://resources/fastapi/fastapi/dependencies/utils.py --offset 100 --limit 50
abstract / overview only work on directories. read only works on files.
Browse
ov ls viking://resources/
ov ls viking://resources/fastapi
ov ls viking://resources/fastapi --simple
ov ls viking://resources/fastapi --recursive
ov tree viking://resources/fastapi
ov tree viking://resources/fastapi -L 2
ov tree viking://resources/fastapi -l 200
ov tree viking://resources/fastapi -L 2 -l 200
-L controls how many levels deep the tree expands. -l controls the length of the AI-generated summary per directory. Use ov tree -L 2 -l 200 as a good starting point to understand a repo's structure before diving in.
Add a Repository
ov add-resource https://github.com/owner/repo --to viking://resources/repo --timeout 300
--timeout is required (seconds). Use 300 (5 min) for small repos, increase for larger ones.
After submitting, run ov observer queue once and report status to user. Indexing runs in background — do not poll or wait.
| Repo Size | Files | Est. Time |
|---|
| Small | < 100 | 2–5 min |
| Medium | 100–500 | 5–20 min |
| Large | 500+ | 20–60+ min |
Remove a Repository
ov rm viking://resources/fastapi --recursive
This permanently deletes the repo and all its indexed content. Confirm with the user before running.
Error Handling
command not found: ov → Tell user: pip install openviking --upgrade. Stop.
url is required / CLI_CONFIG error → Auto-create config and retry:
mkdir -p ~/.openviking && echo '{"url": "http://localhost:1933"}' > ~/.openviking/ovcli.conf
CONNECTION_ERROR / failed to connect:
More Help
For other issues or command details, run:
ov help
ov <command> --help