PrimeThink CLI
Command Line Interface for interacting with the PrimeThink API.
Installation
pip install primethink-cli
See the Installation Guide for install scripts, Homebrew, and troubleshooting.
Quick Start
- Configure your API token (from Settings → API Keys in the PrimeThink app):
pt profile add --token YOUR_API_TOKEN
- Use the CLI:
pt task actions
pt task execute --action "action-name" --message "your message"
pt chat send CHAT_ID --message "your message"
pt chat send --agent AGENT_ID --message "your message"
Commands at a Glance
| Command | Description |
|---|---|
pt version |
Display the CLI version |
pt whoami |
Show the authenticated user, their groups, active group, and configured providers |
pt mcp |
Run PrimeThink as an MCP server (exposes the API as tools over stdio) |
pt install-skill |
Install the bundled CLI agent skill for Claude Code and compatible agents |
pt install-developer-skill |
Install the complete public PrimeThink developer skill, including nested resources |
pt live-app new |
Scaffold a React or HTML Live App from a GitHub template catalog |
pt live-app publish |
Create/update a Live App task and sync its flat artifact |
pt live-app test |
Sync a Live App into a new or existing chat |
pt profile add |
Configure an API token for a profile |
pt profile use |
Switch the active profile |
pt profile list |
List configured profiles |
pt profile remove |
Remove a profile |
pt chat send |
Send a message to a chat (by ID/mention) or an agent |
pt chat list |
List chats (paginated, filterable by star/archive/workspace) |
pt chat create |
Create a new chat (--from-task-id launches a task into it) |
pt chat rename |
Rename a chat |
pt chat goal |
Update a chat's goal |
pt chat type |
Switch a chat between live-app and chat mode |
pt chat messages |
List a chat's messages (cursor-paginated) |
pt chat archive / pt chat unarchive |
Archive / unarchive a chat |
pt chat delete |
Delete a chat (asks for confirmation; --yes to skip) |
pt chat list-files |
List files and directories in a chat |
pt chat upload-files |
Upload local files to a chat |
pt chat download-file |
Download a file from a chat |
pt chat delete-file |
Delete a file from a chat by document ID (asks for confirmation) |
pt chat upload-text |
Create a chat document from raw text (no local file) |
pt chat list-users |
List a chat's members |
pt chat invite-members / pt chat remove-members |
Invite / remove users and agents in a chat |
pt chat edit-message / delete-message / clear-messages / retry-message |
Edit, delete, clear, or retry chat messages |
pt chat export-message / save-as-task |
Export a message (md/docx/pdf) or save a chat as a task |
pt chat sync-to |
Sync a local directory into a chat |
pt chat sync-from |
Sync a chat's files to a local directory |
pt chat sync |
Two-way sync between a chat folder and a local directory |
pt chatdb init |
Initialize a chat's ChatDB (Live App data) store |
pt chatdb list |
List entities in a chat's ChatDB store (or an attached DB Collection via --collection/--collection-id) |
pt chatdb get |
Get one ChatDB entity by ID |
pt chatdb add |
Add one or more rows to a ChatDB entity |
pt chatdb update |
Update ChatDB entities (single or bulk) |
pt chatdb delete |
Delete ChatDB entities (asks for confirmation) |
pt collection list |
List collections (paginated, searchable) |
pt collection create |
Create a collection |
pt collection get |
Fetch a collection's details as JSON |
pt collection update |
Update a collection's fields (name, indexing, …) |
pt collection reindex |
Trigger a reindex of a collection |
pt collection copy |
Duplicate a collection (by UUID) |
pt collection delete |
Delete a collection (asks for confirmation; --yes to skip) |
pt collection list-files |
List files and directories in a collection |
pt collection upload-files |
Upload local files to a collection |
pt collection upload-text |
Create a collection document from raw text (no local file) |
pt collection delete-file |
Delete files from a collection by document ID (asks for confirmation) |
pt collection download-file |
Download a file from a collection |
pt collection sync-to |
Sync a local directory into a collection |
pt collection sync-from |
Sync a collection's files to a local directory |
pt agent list |
List agents (virtual assistants), filterable by name/type/status (--summary trims heavy config) |
pt agent get |
Fetch an agent's details as JSON |
pt agent create |
Create an agent |
pt agent update |
Update fields on an existing agent |
pt agent delete |
Delete an agent (asks for confirmation; --yes to skip) |
pt agent types |
List available agent types |
pt agent list-docs |
List documents in an agent's knowledge base |
pt agent upload-docs |
Upload files to an agent's knowledge base |
pt agent attach-collections / pt agent detach-collection |
Attach / detach collections for agent RAG |
pt agent upload-image / pt agent delete-image |
Upload / delete an agent's image |
pt capability list / create / update / delete |
Manage agent capabilities |
pt capability archive / unarchive / duplicate |
Archive, unarchive, or duplicate a capability |
pt capability resolve |
Resolve capability codes/ids to ids |
pt models list / pt models embeddings |
Discover LLM / embedding models from the catalog |
pt scheduled-job list / create / update |
Manage scheduled jobs (prompts on a schedule) in a chat |
pt scheduled-job set-status / delete |
Pause/resume or delete a scheduled job |
pt {chat,collection,task,agent} mkdir / rmdir |
Create / delete a folder in a chat, collection, task, or agent |
pt {chat,collection,task,agent} move-dir / rename-dir |
Move / rename a folder |
pt {chat,collection,task} list-versions / new-version / new-text-version |
Manage a document's versions |
pt {chat,collection,task} set-production-version / delete-version |
Promote or delete a document version |
pt workspace list / create / rename / set-goal / delete |
Manage chat workspaces |
pt workspace archive / pin / add-chat / remove-chat |
Organize chats within workspaces |
pt tag list / create / assign |
List, create, and assign tags (task/agent/capability/collection) |
pt suite build / validate / inspect |
Build, check and describe a .ptsuite package (apps, tasks, agents, collections, tags, workspace) |
pt suite install / uninstall |
Plan (--dry-run) and install/upgrade a package idempotently from a file, folder, GitHub or the catalog; remove what it created |
pt suite export |
Turn live tasks and Live Apps (with their agents and collections) into a package folder |
pt suite catalog build / list / search |
Index a folder/GitHub repo of packages and browse it |
pt group list / get / create / update / delete |
Manage groups (organizations) |
pt group members / remove-member / invite / add-agent |
Manage group members, invites, and agents |
pt settings list / get / set / delete |
Manage group/user settings and provider API keys (secrets never shown) |
pt user list / search |
Look up users you can see by name or email |
pt notification list / unread-count |
List your notifications or count the unread ones |
pt notification mark-read / mark-unread / mark-all-read / delete |
Mark notifications read/unread, mark all read, or delete one |
pt task list |
List tasks, filterable by name/type/status and paginated |
pt task actions |
List available task actions |
pt task execute |
Execute a task action with a message and optional files |
pt task create |
Create a task (supports schedules, canvases, and more) |
pt task update |
Update fields on an existing task |
pt task get |
Fetch a task's details as JSON |
pt task upload-text |
Create a task document from raw text (no local file) |
pt task add-docs / pt task delete-docs |
Add / delete task knowledge documents |
pt task delete |
Delete a task (asks for confirmation; --yes to skip) |
pt task duplicate |
Duplicate a task |
pt task set-public / pt task set-private |
Make a task public / private |
pt task publish |
Create/update a task from a project directory (--type, feature toggles, optional task.json) |
pt task launch |
Launch a task into a new chat, optionally inside a workspace |
pt task test |
Sync a task goal into a new or existing chat |
pt task export |
Export a task's portable config as JSON (for pt task import) |
pt task import |
Create a new task from an exported JSON file (deploy across environments with --profile) |
pt task create-version |
Snapshot a task's current state as a named version |
pt task upload-image |
Upload an image for a task |
pt eval list / add / update / delete |
Manage a task's evaluation-data set (the test plan) |
pt eval settings |
Configure a task's evaluation settings (schedule, evaluator, thresholds) |
pt eval run / runs / run-get / results / download |
Run a task evaluation and inspect its runs and results |
pt eval simulate / simulations / delete-simulation |
Run and manage agent-vs-agent task simulations |
pt search documents |
Semantic search across documents in a vector store collection |
pt search chat |
Semantic search within a chat |
pt search collection |
Semantic search within a collection |
pt search messages |
Semantic search across chat messages |
pt search images |
Search a collection's images by example image and/or text |
pt image generate |
Generate an AI image and save it locally |
pt voice stt / tts / diarize / translate |
Transcribe, synthesize, diarize, or translate audio |
pt video analyze |
Analyze a video file |
Every command that calls the API also accepts --profile (use a specific profile for one request) and --api-url/-u (override the API URL for one request). See the full CLI reference for every option and example.
--help works in either position: pt chat send --help, pt chat --help send, and pt --help chat send all print the same page.
Tip:
-pis the short flag for--profilein most groups (e.g.pt task,pt agent,pt search,pt settings,pt user,pt notification,pt eval),pt image generate, andpt whoami, but in thept chatandpt collectiongroups there is no-pfor profile — there-pmeans--path(a directory inside the chat/collection) on the file commands. Use the long form--profilewhen in doubt.
Configuration
Token Management
The CLI supports multiple token profiles, allowing you to switch between different accounts or API endpoints.
# Configure a profile (creates it, or overwrites an existing one)
pt profile add --token YOUR_API_TOKEN --profile default
# Optionally with a custom API URL
pt profile add --token STAGING_TOKEN --profile staging --api-url https://staging-api.example.com
# List, switch, remove
pt profile list
pt profile use staging
pt profile remove old-profile
Options for pt profile add:
--token, -t: Your API token (required)--profile, -p: Profile name (default: "default")--api-url, -u: Custom API URL (optional, default: https://api.primethink.ai)
Configuration File
The CLI stores configuration in ~/.primethink/config.json:
{
"active_profile": "default",
"profiles": {
"default": {
"token": "your-api-token"
},
"staging": {
"token": "your-staging-token",
"api_url": "https://staging-api.example.com"
}
}
}
Keep this file secure — it contains your API tokens (chmod 600 ~/.primethink/config.json).
Environment Variables
All environment variables are optional overrides — when unset, the CLI uses the config file and its built-in defaults:
| Variable | Description | Default when unset |
|---|---|---|
PRIMETHINK_TOKEN |
API token, bypassing the config file (useful for CI/CD) | Token from the active profile |
PRIMETHINK_API_URL |
API base URL override | Profile's api_url, otherwise https://api.primethink.ai |
PRIMETHINK_PROFILE |
Profile to use when --profile is not passed |
The active profile |
PRIMETHINK_CONFIG_PATH |
Custom config file path | ~/.primethink/config.json |
PRIMETHINK_DEBUG |
Set to 1 to print request/response debug info to stderr |
Disabled |
Precedence, highest first: command-line flag → environment variable → config file → built-in default. See docs/install.md for details.
Usage Examples
Messaging and actions
# List available actions, optionally with a specific profile
pt task actions
pt task actions --profile production
# Execute an action with attachments
pt task execute --action summarize --message "Summarize these" --files q1.pdf --files q2.pdf
# Message a chat by ID or mention name
pt chat send 123 --message "Hello from the CLI"
pt chat send @my-assistant --message "Review this" --files report.pdf
# Fire-and-forget (don't wait for the response)
pt chat send 123 --message "Long-running job" --async
# Message an agent directly
pt chat send --agent 1 --message "Analyze this data" --files data.csv
Managing chats
# Find a chat
pt chat list --search onboarding --starred
# Create one, then adjust it
pt chat create --name "Q3 planning" --goal "Track the Q3 launch" --virtual-assistant-id 7
pt chat rename 123 "Q3 planning (final)"
pt chat goal 123 --goal-file ./new-goal.md
Chat and collection files
# Browse and fetch chat files
pt chat list-files 123
pt chat download-file 123 456 --output report.pdf
# Mirror a local folder into a chat (PDFs only, including subfolders)
pt chat sync-to 123 ./reports --pattern '*.pdf' --recursive
# Back up a whole chat workspace locally
pt chat sync-from 123 ./chat-backup
# Collections work the same way, plus discovery
pt collection list --search contracts
pt collection sync-to 42 ./knowledge-base --recursive
Semantic search
# Search a chat, a collection, documents, or messages by meaning
pt search chat 123 "what did we decide about the deadline"
pt search collection 42 "termination clause" --top-k 3
pt search documents "refund policy" --collection-name kb
pt search messages "standup notes" --collection-name msgs --user-id 2
Agents
# Discover agent types, then create an agent
pt agent types
pt agent create --name "Support bot" --public-description "Answers support questions" --type-id 1
# Find, inspect, adjust
pt agent list --search support
pt agent get 7
pt agent update 7 --description-file ./instructions.md
# Message an agent (same command as chat messaging)
pt chat send --agent 7 --message "Analyze this" --files data.csv
Tasks
# Create a scheduled task
pt task create \
--name "Morning briefing" \
--description "Daily news summary" \
--type private \
--virtual-assistant-id 7 \
--schedule-nl "every weekday at 8am" \
--schedule-prompt "Prepare the morning briefing"
# Inspect and update it
pt task get 99
pt task update 99 --schedule-nl "every weekday at 7am"
# Snapshot a version, add a cover image
pt task create-version 99 --version-name "v2"
pt task upload-image 99 ./cover.png
# Export the task config, check it into git, deploy it elsewhere
pt task export 99 --output tasks/briefing.json
pt task import tasks/briefing.json --profile production
# Publish a conventional task project (GOAL.md required); pass an ID to update
pt task publish ./tasks/briefing --virtual-assistant-id 7
pt task publish ./tasks/briefing --virtual-assistant-id 7 --type group --chat-history --docs-enabled --scheduled-jobs
pt task publish ./tasks/briefing --task-id 99 --virtual-assistant-id 7
# Launch a task into a chat (optionally inside a workspace), as the web app does
pt task launch 99 --workspace-id 738
# Make the resulting task public/private, or test its goal in a chat
pt task set-public 99
pt task set-private 99
pt task test ./tasks/briefing
pt task test ./tasks/briefing --chat-id EXISTING_CHAT_ID
# Generate an image with AI
pt image generate --prompt "A lighthouse at dawn" --output lighthouse.png
Live App Workflows
Scaffold a new Live App project without configuring an API profile:
# Default: React + Tailwind + Flowbite
pt live-app new ./my-live-app
# Other common variants
pt live-app new ./simple-html --framework html --no-flowbite
pt live-app new ./plain-react --no-tailwind --no-flowbite
# Use a custom catalog and pin it for reproducible generation
pt live-app new ./my-live-app \
--repo-url https://github.com/acme/primethink-templates \
--ref v2.0.0
The destination must not already exist. Flowbite requires Tailwind. The command downloads a public GitHub repository and selects a template from live-app-templates/manifest.json; it never runs npm install or generated code.
After building, publish the Live App as a task or synchronize it directly into a test chat. Artifact discovery checks dist/, then app/, then the project root; use --app-dir to override it. The artifact must contain index.html (or canvas.html, deployed as index.html) and should be flat.
# Create a Live App task; add --task-id 123 to update it
pt live-app publish ./my-live-app --virtual-assistant-id 7
pt live-app publish ./my-live-app --task-id 123 --virtual-assistant-id 7
# Create a temporary test chat, or update an existing chat in place
pt live-app test ./my-live-app
pt live-app test ./my-live-app --chat-id EXISTING_CHAT_ID
# Change any chat's renderer explicitly
pt chat type EXISTING_CHAT_ID live-app
pt chat type EXISTING_CHAT_ID chat
Project metadata follows the reference-script conventions: .name.config, .description.config, GOAL.md, and optional INITIAL_PROMPT.md; .image.png is uploaded when publishing a Live App. Existing same-named app documents receive a new Production version, while identical content is reported as unchanged.
Automated Live App UI testing is no longer a pt command. It now lives in the primethink-developer skill as a deterministic, plan-driven workflow: the skill authors a reviewable tests/test_plan.yaml, runs it with a bundled Playwright runner (no LLM in the execution loop), reads the structured results, and heals failing selectors before re-running. Install it with pt install-developer-skill.
MCP Server
The same code that powers the pt CLI can run as an MCP
server, exposing the core PrimeThink API management operations as tools for MCP clients (Claude Code,
Claude Desktop, and others) to call directly — no shelling out to pt. Local scaffolding and project publish/test orchestration remain CLI workflows.
The MCP SDK is an optional dependency, so CLI-only installs stay lean:
pip install 'primethink-cli[mcp]' # requires Python 3.10+
pt mcp # serve over stdio
Authentication reuses the same profiles and environment variables as the CLI.
Point your MCP client at pt mcp and provide a token via the server's env, for
example (Claude Desktop / Claude Code mcpServers config):
{
"mcpServers": {
"primethink": {
"command": "pt",
"args": ["mcp"],
"env": { "PRIMETHINK_TOKEN": "your-api-token" }
}
}
}
Without PRIMETHINK_TOKEN in the client config, the server falls back to your
configured active profile (~/.primethink/config.json); individual tools also
accept optional profile and api_url arguments. Core API management operations have tool
equivalents — messaging, chats, collections, tasks, agents, semantic search, and
image generation. See the CLI reference
for the full tool list.
Agent Tools Plugin
Beyond the CLI and MCP server, the package also ships the agent tools plugin
(primethink_agent_tools) — it exposes the PrimeThink admin/management API
(tasks, agents, chats, collections) as LangChain tools for PrimeThink
agents, reusing the same client code as pt. It's enabled by the optional
agent-tools extra, so plain CLI installs stay lean (no langchain) and the
plugin is installed only in the agent runtime / API image:
pip install 'primethink-cli[agent-tools]'
The PrimeThink API discovers it automatically via the primethink.tools entry
point. Authentication uses a per-user ADMIN_PRIMETHINK_API_TOKEN setting. See
docs/agent-tools.md for the tool list, auth, and setup.
Agent Skills
The CLI supports two complementary Agent Skills:
primethink-cliteaches agents how to usept. It ships inside the pip package and installs offline withpt install-skill.primethink-developerteaches agents to build PrimeThink Live Apps, Tasks, and SDK integrations. It is downloaded free from the publicprimethink-app-templatesrepository with every nested library and reference file.
# Install either skill for all projects (~/.claude/skills)
pt install-skill
pt install-developer-skill
# Install the developer skill only for the current repository
pt install-developer-skill --project
# Custom skills directory / upgrade an existing installation
pt install-developer-skill --dir ~/.config/my-agent/skills
pt install-developer-skill --force
# Pin the public source for reproducibility
pt install-developer-skill --ref main
Neither installer needs a PrimeThink API token. install-developer-skill needs internet access but no paid service or GitHub credentials; --force replaces the complete existing primethink-developer/ folder only after the replacement archive has been downloaded and staged successfully.
Documentation
- CLI Reference — every command, option, and example
- User Guide — walkthroughs, use cases, tips, troubleshooting
- Installation Guide — install methods and troubleshooting
- API Specifications — the API endpoints behind each command
- Developer Guide — contributing, architecture, testing
Development
# Install development dependencies
pip install -e ".[dev]"
# Run tests
pytest -q
# Run tests with coverage
pytest -q --cov=primethink --cov-report=html
See the Developer Guide for architecture notes and the release process.
License
MIT License
Support
For issues and questions, please visit: https://primethink.ai
Metadata
Release files for primethink-cli 1.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| primethink_cli-1.7.0.tar.gz | 418.5 kB | Without provenance | Details for primethink_cli-1.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| primethink_cli-1.7.0-py3-none-any.whl | Python 3 | none | any | Details for primethink_cli-1.7.0-py3-none-any.whl |
Total release size: 560.1 kB
Release files / primethink_cli-1.7.0.tar.gz
| Download URL | primethink_cli-1.7.0.tar.gz |
|---|---|
| Size | 418.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
796447b127f67c71c6c908ba78434aeffca5000606d19c064a7e34e25d5bb7a9
|
|
BLAKE2b-256 checksum How to use checksums |
c2cdbed433ab205ec3ec3a416106ce6f33d9d14b0cbfaf65753a0801dc338550
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.6
|
Release files / primethink_cli-1.7.0-py3-none-any.whl
| Download URL | primethink_cli-1.7.0-py3-none-any.whl |
|---|---|
| Size | 141.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
513daac4f4fb66bc3224c35e7e3baf26d3ba695d8a2cc5c6f0df9bf6f85e76f9
|
|
BLAKE2b-256 checksum How to use checksums |
310db547e80d8547297ccb84a4e94b3ed458688c6e5f53a994655f4fb2f01a83
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.6
|
Security for primethink-cli 1.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.