Semantic code search plugin for OpenCode AI coding assistant
The OpenViking plugin for OpenCode provides semantic search across your indexed repositories. Once installed, the AI can search through any repo you’ve added to OpenViking, understanding concepts and intent rather than just matching keywords.
When indexed repos are available, the plugin injects context into the system prompt:
Copy
## OpenViking — Indexed Code RepositoriesThe following repos are semantically indexed and searchable.When the user asks about any of these projects, you MUST use the openviking skill:- **fastapi** (viking://resources/fastapi) A modern, fast web framework for building APIs with Python 3.7+- **requests** (viking://resources/requests) Python HTTP library for humans
This ensures the AI knows what’s available and when to use it.
Server is not running. Check if ~/.openviking/ov.conf exists:
Copy
# If config exists, start server:openviking-server --config ~/.openviking/ov.conf > /tmp/openviking.log 2>&1 &# Wait for health check:for i in $(seq 1 10); do ov health 2>/dev/null && break; sleep 3; done
If config doesn’t exist, create it first (see Installation step 2).
Skill not loading
Verify the skill was installed:
Copy
ls -la ~/.config/opencode/skills/openviking/SKILL.md
If missing, reinstall the plugin or manually copy the skill file from the OpenViking repo.
Searches return no results
Check if the repo is indexed:
Copy
ov ls viking://resources/
If your repo is missing, add it:
Copy
ov add-resource https://github.com/owner/repo --to viking://resources/ --timeout 300
You: Add https://github.com/encode/starlette to OpenVikingAI: [Executes add-resource command] Repository is being indexed. This will take 5-10 minutes.You: How does Starlette handle middleware?AI: [Automatically searches OpenViking] Starlette uses a middleware stack pattern. Here's how it works... [Shows relevant code from starlette/middleware/base.py]