crates/ov_cli/README.md
Command-line interface for OpenViking - an Agent-native context database.
curl -fsSL https://raw.githubusercontent.com/volcengine/OpenViking/main/crates/ov_cli/install.sh | bash
# openviking need rust >= 1.91.1, please upgrade it if necessary
# brew upgrade rust
cargo install --path crates/ov_cli
Create ~/.openviking/ovcli.conf:
{
"url": "http://localhost:1933",
"api_key": "your-api-key",
"account": "acme",
"user": "alice",
"agent_id": "assistant-1"
}
role defaults to user and only applies in trusted mode. In api_key mode the server ignores it and derives the effective role from the API key. account and user are optional with a regular user key because the server can derive them from the key. They are recommended when you use trusted auth mode or a root key against tenant-scoped APIs.
# Add a resource
ov add-resource https://raw.githubusercontent.com/volcengine/OpenViking/refs/heads/main/docs/en/about/01-about-us.md --wait
# List contents
ov ls viking://resources
# Semantic search
ov find "what is openviking"
# Get file tree
ov tree viking://resources
# Read content
ov read viking://resources/...
add-resource - Import local files or URLsadd-skill - Add a skillexport - Export as .ovpackimport - Import .ovpackrelations - List relationslink - Create relation linksunlink - Remove relationls - List directory contentstree - Get directory treemkdir - Create directoryrm - Remove resourcemv - Move/renamestat - Get metadataread - Read L2 (full content)abstract - Read L0 (abstract)overview - Read L1 (overview)find - Semantic retrievalsearch - Context-aware retrievalgrep - Content pattern searchglob - File glob patternsystem wait - Wait for async processingsystem status - Component statussystem health - Health checkobserver queue - Queue statusobserver vikingdb - VikingDB statusobserver vlm - VLM statussession new - Create sessionsession list - List sessionssession get - Get session detailssession delete - Delete sessionsession add-message - Add messagesession commit - Commit and extract memoriesconfig show - Show configurationconfig validate - Validate configov --output json ls
ov --output table ls
ov -o json ls # Compact JSON wrapper for scripts
# Add URL and wait for processing
ov add-resource https://example.com/docs --wait --timeout 60
# Add local directory with advanced options
ov add-resource ./dir \
--wait --timeout 600 \
--ignore-dirs "subdir-a,subdir-b/subsubdir-c" \
--exclude "*.tmp,*.log"
# Search with threshold
ov find "API authentication" --threshold 0.7 --limit 5
# Recursive list
ov ls viking://resources --recursive
# Temporarily override identity from CLI flags
ov --account acme --user alice --agent-id assistant-2 ls viking://
# Glob search
ov glob "**/*.md" --uri viking://resources
# Session workflow
SESSION=$(ov -o json session new | jq -r '.result.session_id')
ov session add-message --session-id $SESSION --role user --content "Hello"
ov session commit --session-id $SESSION
# Build
cargo build --release
# Run tests
cargo test
# Install locally
cargo install --path .