primethink-cli 1.4.0__tar.gz → 1.5.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/DEVELOPER.md +12 -7
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/MANIFEST.in +5 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/PKG-INFO +33 -14
- primethink_cli-1.4.0/primethink_cli.egg-info/PKG-INFO → primethink_cli-1.5.0/README.md +27 -47
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/SPECS.md +34 -5
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/USER_GUIDE.md +160 -14
- primethink_cli-1.5.0/docs/agent-tools.md +116 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/docs/cli-reference.md +293 -19
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/docs/install.md +14 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/primethink.py +1066 -32
- primethink_cli-1.5.0/primethink_agent_tools/__init__.py +63 -0
- primethink_cli-1.5.0/primethink_agent_tools/client.py +46 -0
- primethink_cli-1.5.0/primethink_agent_tools/settings.py +99 -0
- primethink_cli-1.5.0/primethink_agent_tools/tools.py +1594 -0
- primethink_cli-1.4.0/README.md → primethink_cli-1.5.0/primethink_cli.egg-info/PKG-INFO +66 -13
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/primethink_cli.egg-info/SOURCES.txt +10 -0
- primethink_cli-1.5.0/primethink_cli.egg-info/entry_points.txt +5 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/primethink_cli.egg-info/requires.txt +6 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/primethink_cli.egg-info/top_level.txt +1 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/primethink_mcp.py +478 -20
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/pyproject.toml +20 -3
- primethink_cli-1.5.0/pytest.ini +4 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/skills/primethink-cli/SKILL.md +49 -9
- primethink_cli-1.5.0/tests/__init__.py +1 -0
- primethink_cli-1.5.0/tests/conftest.py +58 -0
- primethink_cli-1.5.0/tests/test_agent_tools.py +795 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_cli.py +262 -4
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_mcp_server.py +343 -11
- primethink_cli-1.5.0/tests/test_packaging.py +120 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_project_workflows.py +271 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_whoami.py +16 -7
- primethink_cli-1.4.0/primethink_cli.egg-info/entry_points.txt +0 -2
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/LICENSE +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/docs/primethink_help_llms.txt +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/install/homebrew/primethink-cli.rb +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/install/install.cmd +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/install/install.ps1 +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/install/install.sh +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/primethink_cli.egg-info/dependency_links.txt +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/scripts/build.sh +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/scripts/deploy.sh +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/scripts/publish.sh +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/setup.cfg +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/setup.py +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/skills/__init__.py +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_agent_commands.py +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_env_config.py +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_install_developer_skill.py +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_install_skill.py +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_live_app.py +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_search_commands.py +0 -0
- {primethink_cli-1.4.0 → primethink_cli-1.5.0}/tests/test_task_commands.py +0 -0
|
@@ -55,8 +55,8 @@ pip install -e ".[dev]"
|
|
|
55
55
|
primethink-cli/
|
|
56
56
|
├── primethink.py # Main CLI implementation (single module)
|
|
57
57
|
├── primethink_mcp.py # MCP server (pt mcp), reuses primethink.py's helpers; optional [mcp] extra
|
|
58
|
-
├──
|
|
59
|
-
│ # (
|
|
58
|
+
├── primethink_agent_tools/ # Agent tools plugin: LangChain tools for PT agents; optional [agent-tools] extra
|
|
59
|
+
│ # (entry point primethink.tools; reuses primethink.py's helpers)
|
|
60
60
|
├── pyproject.toml # Package configuration (entry point: pt)
|
|
61
61
|
├── setup.py # Legacy packaging shim
|
|
62
62
|
├── requirements.txt # Runtime dependencies
|
|
@@ -85,7 +85,10 @@ primethink-cli/
|
|
|
85
85
|
├── test_task_commands.py # Task command tests
|
|
86
86
|
├── test_live_app.py # Safe GitHub template scaffolding tests
|
|
87
87
|
├── test_install_developer_skill.py # Recursive public skill installer tests
|
|
88
|
-
|
|
88
|
+
├── test_install_skill.py # bundled CLI skill installer tests
|
|
89
|
+
├── test_mcp_server.py # MCP server tests (skipped without the mcp SDK)
|
|
90
|
+
├── test_agent_tools.py # Agent tools plugin tests (skipped without langchain-core)
|
|
91
|
+
└── test_packaging.py # Wheel/entry-point/extras contract (runs on a base install)
|
|
89
92
|
```
|
|
90
93
|
|
|
91
94
|
## Architecture
|
|
@@ -142,7 +145,7 @@ def my_command(thing_id, profile, api_url):
|
|
|
142
145
|
|
|
143
146
|
Security boundaries are enforced before the destination is exposed: HTTPS GitHub repository URLs only, compressed/expanded size and file-count limits, repository-relative manifest paths, path-traversal and duplicate-path checks, symbolic-link rejection, and refusal to touch an existing destination. Tests build in-memory ZIP archives and mock `requests.request`; do not make live GitHub calls in the test suite. The default catalog lives in the separate `primethink-app-templates` repository.
|
|
144
147
|
|
|
145
|
-
Because this command only creates local source files and does not call the PrimeThink API, it has no MCP or
|
|
148
|
+
Because this command only creates local source files and does not call the PrimeThink API, it has no MCP or agent-tools equivalent.
|
|
146
149
|
|
|
147
150
|
#### 4. Agent Skill Installation
|
|
148
151
|
|
|
@@ -185,16 +188,18 @@ Key differences from the CLI, driven by MCP-over-stdio constraints:
|
|
|
185
188
|
|
|
186
189
|
`mcp` is an optional dependency (the `[mcp]` extra, Python 3.10+); `pt mcp` imports `primethink_mcp` lazily and prints an install hint if the SDK is missing. Tests live in `tests/test_mcp_server.py` and `pytest.importorskip("mcp")` so they skip cleanly where the SDK isn't installed.
|
|
187
190
|
|
|
188
|
-
#### 7. Agent Tools Plugin (`
|
|
191
|
+
#### 7. Agent Tools Plugin (`primethink_agent_tools/`)
|
|
189
192
|
|
|
190
|
-
`
|
|
193
|
+
`primethink_agent_tools/` ships **inside the `primethink-cli` wheel**, enabled by the optional `[agent-tools]` extra (`langchain-core`, `pydantic`; Python 3.9+). It exposes the admin/management API as LangChain tools for PrimeThink agents, discovered via the `primethink.tools` entry point that `pyproject.toml` declares (`primethink_admin = "primethink_agent_tools:register"`). It reuses the CLI's code rather than re-implementing it:
|
|
191
194
|
|
|
192
195
|
- **Transport reuse without a rewrite.** Tools call `primethink._api_call` (the CLI's `requests` layer) through a small async wrapper (`client.api_json`) that runs it in `asyncio.to_thread` — the agent runtime is async, and `requests` is sync. No httpx dependency; `requests` comes transitively from `primethink-cli`.
|
|
193
196
|
- **Payload reuse.** Tools import `_clean_payload`, `_TASK_PORTABLE_FIELDS`, `_VERSION_FIELDS`, etc. from `primethink`, so payload shaping matches `pt`/`pt mcp`. Only endpoint path strings are written locally (the accepted trade for not restructuring the CLI).
|
|
194
197
|
- **Auth.** Per-user token from the `ADMIN_PRIMETHINK_API_TOKEN` setting, resolved via the injected `get_user_setting_value` context (`settings.PrimethinkSettingsProvider`), with a `StaticSettingsProvider` fallback for tests/standalone.
|
|
195
198
|
- **Scope.** Admin/management only (tasks, agents, chats, collections + collection↔chat assignment). Excludes hot-path search, document byte transfer, messaging/orchestration, and destructive deletes — those stay native.
|
|
196
199
|
|
|
197
|
-
|
|
200
|
+
Because the plugin and the private CLI helpers it imports (`_api_call`, `_clean_payload`, `_TASK_PORTABLE_FIELDS`, `_VERSION_FIELDS`) always ship in the same wheel, there is no cross-package version skew to guard against. The base CLI install is unaffected: the entry point is declared, but nothing loads it unless the PrimeThink API calls it, and `register()` imports langchain lazily — and when it is called without the extra, it raises a `ModuleNotFoundError` whose message names `pip install 'primethink-cli[agent-tools]'` (the API logs it and continues without the plugin). The API image installs `primethink-cli[agent-tools]==<version>`; see [`docs/agent-tools.md`](docs/agent-tools.md) for setup.
|
|
201
|
+
|
|
202
|
+
Tests live in `tests/test_agent_tools.py` and `pytest.importorskip("langchain_core")`, so they skip where the extra isn't installed (the `dev` extra installs it); the packaging contract (entry point, `pyproject.toml` packages/extras, RECORD contents of a non-editable install, the `register()` install hint) lives in `tests/test_packaging.py` and needs no extra. When you add or change an API command that belongs in the agent surface, add/update the matching tool in `primethink_agent_tools/tools.py` and its test.
|
|
198
203
|
|
|
199
204
|
## Adding New Commands
|
|
200
205
|
|
|
@@ -7,6 +7,11 @@ recursive-include docs *.md *.txt
|
|
|
7
7
|
recursive-include install *.sh *.ps1 *.cmd *.rb
|
|
8
8
|
recursive-include scripts *.sh
|
|
9
9
|
recursive-include skills *.md
|
|
10
|
+
# setuptools auto-includes tests/test_*.py; add the package marker and shared
|
|
11
|
+
# fixtures the test modules import (`from tests.conftest import ...`), plus the
|
|
12
|
+
# pytest config, so a bare `pytest` inside an unpacked sdist collects `tests/`.
|
|
13
|
+
recursive-include tests *.py
|
|
14
|
+
include pytest.ini
|
|
10
15
|
# Internal design/spec artifacts live under docs/ but must not ship in the sdist.
|
|
11
16
|
prune docs/superpowers
|
|
12
17
|
global-exclude __pycache__
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: primethink-cli
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.5.0
|
|
4
4
|
Summary: PrimeThink CLI - A powerful tool for interacting with PrimeThink AI API
|
|
5
5
|
Author-email: PrimeThink <support@primethink.ai>
|
|
6
6
|
License-Expression: MIT
|
|
@@ -26,10 +26,15 @@ Requires-Dist: click>=8.0.0
|
|
|
26
26
|
Requires-Dist: requests>=2.25.0
|
|
27
27
|
Provides-Extra: mcp
|
|
28
28
|
Requires-Dist: mcp<2,>=1.2.0; extra == "mcp"
|
|
29
|
+
Provides-Extra: agent-tools
|
|
30
|
+
Requires-Dist: langchain-core>=0.3.0; extra == "agent-tools"
|
|
31
|
+
Requires-Dist: pydantic>=2.0; extra == "agent-tools"
|
|
29
32
|
Provides-Extra: dev
|
|
30
33
|
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
31
34
|
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
32
35
|
Requires-Dist: mcp<2,>=1.2.0; python_version >= "3.10" and extra == "dev"
|
|
36
|
+
Requires-Dist: langchain-core>=0.3.0; python_version >= "3.10" and extra == "dev"
|
|
37
|
+
Requires-Dist: pydantic>=2.0; python_version >= "3.10" and extra == "dev"
|
|
33
38
|
Dynamic: license-file
|
|
34
39
|
|
|
35
40
|
# PrimeThink CLI
|
|
@@ -66,7 +71,7 @@ pt chat send --agent AGENT_ID --message "your message"
|
|
|
66
71
|
| Command | Description |
|
|
67
72
|
|---|---|
|
|
68
73
|
| `pt version` | Display the CLI version |
|
|
69
|
-
| `pt whoami` | Show the authenticated user
|
|
74
|
+
| `pt whoami` | Show the authenticated user, their groups, active group, and configured providers |
|
|
70
75
|
| `pt mcp` | Run PrimeThink as an MCP server (exposes the API as tools over stdio) |
|
|
71
76
|
| `pt install-skill` | Install the bundled CLI agent skill for Claude Code and compatible agents |
|
|
72
77
|
| `pt install-developer-skill` | Install the complete public PrimeThink developer skill, including nested resources |
|
|
@@ -79,7 +84,7 @@ pt chat send --agent AGENT_ID --message "your message"
|
|
|
79
84
|
| `pt profile remove` | Remove a profile |
|
|
80
85
|
| `pt chat send` | Send a message to a chat (by ID/mention) or an agent |
|
|
81
86
|
| `pt chat list` | List chats (paginated, filterable by star/archive/workspace) |
|
|
82
|
-
| `pt chat create` | Create a new chat |
|
|
87
|
+
| `pt chat create` | Create a new chat (`--from-task-id` launches a task into it) |
|
|
83
88
|
| `pt chat rename` | Rename a chat |
|
|
84
89
|
| `pt chat goal` | Update a chat's goal |
|
|
85
90
|
| `pt chat type` | Switch a chat between `live-app` and `chat` mode |
|
|
@@ -127,8 +132,10 @@ pt chat send --agent AGENT_ID --message "your message"
|
|
|
127
132
|
| `pt agent list-docs` | List documents in an agent's knowledge base |
|
|
128
133
|
| `pt agent upload-docs` | Upload files to an agent's knowledge base |
|
|
129
134
|
| `pt agent attach-collections` / `pt agent detach-collection` | Attach / detach collections for agent RAG |
|
|
135
|
+
| `pt agent upload-image` / `pt agent delete-image` | Upload / delete an agent's image |
|
|
130
136
|
| `pt capability list` / `create` / `update` / `delete` | Manage agent capabilities |
|
|
131
137
|
| `pt capability archive` / `unarchive` / `duplicate` | Archive, unarchive, or duplicate a capability |
|
|
138
|
+
| `pt capability resolve` | Resolve capability codes/ids to ids |
|
|
132
139
|
| `pt models list` / `pt models embeddings` | Discover LLM / embedding models from the catalog |
|
|
133
140
|
| `pt scheduled-job list` / `create` / `update` | Manage scheduled jobs (prompts on a schedule) in a chat |
|
|
134
141
|
| `pt scheduled-job set-status` / `delete` | Pause/resume or delete a scheduled job |
|
|
@@ -141,6 +148,10 @@ pt chat send --agent AGENT_ID --message "your message"
|
|
|
141
148
|
| `pt tag list` / `create` / `assign` | List, create, and assign tags (task/agent/capability/collection) |
|
|
142
149
|
| `pt group list` / `get` / `create` / `update` / `delete` | Manage groups (organizations) |
|
|
143
150
|
| `pt group members` / `remove-member` / `invite` / `add-agent` | Manage group members, invites, and agents |
|
|
151
|
+
| `pt settings list` / `get` / `set` / `delete` | Manage group/user settings and provider API keys (secrets never shown) |
|
|
152
|
+
| `pt user list` / `search` | Look up users you can see by name or email |
|
|
153
|
+
| `pt notification list` / `unread-count` | List your notifications or count the unread ones |
|
|
154
|
+
| `pt notification mark-read` / `mark-unread` / `mark-all-read` / `delete` | Mark notifications read/unread, mark all read, or delete one |
|
|
144
155
|
| `pt task list` | List tasks, filterable by name/type/status and paginated |
|
|
145
156
|
| `pt task actions` | List available task actions |
|
|
146
157
|
| `pt task execute` | Execute a task action with a message and optional files |
|
|
@@ -152,12 +163,17 @@ pt chat send --agent AGENT_ID --message "your message"
|
|
|
152
163
|
| `pt task delete` | Delete a task (asks for confirmation; `--yes` to skip) |
|
|
153
164
|
| `pt task duplicate` | Duplicate a task |
|
|
154
165
|
| `pt task set-public` / `pt task set-private` | Make a task public / private |
|
|
155
|
-
| `pt task publish` | Create/update a task from a project directory |
|
|
166
|
+
| `pt task publish` | Create/update a task from a project directory (`--type`, feature toggles, optional `task.json`) |
|
|
167
|
+
| `pt task launch` | Launch a task into a new chat, optionally inside a workspace |
|
|
156
168
|
| `pt task test` | Sync a task goal into a new or existing chat |
|
|
157
169
|
| `pt task export` | Export a task's portable config as JSON (for `pt task import`) |
|
|
158
170
|
| `pt task import` | Create a new task from an exported JSON file (deploy across environments with `--profile`) |
|
|
159
171
|
| `pt task create-version` | Snapshot a task's current state as a named version |
|
|
160
172
|
| `pt task upload-image` | Upload an image for a task |
|
|
173
|
+
| `pt eval list` / `add` / `update` / `delete` | Manage a task's evaluation-data set (the test plan) |
|
|
174
|
+
| `pt eval settings` | Configure a task's evaluation settings (schedule, evaluator, thresholds) |
|
|
175
|
+
| `pt eval run` / `runs` / `run-get` / `results` / `download` | Run a task evaluation and inspect its runs and results |
|
|
176
|
+
| `pt eval simulate` / `simulations` / `delete-simulation` | Run and manage agent-vs-agent task simulations |
|
|
161
177
|
| `pt search documents` | Semantic search across documents in a vector store collection |
|
|
162
178
|
| `pt search chat` | Semantic search within a chat |
|
|
163
179
|
| `pt search collection` | Semantic search within a collection |
|
|
@@ -171,7 +187,7 @@ Every command that calls the API also accepts `--profile` (use a specific profil
|
|
|
171
187
|
|
|
172
188
|
`--help` works in either position: `pt chat send --help`, `pt chat --help send`, and `pt --help chat send` all print the same page.
|
|
173
189
|
|
|
174
|
-
> **Tip:** `-p` is the short flag for `--profile` in
|
|
190
|
+
> **Tip:** `-p` is the short flag for `--profile` in most groups (e.g. `pt task`, `pt agent`, `pt search`, `pt settings`, `pt user`, `pt notification`, `pt eval`), `pt image generate`, and `pt whoami`, but in the `pt chat` and `pt collection` groups there is no `-p` for profile — there `-p` means `--path` (a directory inside the chat/collection) on the file commands. Use the long form `--profile` when in doubt.
|
|
175
191
|
|
|
176
192
|
## Configuration
|
|
177
193
|
|
|
@@ -339,8 +355,12 @@ pt task import tasks/briefing.json --profile production
|
|
|
339
355
|
|
|
340
356
|
# Publish a conventional task project (GOAL.md required); pass an ID to update
|
|
341
357
|
pt task publish ./tasks/briefing --virtual-assistant-id 7
|
|
358
|
+
pt task publish ./tasks/briefing --virtual-assistant-id 7 --type group --chat-history --docs-enabled --scheduled-jobs
|
|
342
359
|
pt task publish ./tasks/briefing --task-id 99 --virtual-assistant-id 7
|
|
343
360
|
|
|
361
|
+
# Launch a task into a chat (optionally inside a workspace), as the web app does
|
|
362
|
+
pt task launch 99 --workspace-id 738
|
|
363
|
+
|
|
344
364
|
# Make the resulting task public/private, or test its goal in a chat
|
|
345
365
|
pt task set-public 99
|
|
346
366
|
pt task set-private 99
|
|
@@ -429,21 +449,20 @@ for the full tool list.
|
|
|
429
449
|
|
|
430
450
|
## Agent Tools Plugin
|
|
431
451
|
|
|
432
|
-
Beyond the CLI and MCP server,
|
|
433
|
-
(
|
|
434
|
-
|
|
435
|
-
agents**, reusing the same client code as `pt`. It's
|
|
436
|
-
|
|
437
|
-
only in the agent runtime:
|
|
452
|
+
Beyond the CLI and MCP server, the package also ships the **agent tools plugin**
|
|
453
|
+
(`primethink_agent_tools`) — it exposes the PrimeThink admin/management API
|
|
454
|
+
(tasks, agents, chats, collections) as **LangChain tools for PrimeThink
|
|
455
|
+
agents**, reusing the same client code as `pt`. It's enabled by the optional
|
|
456
|
+
`agent-tools` extra, so plain CLI installs stay lean (no langchain) and the
|
|
457
|
+
plugin is installed only in the agent runtime / API image:
|
|
438
458
|
|
|
439
459
|
```bash
|
|
440
|
-
pip install primethink-cli
|
|
460
|
+
pip install 'primethink-cli[agent-tools]'
|
|
441
461
|
```
|
|
442
462
|
|
|
443
463
|
The PrimeThink API discovers it automatically via the `primethink.tools` entry
|
|
444
464
|
point. Authentication uses a per-user `ADMIN_PRIMETHINK_API_TOKEN` setting. See
|
|
445
|
-
[`
|
|
446
|
-
and setup.
|
|
465
|
+
[`docs/agent-tools.md`](docs/agent-tools.md) for the tool list, auth, and setup.
|
|
447
466
|
|
|
448
467
|
## Agent Skills
|
|
449
468
|
|
|
@@ -1,37 +1,3 @@
|
|
|
1
|
-
Metadata-Version: 2.4
|
|
2
|
-
Name: primethink-cli
|
|
3
|
-
Version: 1.4.0
|
|
4
|
-
Summary: PrimeThink CLI - A powerful tool for interacting with PrimeThink AI API
|
|
5
|
-
Author-email: PrimeThink <support@primethink.ai>
|
|
6
|
-
License-Expression: MIT
|
|
7
|
-
Project-URL: Homepage, https://primethink.ai
|
|
8
|
-
Project-URL: Documentation, https://primethink.ai/cli/install
|
|
9
|
-
Project-URL: Repository, https://github.com/primethink-ai/primethink-cli
|
|
10
|
-
Project-URL: Issues, https://github.com/primethink-ai/primethink-cli/issues
|
|
11
|
-
Keywords: cli,ai,primethink,api,assistant
|
|
12
|
-
Classifier: Development Status :: 4 - Beta
|
|
13
|
-
Classifier: Intended Audience :: Developers
|
|
14
|
-
Classifier: Programming Language :: Python :: 3
|
|
15
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
16
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
17
|
-
Classifier: Programming Language :: Python :: 3.10
|
|
18
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
19
|
-
Classifier: Programming Language :: Python :: 3.12
|
|
20
|
-
Classifier: Topic :: Software Development :: Libraries :: Python Modules
|
|
21
|
-
Classifier: Topic :: Utilities
|
|
22
|
-
Requires-Python: >=3.8
|
|
23
|
-
Description-Content-Type: text/markdown
|
|
24
|
-
License-File: LICENSE
|
|
25
|
-
Requires-Dist: click>=8.0.0
|
|
26
|
-
Requires-Dist: requests>=2.25.0
|
|
27
|
-
Provides-Extra: mcp
|
|
28
|
-
Requires-Dist: mcp<2,>=1.2.0; extra == "mcp"
|
|
29
|
-
Provides-Extra: dev
|
|
30
|
-
Requires-Dist: pytest>=7.0.0; extra == "dev"
|
|
31
|
-
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
|
|
32
|
-
Requires-Dist: mcp<2,>=1.2.0; python_version >= "3.10" and extra == "dev"
|
|
33
|
-
Dynamic: license-file
|
|
34
|
-
|
|
35
1
|
# PrimeThink CLI
|
|
36
2
|
|
|
37
3
|
Command Line Interface for interacting with the PrimeThink API.
|
|
@@ -66,7 +32,7 @@ pt chat send --agent AGENT_ID --message "your message"
|
|
|
66
32
|
| Command | Description |
|
|
67
33
|
|---|---|
|
|
68
34
|
| `pt version` | Display the CLI version |
|
|
69
|
-
| `pt whoami` | Show the authenticated user
|
|
35
|
+
| `pt whoami` | Show the authenticated user, their groups, active group, and configured providers |
|
|
70
36
|
| `pt mcp` | Run PrimeThink as an MCP server (exposes the API as tools over stdio) |
|
|
71
37
|
| `pt install-skill` | Install the bundled CLI agent skill for Claude Code and compatible agents |
|
|
72
38
|
| `pt install-developer-skill` | Install the complete public PrimeThink developer skill, including nested resources |
|
|
@@ -79,7 +45,7 @@ pt chat send --agent AGENT_ID --message "your message"
|
|
|
79
45
|
| `pt profile remove` | Remove a profile |
|
|
80
46
|
| `pt chat send` | Send a message to a chat (by ID/mention) or an agent |
|
|
81
47
|
| `pt chat list` | List chats (paginated, filterable by star/archive/workspace) |
|
|
82
|
-
| `pt chat create` | Create a new chat |
|
|
48
|
+
| `pt chat create` | Create a new chat (`--from-task-id` launches a task into it) |
|
|
83
49
|
| `pt chat rename` | Rename a chat |
|
|
84
50
|
| `pt chat goal` | Update a chat's goal |
|
|
85
51
|
| `pt chat type` | Switch a chat between `live-app` and `chat` mode |
|
|
@@ -127,8 +93,10 @@ pt chat send --agent AGENT_ID --message "your message"
|
|
|
127
93
|
| `pt agent list-docs` | List documents in an agent's knowledge base |
|
|
128
94
|
| `pt agent upload-docs` | Upload files to an agent's knowledge base |
|
|
129
95
|
| `pt agent attach-collections` / `pt agent detach-collection` | Attach / detach collections for agent RAG |
|
|
96
|
+
| `pt agent upload-image` / `pt agent delete-image` | Upload / delete an agent's image |
|
|
130
97
|
| `pt capability list` / `create` / `update` / `delete` | Manage agent capabilities |
|
|
131
98
|
| `pt capability archive` / `unarchive` / `duplicate` | Archive, unarchive, or duplicate a capability |
|
|
99
|
+
| `pt capability resolve` | Resolve capability codes/ids to ids |
|
|
132
100
|
| `pt models list` / `pt models embeddings` | Discover LLM / embedding models from the catalog |
|
|
133
101
|
| `pt scheduled-job list` / `create` / `update` | Manage scheduled jobs (prompts on a schedule) in a chat |
|
|
134
102
|
| `pt scheduled-job set-status` / `delete` | Pause/resume or delete a scheduled job |
|
|
@@ -141,6 +109,10 @@ pt chat send --agent AGENT_ID --message "your message"
|
|
|
141
109
|
| `pt tag list` / `create` / `assign` | List, create, and assign tags (task/agent/capability/collection) |
|
|
142
110
|
| `pt group list` / `get` / `create` / `update` / `delete` | Manage groups (organizations) |
|
|
143
111
|
| `pt group members` / `remove-member` / `invite` / `add-agent` | Manage group members, invites, and agents |
|
|
112
|
+
| `pt settings list` / `get` / `set` / `delete` | Manage group/user settings and provider API keys (secrets never shown) |
|
|
113
|
+
| `pt user list` / `search` | Look up users you can see by name or email |
|
|
114
|
+
| `pt notification list` / `unread-count` | List your notifications or count the unread ones |
|
|
115
|
+
| `pt notification mark-read` / `mark-unread` / `mark-all-read` / `delete` | Mark notifications read/unread, mark all read, or delete one |
|
|
144
116
|
| `pt task list` | List tasks, filterable by name/type/status and paginated |
|
|
145
117
|
| `pt task actions` | List available task actions |
|
|
146
118
|
| `pt task execute` | Execute a task action with a message and optional files |
|
|
@@ -152,12 +124,17 @@ pt chat send --agent AGENT_ID --message "your message"
|
|
|
152
124
|
| `pt task delete` | Delete a task (asks for confirmation; `--yes` to skip) |
|
|
153
125
|
| `pt task duplicate` | Duplicate a task |
|
|
154
126
|
| `pt task set-public` / `pt task set-private` | Make a task public / private |
|
|
155
|
-
| `pt task publish` | Create/update a task from a project directory |
|
|
127
|
+
| `pt task publish` | Create/update a task from a project directory (`--type`, feature toggles, optional `task.json`) |
|
|
128
|
+
| `pt task launch` | Launch a task into a new chat, optionally inside a workspace |
|
|
156
129
|
| `pt task test` | Sync a task goal into a new or existing chat |
|
|
157
130
|
| `pt task export` | Export a task's portable config as JSON (for `pt task import`) |
|
|
158
131
|
| `pt task import` | Create a new task from an exported JSON file (deploy across environments with `--profile`) |
|
|
159
132
|
| `pt task create-version` | Snapshot a task's current state as a named version |
|
|
160
133
|
| `pt task upload-image` | Upload an image for a task |
|
|
134
|
+
| `pt eval list` / `add` / `update` / `delete` | Manage a task's evaluation-data set (the test plan) |
|
|
135
|
+
| `pt eval settings` | Configure a task's evaluation settings (schedule, evaluator, thresholds) |
|
|
136
|
+
| `pt eval run` / `runs` / `run-get` / `results` / `download` | Run a task evaluation and inspect its runs and results |
|
|
137
|
+
| `pt eval simulate` / `simulations` / `delete-simulation` | Run and manage agent-vs-agent task simulations |
|
|
161
138
|
| `pt search documents` | Semantic search across documents in a vector store collection |
|
|
162
139
|
| `pt search chat` | Semantic search within a chat |
|
|
163
140
|
| `pt search collection` | Semantic search within a collection |
|
|
@@ -171,7 +148,7 @@ Every command that calls the API also accepts `--profile` (use a specific profil
|
|
|
171
148
|
|
|
172
149
|
`--help` works in either position: `pt chat send --help`, `pt chat --help send`, and `pt --help chat send` all print the same page.
|
|
173
150
|
|
|
174
|
-
> **Tip:** `-p` is the short flag for `--profile` in
|
|
151
|
+
> **Tip:** `-p` is the short flag for `--profile` in most groups (e.g. `pt task`, `pt agent`, `pt search`, `pt settings`, `pt user`, `pt notification`, `pt eval`), `pt image generate`, and `pt whoami`, but in the `pt chat` and `pt collection` groups there is no `-p` for profile — there `-p` means `--path` (a directory inside the chat/collection) on the file commands. Use the long form `--profile` when in doubt.
|
|
175
152
|
|
|
176
153
|
## Configuration
|
|
177
154
|
|
|
@@ -339,8 +316,12 @@ pt task import tasks/briefing.json --profile production
|
|
|
339
316
|
|
|
340
317
|
# Publish a conventional task project (GOAL.md required); pass an ID to update
|
|
341
318
|
pt task publish ./tasks/briefing --virtual-assistant-id 7
|
|
319
|
+
pt task publish ./tasks/briefing --virtual-assistant-id 7 --type group --chat-history --docs-enabled --scheduled-jobs
|
|
342
320
|
pt task publish ./tasks/briefing --task-id 99 --virtual-assistant-id 7
|
|
343
321
|
|
|
322
|
+
# Launch a task into a chat (optionally inside a workspace), as the web app does
|
|
323
|
+
pt task launch 99 --workspace-id 738
|
|
324
|
+
|
|
344
325
|
# Make the resulting task public/private, or test its goal in a chat
|
|
345
326
|
pt task set-public 99
|
|
346
327
|
pt task set-private 99
|
|
@@ -429,21 +410,20 @@ for the full tool list.
|
|
|
429
410
|
|
|
430
411
|
## Agent Tools Plugin
|
|
431
412
|
|
|
432
|
-
Beyond the CLI and MCP server,
|
|
433
|
-
(
|
|
434
|
-
|
|
435
|
-
agents**, reusing the same client code as `pt`. It's
|
|
436
|
-
|
|
437
|
-
only in the agent runtime:
|
|
413
|
+
Beyond the CLI and MCP server, the package also ships the **agent tools plugin**
|
|
414
|
+
(`primethink_agent_tools`) — it exposes the PrimeThink admin/management API
|
|
415
|
+
(tasks, agents, chats, collections) as **LangChain tools for PrimeThink
|
|
416
|
+
agents**, reusing the same client code as `pt`. It's enabled by the optional
|
|
417
|
+
`agent-tools` extra, so plain CLI installs stay lean (no langchain) and the
|
|
418
|
+
plugin is installed only in the agent runtime / API image:
|
|
438
419
|
|
|
439
420
|
```bash
|
|
440
|
-
pip install primethink-cli
|
|
421
|
+
pip install 'primethink-cli[agent-tools]'
|
|
441
422
|
```
|
|
442
423
|
|
|
443
424
|
The PrimeThink API discovers it automatically via the `primethink.tools` entry
|
|
444
425
|
point. Authentication uses a per-user `ADMIN_PRIMETHINK_API_TOKEN` setting. See
|
|
445
|
-
[`
|
|
446
|
-
and setup.
|
|
426
|
+
[`docs/agent-tools.md`](docs/agent-tools.md) for the tool list, auth, and setup.
|
|
447
427
|
|
|
448
428
|
## Agent Skills
|
|
449
429
|
|
|
@@ -38,7 +38,7 @@ To obtain an API key, go to `Settings > API Keys` in the PrimeThink app and gene
|
|
|
38
38
|
| `pt chat send CHAT_ID` | `POST /api/v1/chats/{chat_id_or_mention}/messages` |
|
|
39
39
|
| `pt chat send --agent ID` | `POST /api/v1/virtual-assistants/{agent_id}/messages` |
|
|
40
40
|
| `pt chat list` | `GET /api/v1/chats` |
|
|
41
|
-
| `pt chat create` | `POST /api/v1/chats` |
|
|
41
|
+
| `pt chat create` | `POST /api/v1/chats` (`--from-task-id` adds `?copy_from_task_id=`) |
|
|
42
42
|
| `pt chat rename` | `PUT /api/v1/chats/{chat_id}/name` |
|
|
43
43
|
| `pt chat goal` | `PUT /api/v1/chats/{chat_id}/goal` |
|
|
44
44
|
| `pt chat type` | `PUT /api/v1/chats/{chat_id}/page_type?page_type=html\|chat` |
|
|
@@ -93,12 +93,15 @@ To obtain an API key, go to `Settings > API Keys` in the PrimeThink app and gene
|
|
|
93
93
|
| `pt agent upload-docs` | `POST /api/v1/virtual-assistants/{va_id}/documents` (multipart) |
|
|
94
94
|
| `pt agent attach-collections` | `POST /api/v1/virtual-assistants/{va_id}/collections/attach` |
|
|
95
95
|
| `pt agent detach-collection` | `DELETE /api/v1/virtual-assistants/{va_id}/collections/{collection_id}` |
|
|
96
|
+
| `pt agent upload-image` | `POST /api/v1/virtual-assistants/{va_id}/image` (multipart) |
|
|
97
|
+
| `pt agent delete-image` | `DELETE /api/v1/virtual-assistants/{va_id}/image` |
|
|
96
98
|
| `pt capability list` | `GET /api/v1/virtual-assistants/capabilities` |
|
|
97
99
|
| `pt capability create` | `POST /api/v1/virtual-assistants/capabilities` |
|
|
98
100
|
| `pt capability update` | `PATCH /api/v1/virtual-assistants/capabilities/{capability_id}` |
|
|
99
101
|
| `pt capability delete` | `DELETE /api/v1/virtual-assistants/capabilities/{capability_id}` |
|
|
100
102
|
| `pt capability archive` / `unarchive` | `PUT /api/v1/virtual-assistants/capabilities/{capability_id}/archived?archived=true\|false` |
|
|
101
103
|
| `pt capability duplicate` | `POST /api/v1/virtual-assistants/capabilities/{capability_id}/duplicate` |
|
|
104
|
+
| `pt capability resolve` | resolves capability codes/ids to ids via `GET /api/v1/virtual-assistants/capabilities` |
|
|
102
105
|
| `pt models list` | `GET /api/v1/catalog/llm/models` |
|
|
103
106
|
| `pt models embeddings` | `GET /api/v1/catalog/embeddings/models` |
|
|
104
107
|
| `pt task list` | `GET /api/v1/tasks/` |
|
|
@@ -111,7 +114,8 @@ To obtain an API key, go to `Settings > API Keys` in the PrimeThink app and gene
|
|
|
111
114
|
| `pt task delete` | `DELETE /api/v1/tasks/{task_id}` |
|
|
112
115
|
| `pt task duplicate` | `POST /api/v1/tasks/{task_id}/duplicate` |
|
|
113
116
|
| `pt task set-public` / `set-private` | `PATCH /api/v1/tasks/{task_id}/public-status?task_type=public\|private` |
|
|
114
|
-
| `pt task publish` | `POST /api/v1/tasks/` or `PATCH /api/v1/tasks/{task_id}` |
|
|
117
|
+
| `pt task publish` | `POST /api/v1/tasks/` or `PATCH /api/v1/tasks/{task_id}` (type/toggles from options or the project's `task.json`) |
|
|
118
|
+
| `pt task launch` | `POST /api/v1/chats?copy_from_task_id={task_id}[&task_version_number=N]` (body: optional `chat_workspace_id`, `name`) |
|
|
115
119
|
| `pt task test` | `POST /api/v1/chats` (new only), `PUT /api/v1/chats/{chat_id}/page_type` (existing only), `PUT /api/v1/chats/{chat_id}/goal` |
|
|
116
120
|
| `pt live-app publish` | task create/update + task version + task directory/document/version endpoints |
|
|
117
121
|
| `pt live-app test` | chat create/page-type/goal + chat directory/document/version endpoints |
|
|
@@ -130,7 +134,7 @@ To obtain an API key, go to `Settings > API Keys` in the PrimeThink app and gene
|
|
|
130
134
|
| `pt voice diarize` | `POST /api/v1/voice/diarize` (multipart `file`[, `speaker_file`]) |
|
|
131
135
|
| `pt voice translate` | `POST /api/v1/voice/translate` (multipart `file`) |
|
|
132
136
|
| `pt video analyze` | `POST /api/v1/video/analyze` (multipart `file`) |
|
|
133
|
-
| `pt whoami` | `GET /api/v1/users/me` + `GET /api/v1/users/me/groups` |
|
|
137
|
+
| `pt whoami` | `GET /api/v1/users/me` + `GET /api/v1/users/me/groups` (response also includes `active_group` and `configured_providers`) |
|
|
134
138
|
| `pt workspace list` | `GET /api/v1/chat-workspaces` |
|
|
135
139
|
| `pt workspace create` | `POST /api/v1/chat-workspaces` |
|
|
136
140
|
| `pt workspace rename` | `PUT /api/v1/chat-workspaces/{id}/name` |
|
|
@@ -152,6 +156,29 @@ To obtain an API key, go to `Settings > API Keys` in the PrimeThink app and gene
|
|
|
152
156
|
| `pt group remove-member` | `DELETE /api/v1/groups/{group_id}/members/` (`[user_ids]`) |
|
|
153
157
|
| `pt group invite` | `POST /api/v1/groups/invite/?email=&role_id=` |
|
|
154
158
|
| `pt group add-agent` / `remove-agent` | `POST /api/v1/groups/{group_id}/add_vas` / `DELETE .../remove_vas` (`[vas_ids]`) |
|
|
159
|
+
| `pt settings list` | `GET /api/v1/groups/current/settings` + `GET /api/v1/users/me/settings` (+ dedicated properties); secret values never shown |
|
|
160
|
+
| `pt settings get` | `GET` the group or user setting for KEY (`--scope group\|user`; sensitive values redacted) |
|
|
161
|
+
| `pt settings set` | routed by KEY to the group/user setting endpoint; provider `*_API_KEY` keys stored as secrets |
|
|
162
|
+
| `pt settings delete` | `DELETE` the KV setting for KEY (`--scope group\|user`; dedicated properties can't be deleted) |
|
|
163
|
+
| `pt user list` / `search` | `GET /api/v1/users/me/visible-users[/full]` (search/limit are client-side) |
|
|
164
|
+
| `pt notification list` | `GET /api/v1/notifications?page=&page_size=` (`--unread-only` is client-side) |
|
|
165
|
+
| `pt notification unread-count` | `GET /api/v1/notifications/unread-count` |
|
|
166
|
+
| `pt notification mark-read` / `mark-unread` | `POST /api/v1/notifications/{notification_id}/mark-as-read` / `.../mark-as-unread` |
|
|
167
|
+
| `pt notification mark-all-read` | `POST /api/v1/notifications/mark-all-as-read` |
|
|
168
|
+
| `pt notification delete` | `DELETE /api/v1/notifications/{notification_id}` |
|
|
169
|
+
| `pt eval list` | `GET /api/v1/tasks/{task_id}/evaluation-data` |
|
|
170
|
+
| `pt eval add` | `POST /api/v1/tasks/{task_id}/evaluation-data` |
|
|
171
|
+
| `pt eval update` | `PATCH /api/v1/tasks/{task_id}/evaluation-data/{eval_id}` |
|
|
172
|
+
| `pt eval delete` | `DELETE /api/v1/tasks/{task_id}/evaluation-data/{eval_id}` |
|
|
173
|
+
| `pt eval settings` | `PATCH /api/v1/tasks/{task_id}/evaluation-settings` |
|
|
174
|
+
| `pt eval run` | `POST /api/v1/tasks/{task_id}/evaluation` |
|
|
175
|
+
| `pt eval runs` | `GET /api/v1/tasks/{task_id}/evaluations/runs/` |
|
|
176
|
+
| `pt eval run-get` | `GET /api/v1/tasks/{task_id}/evaluations/runs/{run_id}` |
|
|
177
|
+
| `pt eval results` | `GET /api/v1/tasks/{task_id}/evaluation_results` |
|
|
178
|
+
| `pt eval download` | `GET /api/v1/tasks/{task_id}/evaluations/runs/{run_id}/download` |
|
|
179
|
+
| `pt eval simulate` | `POST /api/v1/tasks/{task_id}/simulations` |
|
|
180
|
+
| `pt eval simulations` | `GET /api/v1/tasks/{task_id}/simulations` |
|
|
181
|
+
| `pt eval delete-simulation` | `DELETE /api/v1/tasks/{task_id}/simulations/{sim_id}` |
|
|
155
182
|
| `pt {chat,collection,task,agent} mkdir` | `POST /api/v1/{owner}/{id}/directories?path=…` |
|
|
156
183
|
| `pt {chat,collection,task,agent} rmdir` | `DELETE /api/v1/{owner}/{id}/directories/delete` (`{dir_path, delete_recursively}`) |
|
|
157
184
|
| `pt {chat,collection,task,agent} move-dir` | `POST /api/v1/{owner}/{id}/directories/move` (`{src_dir, dest_parent, merge_dirs}`) |
|
|
@@ -283,11 +310,13 @@ pt chat list [--page N] [--page-size N] [--search TEXT] [--starred/--no-starred]
|
|
|
283
310
|
|
|
284
311
|
**Body**: JSON object; all fields optional and omitted unless set — `name`, `goal`, `virtual_assistant_id` (int), `chat_workspace_id`, `parent_chat_id` (int), `type` (`standard` | `direct_users`; server default `standard`), `public` (bool), `members` (int array).
|
|
285
312
|
|
|
313
|
+
**Query parameters** (task launch): `copy_from_task_id` (int) makes the server copy that task's goal, default agent, settings, documents, collections and scheduled job into the new chat and post its initial prompt — the route the web app uses to open a task; `task_version_number` (int, optional) launches a specific version. A `task_id` in the body is ignored by the server. Exposed as `pt task launch` / `pt chat create --from-task-id` and the `launch_task` MCP tool.
|
|
314
|
+
|
|
286
315
|
**Success statuses**: 200, 201
|
|
287
316
|
|
|
288
317
|
**CLI Command**:
|
|
289
318
|
```bash
|
|
290
|
-
pt chat create [--name TEXT] [--goal TEXT | --goal-file PATH] [--virtual-assistant-id ID] [--workspace-id ID] [--parent-chat-id ID] [--type TYPE] [--public/--no-public] [--member USER_ID]...
|
|
319
|
+
pt chat create [--name TEXT] [--goal TEXT | --goal-file PATH] [--virtual-assistant-id ID] [--workspace-id ID] [--parent-chat-id ID] [--type TYPE] [--public/--no-public] [--member USER_ID]... [--from-task-id TASK_ID]
|
|
291
320
|
```
|
|
292
321
|
|
|
293
322
|
---
|
|
@@ -827,7 +856,7 @@ pt search messages QUERY --collection-name NAME [--chat-id N] [--user-id N] [--a
|
|
|
827
856
|
|
|
828
857
|
**Endpoints**: `GET /api/v1/users/me` and `GET /api/v1/users/me/groups`
|
|
829
858
|
|
|
830
|
-
The CLI calls both and prints one combined JSON object: `{ "user": { ... }, "groups": [ ... ] }`.
|
|
859
|
+
The CLI calls both and prints one combined JSON object: `{ "user": { ... }, "groups": [ ... ], "active_group": { "id": …, "name": … }, "configured_providers": [ ... ] }`. `active_group` is the user's currently active group; `configured_providers` lists the LLM provider slugs that have an API key set.
|
|
831
860
|
|
|
832
861
|
**CLI Command**:
|
|
833
862
|
```bash
|