Installation
Quick start
topk import discovers a schema, shows the plan, and imports on confirmation — see import.Authentication
To authenticate, run:Commands
login
Log in with TopK CLI:If the CLI cannot open your browser automatically, or you prefer to open it manually, use
topk login --no-browser to print the login URL.logout
Remove the saved session:project
list
List projects in the current organization.topk project list marks the currently selected project with *.select
Select a default project.clear
Clear the selected project:current
Show the currently selected project.get
Get a project by ID.create
Create a project.delete
Delete a project by ID.region
list
List available regions.sql
Create and manage collections, read and write documents, and run keyword, vector, and semantic searches with TopK SQL.Run a query
Log in and find your project ID, then run SQL against a collection. This example searches atitle field with a semantic index:
Run SQL from a file or stdin
Inspect tables
psql-style commands list and describe tables:Output
Results print as one table per statement by default, with row counts on stderr. Use-o json to stream one JSON object per row as it arrives, for example topk sql … -o json | jq. Pipe long output to a pager yourself, for example | less.
import
Bulk import into TopK collections. Every run prints the plan as a TOML spec and asks before writing; collections are created right after.Authenticate
Log in, then provide--project-id and --region when importing:
TOPK_PROJECT_ID and TOPK_REGION to omit the corresponding flags. Explicit flags override environment variables.
Import a database
<object>=<collection> renames.
Import files
Copy a TopK collection
Split rows across partitions
Preview and edit the plan
Resume a stopped run
Stop a run —^C, a lost connection — and pick it up where it left off:
--resume, a re-run re-imports everything — upserts are idempotent.
Sources
Spec
One TOML table per collection —from, id, filter/partition/limit as the flags (partition names a column), and a fields whitelist (only declared fields import):
Discovery takes the source’s types; declaring a different
type converts. Embeddings that arrive as float lists, text ("[1,2,3]") or packed bytes become vectors by declaring f32_vector and dim (f32_matrix and cols for multi-vectors); a sparse vector reads numeric keys or parallel indices/values lists; epoch numbers or date text become timestamp. Conversions are exact or the document fails; a narrower declaration (truncate included) is how loss is accepted.
Failures and limits
A document fails when a value does not convert exactly, its id is missing or empty, or it is over 200 KB. A failure stops the run, ready to--resume; --continue-on-error skips them instead.
- there is no schema migration: an existing collection whose schema differs is rejected
- an upsert replaces the whole document, so a spec that omits an existing field clears it
Global flags
These flags are accepted by every command:--output
Options:
text(default)json