
Prerequisites
- Python 3.12+ (
python --version) - uv installed (
uv --version). On macOS:brew install uv. - A Knowledge Stack account at app.knowledgestack.ai — sign up with email/password or Google SSO.
The happy path
1
Install kscli
uv tool install builds an isolated venv and puts kscli on your PATH. Upgrade later with uv tool upgrade kscli.2
Create an API key

- Open app.knowledgestack.ai and sign in.
- Click your avatar (top-right) → My Account.
- Open the API Keys tab.
- Click Create API key.
- Give the key a descriptive label —
kscli on macbook,kscli ingest job, etc. - Copy the key now. It is shown exactly once.
3
Log in

ksclicallsGET /users/mewith the key as a bearer token.- On success, the key is written to
/tmp/kscli/.credentialswith mode0600. - The resolved base URL and TLS settings are saved to
~/.config/kscli/config.json. - You should see
Logged in successfully (https://api-staging.knowledgestack.ai).
4
Find a folder to put documents in
Every document lives under a folder. Every tenant has a root folder; you can create subfolders.Pick a folder and grab its Create a dedicated subfolder for this tutorial:Save the
path_part_id — not id. The two are different UUIDs; see the note at the bottom of this page.path_part_id from the response — the next step needs it.5
Ingest a document

kscli returns immediately with the new document’s id and a workflow handle.Watch the workflow progress:completed, the document is fully indexed and searchable. Small PDFs take seconds; large ones take a minute or two.6
Run your first semantic search

content column holds the actual text that matched. Try:7
Browse what got ingested
8
Clean up (optional)
kscli logout removes the credentials file. The API key on the server is still valid — revoke it from the dashboard if you’re done with it.Troubleshooting
PathPart vs domain ID
Next steps
Recipes
Bulk ingest, shell scripts, CI pipelines, multi-environment setups
Authentication
Credential storage, TLS, exit codes
Commands
Full reference for every resource and verb
Configuration
Env vars, config file, precedence rules
