ptkl kortex
Interactive AI coding assistant, plus non-interactive management of Kortex agents, knowledge bases, documents, conversations, usage and billing.
Overview
ptkl kortex has two faces:
- Bare invocation (
ptkl kortex [prompt...]) launches an interactive TUI chat session with a Kortex agent — the platform's built-in AI assistant. This is unaffected by the management subtree below. - Management subcommands (
agent,kb,doc,conversation,usage,tier,top-up) are non-interactive and map onto the SDKKortexclient (@ptkl/sdk/beta).
See also Kortex — AI Integration for how Forge apps register tools/context that the assistant can call into.
Interactive chat
| Option | Description |
|---|---|
[prompt...] |
Optional initial prompt to seed the conversation |
-a, --agent <uuid> |
Agent UUID to use (default: last used agent, or protokol-bot) |
-c, --conversation <uuid> |
Resume a conversation (local or cloud) |
--cloud |
Save the conversation on the platform (default: local only) |
# Launch the TUI with the default agent
ptkl kortex
# Seed an initial prompt and save the conversation on the platform
ptkl kortex "explain this workflow error" --cloud
# Resume a saved conversation with a specific agent
ptkl kortex --agent 3fae1c2e-... --conversation 9c21ab4f-...
Note
-a/--agent, -c/--conversation, and --cloud are reserved by the parent kortex
command for the interactive chat. No subcommand below declares those names — the knowledge
base search subcommand uses --agent-uuid instead (see kb search).
Subcommands
| Subcommand | Description |
|---|---|
agent list |
List Kortex agents |
agent get |
Get a Kortex agent by UUID |
agent create |
Create a Kortex agent |
agent update |
Update a Kortex agent |
agent delete |
Delete a Kortex agent |
kb list |
List Kortex knowledge bases |
kb create |
Create a Kortex knowledge base |
kb update |
Update a Kortex knowledge base |
kb delete |
Delete a Kortex knowledge base |
kb search |
RAG search over the knowledge bases attached to an agent |
doc list |
List documents in a knowledge base |
doc upload |
Upload a document to a knowledge base |
doc get |
Get a document by UUID |
doc delete |
Delete a document |
doc retry |
Retry processing a failed document |
conversation list |
List Kortex conversations |
conversation get |
Get a Kortex conversation by UUID |
conversation delete |
Delete a Kortex conversation |
usage |
Get aggregated Kortex usage for the project, or a single user with --user |
tier |
Get the current project's Kortex tier |
top-up |
Top up credits for a Kortex user-access record |
Agent
ptkl kortex agent list
List Kortex agents.
ptkl kortex agent get
Get a Kortex agent by UUID.
ptkl kortex agent create
Create a Kortex agent.
| Option | Description |
|---|---|
-d, --data <json> |
Agent payload as a JSON string (name, description, system_prompt, knowledge_bases, rag_config, llm_settings, model_tier) (required) |
ptkl kortex agent create --data '{"name":"Support Bot","system_prompt":"You help users with billing questions.","model_tier":"standard"}'
ptkl kortex agent update
Update a Kortex agent.
ptkl kortex agent delete
Delete a Kortex agent.
Knowledge base
ptkl kortex kb list
List Kortex knowledge bases.
ptkl kortex kb create
Create a Kortex knowledge base.
| Option | Description |
|---|---|
-d, --data <json> |
Knowledge base payload as a JSON string (name, description, chunking_strategy) (required) |
ptkl kortex kb update
Update a Kortex knowledge base.
ptkl kortex kb delete
Delete a Kortex knowledge base.
ptkl kortex kb search
RAG search over the knowledge bases attached to an agent.
| Option | Description |
|---|---|
<query> |
Search query (required) |
--agent-uuid <uuid> |
Agent UUID — knowledge bases are derived from the agent (required) |
-k, --top-k <n> |
Number of chunks to return (server-clamped 1-10) |
Document
ptkl kortex doc list
List documents in a knowledge base.
ptkl kortex doc upload
Upload a document to a knowledge base.
| Option | Description |
|---|---|
-k, --kb <uuid> |
Knowledge base UUID (required) |
--file <path> |
Path to the file to upload (required) |
-n, --name <name> |
Override the uploaded file name (default: the file's basename) |
ptkl kortex doc get
Get a document by UUID.
ptkl kortex doc delete
Delete a document.
ptkl kortex doc retry
Retry processing a failed document.
Conversation
ptkl kortex conversation list
List Kortex conversations.
| Option | Description |
|---|---|
--all-users |
Include conversations from all users (admin) |
--archived |
Include archived conversations |
ptkl kortex conversation get
Get a Kortex conversation by UUID.
ptkl kortex conversation delete
Delete a Kortex conversation.
Usage, tier & top-up
ptkl kortex usage
Get aggregated Kortex usage for the current project (admin), or a single user with --user.
| Option | Description |
|---|---|
-u, --user <uuid> |
User-access UUID to scope usage to |
-m, --month <yyyy-mm> |
Month to scope usage to |
--breakdown |
With --user, return the monthly usage breakdown instead of the current month |
-p, --page <page> |
Page number |
-l, --limit <limit> |
Page size |
# Project-wide usage for a month
ptkl kortex usage --month 2026-07
# A single user's monthly breakdown
ptkl kortex usage --user 7b1e4a2d-... --breakdown
ptkl kortex tier
Get the current project's Kortex tier.
ptkl kortex top-up
Top up credits for a Kortex user-access record.
| Option | Description |
|---|---|
-u, --uuid <uuid> |
User-access UUID to top up (required) |
--amount <amount> |
Amount of credits to add (required) |
-r, --reason <reason> |
Reason for the top-up |
Typical Workflow
# 1. Create a knowledge base and upload docs
ptkl kortex kb create --data '{"name":"Product Docs"}'
ptkl kortex doc upload --kb <kb-uuid> --file ./refund-policy.pdf
# 2. Create an agent wired to that knowledge base
ptkl kortex agent create --data '{"name":"Support Bot","knowledge_bases":["<kb-uuid>"]}'
# 3. Search the knowledge base directly, or chat with the agent
ptkl kortex kb search "refund policy" --agent-uuid <agent-uuid>
ptkl kortex --agent <agent-uuid>
# 4. Check usage and top up if needed
ptkl kortex usage --month 2026-07
ptkl kortex top-up --uuid <user-access-uuid> --amount 500
See Also
- Kortex — AI Integration — how Forge apps register tools/context for the assistant
ptkl billing— project-level billing (subscriptions, invoices, credits)- Toolkit Overview — all available toolkit commands