Installation
Authentication
To authenticate, run:TOPK_API_KEY environment variable and skip the topk login command.
Commands
ask
Get a grounded answer with citations| Flag | Required | Description |
|---|---|---|
--dataset | Yes | Dataset to search (repeatable, e.g. -d ds1 -d ds2) |
--mode | No | Response mode: auto (default), summarize, research |
--field | No | Metadata field to include in results (repeatable, e.g. -f title -f author) |
--show-refs | No | Show citations inline in the answer |
--output-dir | No | Save result content (images, text chunks) to a directory |
search
Find relevant passages in documents| Flag | Required | Description |
|---|---|---|
--dataset | Yes | Dataset to search (repeatable, e.g. -d ds1 -d ds2) |
--top-k | No | Number of results to return (default: 10) |
--field | No | Metadata field to include in results (repeatable, e.g. -f title -f author) |
--output-dir | No | Save result content (images, text chunks) to a directory |
upload
Upload files to a dataset| Argument | Required | Description |
|---|---|---|
PATTERN | Yes | One or more file paths, directories, or glob patterns |
--dataset | Yes | Dataset to upload into |
-r | No | Recurse into subdirectories when PATTERN is a directory |
-y | No | Skip the upload confirmation prompt |
-c | No | Number of concurrent uploads, 1–64 (default: 32) |
--wait | No | Wait for processing; optionally up to a duration (e.g. --wait 5m) |
--dry-run | No | Preview which files would be uploaded without uploading |
list
List documents in a dataset:-o json) outputs one JSON object per line (NDJSON).
| Flag | Required | Description |
|---|---|---|
--dataset | Yes | Dataset to list documents from |
--field | No | Metadata field to include (repeatable, e.g. -f title) |
delete
Delete a document from a dataset:| Flag | Required | Description |
|---|---|---|
--dataset | Yes | Dataset containing the document |
--id | Yes | Document ID to delete |
-y | No | Skip confirmation prompt |
dataset
Manage datasetslist
List all datasets:get
Get a dataset:| Argument | Required | Description |
|---|---|---|
DATASET | Yes | Dataset name |
create
Create a dataset:| Argument | Required | Description |
|---|---|---|
DATASET | Yes | Dataset name |
--region | Yes | Region to create the dataset in. List available regions at https://docs.topk.io/regions |
--description | No | Dataset description |
update
Update a dataset:| Flag | Required | Description |
|---|---|---|
DATASET | Yes | Dataset name |
--description | No | Dataset description |
delete
Delete a dataset:| Argument | Required | Description |
|---|---|---|
DATASET | Yes | Dataset name |
-y | No | Skip confirmation prompt |
login
To authenticate, run:TOPK_API_KEY environment variable and skip the topk login command.
logout
Log out and clear cache:Global flags
These flags are accepted by every command:--output
Options:
text(default)json
jq:
--api-key
API key to use for this invocation. Overrides the TOPK_API_KEY environment variable and the key saved via topk login.