Skip to main content
Command-line interface for TopK.

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.

get

Get a project by ID.

create

Create a project.

delete

Delete a project by ID.

region

list

List available regions.

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:
Use topk project list to find your project ID and topk region list to list regions. Access tokens are cached and renewed automatically. Alternatively, pass --api-key or set TOPK_API_KEY instead of logging in and providing --project-id. Get an API key in the TopK console.
--project-id cannot be combined with an API key (--api-key or TOPK_API_KEY). Unset TOPK_API_KEY to use your login.

Import a database

Objects are exact names, globs, or <object>=<collection> renames.

Import files

A single file names its collection.

Copy a TopK collection

Schema and indexes copy as-is; the copy is additive.

Preview and edit the plan

Keep credentials on the command line or in the environment, never in the spec — the spec is meant to go in git.

Resume a stopped run

Stop a run — ^C, a lost connection — and pick it up where it left off:
Resume skips finished collections and continues the in-flight one from a checkpoint. Without --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, 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

Updating the CLI

To update CLI to the latest version, run: