|
| 1 | +# OpenViking CLI |
| 2 | + |
| 3 | +Command-line interface for [OpenViking](https://github.com/volcengine/OpenViking) - an Agent-native context database. |
| 4 | + |
| 5 | +## Installation |
| 6 | + |
| 7 | +### Quick Install (Linux/macOS) |
| 8 | + |
| 9 | +```bash |
| 10 | +curl -fsSL https://raw.githubusercontent.com/volcengine/OpenViking/main/crates/ov_cli/install.sh | bash |
| 11 | +``` |
| 12 | + |
| 13 | +### From Source |
| 14 | + |
| 15 | +```bash |
| 16 | +cargo install --path crates/ov_cli |
| 17 | +``` |
| 18 | + |
| 19 | +## Configuration |
| 20 | + |
| 21 | +Create `~/.openviking/ovcli.conf`: |
| 22 | + |
| 23 | +```json |
| 24 | +{ |
| 25 | + "url": "http://localhost:1933", |
| 26 | + "api_key": "your-api-key" |
| 27 | +} |
| 28 | +``` |
| 29 | + |
| 30 | +## Quick Start |
| 31 | + |
| 32 | +```bash |
| 33 | +# Add a resource |
| 34 | +ov add-resource https://raw.githubusercontent.com/volcengine/OpenViking/refs/heads/main/docs/en/about/01-about-us.md --wait |
| 35 | + |
| 36 | +# List contents |
| 37 | +ov ls viking://resources |
| 38 | + |
| 39 | +# Semantic search |
| 40 | +ov find "what is openviking" |
| 41 | + |
| 42 | +# Get file tree |
| 43 | +ov tree viking://resources |
| 44 | + |
| 45 | +# Read content |
| 46 | +ov read viking://resources/... |
| 47 | +``` |
| 48 | + |
| 49 | +## Command Groups |
| 50 | + |
| 51 | +### Resource Management |
| 52 | +- `add-resource` - Import local files or URLs |
| 53 | +- `add-skill` - Add a skill |
| 54 | +- `export` - Export as .ovpack |
| 55 | +- `import` - Import .ovpack |
| 56 | + |
| 57 | +### Relations |
| 58 | +- `relations` - List relations |
| 59 | +- `link` - Create relation links |
| 60 | +- `unlink` - Remove relation |
| 61 | + |
| 62 | +### Filesystem |
| 63 | +- `ls` - List directory contents |
| 64 | +- `tree` - Get directory tree |
| 65 | +- `mkdir` - Create directory |
| 66 | +- `rm` - Remove resource |
| 67 | +- `mv` - Move/rename |
| 68 | +- `stat` - Get metadata |
| 69 | + |
| 70 | +### Content Access |
| 71 | +- `read` - Read L2 (full content) |
| 72 | +- `abstract` - Read L0 (abstract) |
| 73 | +- `overview` - Read L1 (overview) |
| 74 | + |
| 75 | +### Search |
| 76 | +- `find` - Semantic retrieval |
| 77 | +- `search` - Context-aware retrieval |
| 78 | +- `grep` - Content pattern search |
| 79 | +- `glob` - File glob pattern |
| 80 | + |
| 81 | +### System |
| 82 | +- `system wait` - Wait for async processing |
| 83 | +- `system status` - Component status |
| 84 | +- `system health` - Health check |
| 85 | +- `observer queue` - Queue status |
| 86 | +- `observer vikingdb` - VikingDB status |
| 87 | +- `observer vlm` - VLM status |
| 88 | + |
| 89 | +### Session |
| 90 | +- `session new` - Create session |
| 91 | +- `session list` - List sessions |
| 92 | +- `session get` - Get session details |
| 93 | +- `session delete` - Delete session |
| 94 | +- `session add-message` - Add message |
| 95 | +- `session commit` - Commit and extract memories |
| 96 | + |
| 97 | +### Config |
| 98 | +- `config show` - Show configuration |
| 99 | +- `config validate` - Validate config |
| 100 | + |
| 101 | +## Output Formats |
| 102 | + |
| 103 | +```bash |
| 104 | +ov --output json ls |
| 105 | +ov --output table ls |
| 106 | +ov --json ls # Compact JSON wrapper for scripts |
| 107 | +``` |
| 108 | + |
| 109 | +## Examples |
| 110 | + |
| 111 | +```bash |
| 112 | +# Add URL and wait for processing |
| 113 | +ov add-resource https://example.com/docs --wait --timeout 60 |
| 114 | + |
| 115 | +# Search with threshold |
| 116 | +ov find "API authentication" --threshold 0.7 --limit 5 |
| 117 | + |
| 118 | +# Recursive list |
| 119 | +ov ls viking://resources --recursive |
| 120 | + |
| 121 | +# Glob search |
| 122 | +ov glob "**/*.md" --uri viking://resources |
| 123 | + |
| 124 | +# Session workflow |
| 125 | +SESSION=$(ov session new --json | jq -r '.result.session_id') |
| 126 | +ov session add-message --session-id $SESSION --role user --content "Hello" |
| 127 | +ov session commit --session-id $SESSION |
| 128 | +``` |
| 129 | + |
| 130 | +## Development |
| 131 | + |
| 132 | +```bash |
| 133 | +# Build |
| 134 | +cargo build --release |
| 135 | + |
| 136 | +# Run tests |
| 137 | +cargo test |
| 138 | + |
| 139 | +# Install locally |
| 140 | +cargo install --path . |
| 141 | +``` |
0 commit comments