Install the CLI
Looking for the product overview? Start with TypesenseKit's Typesense CLI, then use this guide for complete setup and command details.
TypesenseKit requires Node.js 22.11 or newer. Install the public package globally with your preferred package manager.
pnpm add -g @typesensekit/cliConfirm the command is available by listing the operation registry.
tsk operationsCreate a secure profile
A profile stores a Typesense URL and credential reference so you do not have to repeat connection details. The interactive form prompts for the API key without putting it in shell history.
tsk profile add local --url http://localhost:8108
tsk profile use local
tsk profile test localOn macOS, ask TypesenseKit to keep the key in Keychain rather than the profile configuration file.
tsk profile add production --url https://search.example.com --keychainRun without a saved profile
For CI and short-lived environments, provide the connection through environment variables.
TYPESENSE_URL=http://localhost:8108 \
TYPESENSE_API_KEY=xyz \
tsk health --input '{}'For a scripted profile setup, pipe the key over stdin so it does not appear in process arguments or shell history.
printf '%s' "$TYPESENSE_API_KEY" | \
tsk profile add ci --url https://search.example.com --api-key-stdinDiscover operation inputs
Operation names stay the same across the CLI and MCP server. Inspect the validation schema or generated examples before sending a request.
tsk documents.search --schema
tsk documents.search --examplesSearch parameters belong in the top-level params object.
tsk documents.search --input '{"collection":"products","params":{"q":"oak chair","query_by":"title"}}' --jsonSee the generated API coverage for the complete operation inventory.
Choose output for humans or scripts
Common operation results render as readable tables in a terminal. Add --json for stable, redacted JSON that can be piped into another command.
tsk collections.list --input '{}'
tsk collections.list --input '{}' --json | jq '.[].name'Input can also come from a JSON file for large imports or reusable operation payloads.
tsk documents.import --input import.json --jsonFor complete import objects, JSONL exports, failure filtering, and layered diagnostics, follow the Typesense CLI import, export, and debugging guide.
Enable shell completion
Generate completion definitions from the current command and operation registry.
# zsh
source <(tsk completion zsh)
# bash
source <(tsk completion bash)
# fish
tsk completion fish | sourceTreat destructive operations deliberately
The CLI asks for confirmation before destructive requests. This makes interactive administration harder to trigger accidentally.
tsk collections.delete --input '{"collection":"old_products"}'Use --yes only in automation where the target and failure behavior are already controlled.
tsk collections.delete --input '{"collection":"old_products"}' --yes --json