Quick Start: REPL
Last updated
This page runs the bundled ToriiDB REPL and turns on vector commands with an OpenAI API key.
Run the REPL
go run cmd/test/main.go
# or
make test
The REPL opens ./temp with store.New (not through the daemon):
toriidb[0]> SET counter 1
OK
toriidb[0]> INCR counter
2
toriidb[0]> SET user {"name":"Torii","profile":{"level":1}}
OK
toriidb[0]> GET user.profile.level
1
toriidb[0]> SELECT 1
OK
toriidb[1]> KEYS *
(empty list)
quit or exit ends the session. SIGINT and SIGTERM close the store before the process exits.
Enable Vector Operations
export OPENAI_API_KEY="your-api-key"
go run cmd/test/main.go
SET article:1 Redis-style embedded storage VECTOR
SET article:2 JSON document database VECTOR
VSEARCH embedded vector search LIMIT 2
VSIM article:1 article:2
The vector is attached in the background after SET returns, so a new entry becomes searchable shortly afterwards.
Build and Test
| Command | Action |
|---|---|
go build ./... |
Build all packages |
go vet ./... |
Static analysis |
make test |
Run the REPL |
make unit |
go test ./core/... -count=1 -cover |
make embed |
Run the OpenAI embedding integration test |
The Makefile includes and exports a local .env when present; the Go code itself never loads .env.