PrimeThink CLI - A powerful tool for interacting with PrimeThink AI API
Project description
PrimeThink CLI
Command Line Interface for interacting with the PrimeThink API.
Installation
pip install -e .
Or install from requirements:
pip install -r requirements.txt
Quick Start
- Configure your API token:
primethink configure --token YOUR_API_TOKEN
- Use the CLI commands:
primethink available-actions
primethink execute-action --action "action-name" --message "your message"
primethink send-message CHAT_ID --message "your message"
primethink send-message --agent AGENT_ID --message "your message"
Configuration
Token Management
The CLI supports multiple token profiles, allowing you to switch between different accounts or API endpoints.
Configure a new profile
primethink configure --token YOUR_API_TOKEN --profile default
Options:
--token, -t: Your API token (required)--profile, -p: Profile name (default: "default")--api-url, -u: Custom API URL (optional, default: https://api.primethink.ai)
List all profiles
primethink list-profiles
Switch to a different profile
primethink use PROFILE_NAME
Remove a profile
primethink remove-profile PROFILE_NAME
Commands
Version
Display the CLI version:
primethink version
Available Actions
Get a list of available task actions:
primethink available-actions
You can use a specific profile for a single request without switching the active profile:
primethink available-actions --profile production
You can also override the API URL for a single request:
primethink available-actions --api-url https://custom-api.example.com
Execute Task Action
Execute a task action with a message and optional files:
primethink execute-action --action "action-name" --message "your message"
With files:
primethink execute-action --action "action-name" --message "your message" --files file1.txt --files file2.txt
Options:
--action, -a: Task action name (required)--message, -m: Message input (required)--files, -f: Files to attach (can be specified multiple times)--return-original: Return original message (flag)--profile, -p: Profile to use for this request (optional)--api-url, -u: Override API URL for this request (optional)
Send Message to Chat
Send a message to an existing chat by ID or mention name:
primethink send-message CHAT_ID_OR_MENTION --message "your message"
You can use either a chat ID or mention name:
# By chat ID
primethink send-message 123 --message "your message"
# By mention name
primethink send-message @my-assistant --message "your message"
With files:
primethink send-message 123 --message "your message" --files file1.txt --files file2.txt
Options:
CHAT_ID_OR_MENTION: The chat ID or mention name (optional, positional argument)--message, -m: Message input (required)--files, -f: Files to attach (can be specified multiple times)--async: Asynchronous request (flag, default: false, applies only to chat messages)--agent, -a: Agent ID to send message to (optional, use instead of CHAT_ID_OR_MENTION)--profile, -p: Profile to use for this request (optional)--api-url, -u: Override API URL for this request (optional)
Note: You must provide either CHAT_ID_OR_MENTION or --agent, but not both.
Send Message to Agent
Send a message directly to an agent using the --agent option:
primethink send-message --agent 1 --message "your message"
With files:
primethink send-message --agent 1 --message "Analyze this data" --files data.csv
Configuration File
The CLI stores configuration in ~/.primethink/config.json. This file contains:
- Active profile
- All configured profiles with their tokens and optional custom API URLs
Example structure:
{
"active_profile": "default",
"profiles": {
"default": {
"token": "your-api-token"
},
"custom": {
"token": "your-custom-token",
"api_url": "https://custom-api.example.com"
}
}
}
Development
Install development dependencies
pip install -e ".[dev]"
Run tests
pytest
Run tests with coverage
pytest --cov=primethink --cov-report=html
Examples
Example 1: Configure and use the CLI
# Configure your token
primethink configure --token YOUR_API_TOKEN
# List available actions
primethink available-actions
# Execute an action
primethink execute-action --action "summarize" --message "Summarize this text"
Example 2: Using multiple profiles
# Configure default profile
primethink configure --token YOUR_TOKEN --profile default
# Configure a custom API endpoint profile
primethink configure --token CUSTOM_TOKEN --profile production --api-url https://prod-api.example.com
# List profiles
primethink list-profiles
# Switch to production profile
primethink use production
# Or use a specific profile for a single command without switching
primethink available-actions --profile production
primethink send-message 123 --message "Hello" --profile default
# Switch back to default
primethink use default
Example 3: Sending messages with files
# Send a message to a chat with multiple files
primethink send-message 123 --message "Here are the documents" --files report.pdf --files data.csv
# Send message by mention name
primethink send-message @my-assistant --message "Review this"
# Send to agent with a specific profile
primethink send-message --agent 1 --message "Help me with this task" --files data.csv --profile production
# Use a custom API URL for a single request
primethink send-message 123 --message "Hello" --api-url https://custom-api.example.com
License
MIT License
Support
For issues and questions, please visit: https://primethink.ai
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file primethink_cli-1.0.0.tar.gz.
File metadata
- Download URL: primethink_cli-1.0.0.tar.gz
- Upload date:
- Size: 149.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ba1ee770ee50088a305551833ffc8c194e018caa5fdabc6769d4894b7c06dd8c
|
|
| MD5 |
476c9855a717b2a72fc1c4f771bfeee4
|
|
| BLAKE2b-256 |
1f703edf491837107926c34529fa6435f531e4afa15d3b61333b3a1c18d90681
|
File details
Details for the file primethink_cli-1.0.0-py3-none-any.whl.
File metadata
- Download URL: primethink_cli-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
08e3b1b2b83f36f94486e9a43d8ab780ada48fa9a77d81ece7ae26d8d689a9a3
|
|
| MD5 |
122eca90ae13e0531f7022dea08f6987
|
|
| BLAKE2b-256 |
2db22bd670df2d8005d43441a46a5ac1cf78f198c5033835fb80d938cce01b67
|