No-code AI agent creation platform for enterprise knowledge automation
Project description
CustomGPT CLI
🚀 A powerful command-line interface for CustomGPT SDK, enabling efficient project management and automation.
✨ Features
- 🛠️ Full CustomGPT SDK integration
- 🔐 Secure API key management
- 📊 Project management and monitoring
- 🤖 Conversation handling
- 📄 Page management
- 🐳 Docker support
- 🔄 Bulk operations
- 📊 Advanced filtering
Installation
pip install customgpt-cli
Authentication
The CLI requires your CustomGPT API key. You can provide it in two ways:
- Environment Variable (recommended):
export CUSTOMGPT_API_KEY=your_api_key
customgpt-cli list-projects
- Command Line Argument:
customgpt-cli --api-key YOUR_API_KEY list-projects
Note: Command line argument takes precedence over environment variable if both are set.
Usage
Project Management
Create a project:
# Using environment variable
export CUSTOMGPT_API_KEY=your_api_key
# With a sitemap, return project ID
customgpt-cli create-project --name "My Test Project With Sitemap" --sitemap "https://adorosario.github.io/small-sitemap.xml" --format id-only
# With a file, returning JSON output.
customgpt-cli create-project --name "My Test Project With File" --file /path/to/file.pdf --format json
List projects with filtering:
# Basic listing
customgpt-cli list-projects
# Filter by name pattern (supports regex)
customgpt-cli list-projects --name-filter "test.*project"
# Filter by activity
customgpt-cli list-projects --inactive-days 30
# Filter by query count
customgpt-cli list-projects --min-queries 100 --max-queries 1000
# Change output format
customgpt-cli list-projects --format json
customgpt-cli list-projects --format table
customgpt-cli list-projects --format id-only
Show a project details:
customgpt-cli show-project --project-id PROJECT_ID --format json
Update a project:
customgpt-cli update-project --project-id PROJECT_ID --name "New Name" --is-shared 1 --format json
Delete projects:
# Delete single project
customgpt-cli delete-projects --project-ids PROJECT_ID
# Delete multiple projects
customgpt-cli delete-projects --project-ids "id1,id2,id3"
# Delete (with dry run)
customgpt-cli delete-projects --project-ids PROJECT_ID --dry-run
# Force delete without confirmation
customgpt-cli delete-projects --project-ids PROJECT_ID --force
Conversation Management
Create a conversation:
customgpt-cli create-conversation --project-id PROJECT_ID --name "My Conversation"
Send a message:
# Without streaming
customgpt-cli send-message --project-id PROJECT_ID --session-id SESSION_ID --prompt "Hello"
# With streaming
customgpt-cli send-message --project-id PROJECT_ID --session-id SESSION_ID --prompt "Hello" --stream
# With custom persona
customgpt-cli send-message --project-id PROJECT_ID --session-id SESSION_ID --prompt "Hello" --persona "You are a helpful assistant"
Page Management
Get project pages:
customgpt-cli get-pages --project-id PROJECT_ID
Delete a page:
customgpt-cli delete-page --project-id PROJECT_ID --page-id PAGE_ID
Reindex a page:
customgpt-cli reindex-page --project-id PROJECT_ID --page-id PAGE_ID
Project Settings Management
Get project settings:
customgpt-cli get-project-settings --project-id PROJECT_ID
Update project settings:
customgpt-cli update-project-settings --project-id $PROJECT_ID --default-prompt "Test prompt" --chatbot-avatar "./tests/files/test.png" --chatbot-background "./tests/files/test.png" --example-questions '["Test questions"]' --response-source "default" --chatbot-msg-lang "en" --chatbot-color "#0e57cc" --chatbot-toolbar-color "#0e57cc" --persona-instructions "Test instructions" --citations-answer-source-label-msg "Test label" --citations-sources-label-msg "Test label" --hang-in-there-msg "Test message" --chatbot-siesta-msg "Test message" --is-loading-indicator-enabled --enable-citations 0 --enable-feedbacks --citations-view-type "user" --no-answer-message "Test message" --ending-message "Test message" --remove-branding --enable-recaptcha-for-public-chatbots --chatbot-model "gpt-4-o" --is-selling-enabled --license-slug "test" --selling-url "test"
Plugin Management
Get plugins:
customgpt-cli get-plugins --project-id PROJECT_ID
Create plugins:
customgpt-cli create-plugin --project-id $PROJECT_ID --model-name "TestPlugin" --human-name "Test Assistant" --keywords "test,automation" --description "This is a helpful automation tool." --is-active
Update plugins:
customgpt-cli update-plugin --project-id $PROJECT_ID --model-name "Updated" --human-name "Updated Assistant" --keywords "updated,assistant" --description "Trusted information about indoor plants and gardening." --is-active
Page Metadata Management
Get page metadata:
customgpt-cli get-page-metadata --project-id PROJECT_ID --page-id PAGE_ID
Update page metadata:
customgpt-cli update-page-metadata --project-id PROJECT_ID --page-id PAGE_ID --title "Page Title" --url "https://page-url.com" --description "Page description" --image "https://image-url.com/image.png"
Report Management
Get reports:
# Get traffic report
customgpt-cli get-traffic-report --project-id PROJECT_ID --filters '["traffic", "pages"]'
# Get queries report
customgpt-cli get-queries-report --project-id PROJECT_ID --filters '["queries", "pages"]'
# Get conversations report
customgpt-cli get-conversations-report --project-id PROJECT_ID --filters '["conversations", "pages"]'
# Get analysis report
customgpt-cli get-analysis-report --project-id PROJECT_ID --filters '["analysis", "pages"]'
Limits Management
Get limits:
customgpt-cli get-limits
Citations Management
Get citations:
customgpt-cli get-citations --project-id PROJECT_ID --citation-id CITATION_ID
Sources Management
Get sources:
customgpt-cli list-sources --project-id PROJECT_ID
Create a source:
# Create source with sitemap
customgpt-cli create-source --project-id PROJECT_ID --sitemap-path URL --file-data-retension --is-ocr-enabled --is-anonymized
# Create source with file
customgpt-cli create-source --project-id PROJECT_ID --file PATH --file-data-retension --is-ocr-enabled --is-anonymized
Update source:
customgpt-cli update-source --project-id PROJECT_ID --source-id SOURCE_ID --executive-js --data-refresh-frequency never --create-new-pages --remove-unexist-pages --refresh-existing-pages always --refresh-schedule ["00:00","08:00"]
Delete source:
customgpt-cli delete-source --project-id PROJECT_ID --source-id SOURCE_ID
Sync source:
customgpt-cli sync-source --project-id PROJECT_ID --source-id SOURCE_ID
User Management
Get user:
customgpt-cli get-user
Scripting Examples
Here is an examples of how to use the CLI in scripts:
- Export project IDs to a file and process them:
#!/bin/bash
export CUSTOMGPT_API_KEY=your_api_key
# Export IDs
customgpt-cli list-projects --name-filter "test" --format id-only > projects.txt
# Process the IDs
customgpt-cli delete-projects --project-ids $(paste -s -d, projects.txt) --force
Output Formats
The CLI supports multiple output formats for better integration with other tools:
table: Human-readable formatted table (default)json: JSON format for parsingcsv: CSV format for stats dataid-only: Just the IDs, one per line (good for scripting)
Safety Features
The CLI includes several safety features:
--dry-run: Shows what would be deleted without actually deleting- Confirmation prompts for destructive operations
--forceflag to skip confirmations in scripts- Error handling with informative messages
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
MIT License
Project details
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 customgpt_cli-0.1.3.tar.gz.
File metadata
- Download URL: customgpt_cli-0.1.3.tar.gz
- Upload date:
- Size: 36.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.11.10 Linux/5.15.0-94-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ad1d750ebea4509c5e959ce8d36fbcba2ac2726d6d8dce47f14d842f9fd76fc8
|
|
| MD5 |
e5b7677e3f0d55fcff83eca465107e4a
|
|
| BLAKE2b-256 |
bd4a847042a9a450c735803fdb614c4afaf70fdfecc09cdc47a29e73637ac9b1
|
File details
Details for the file customgpt_cli-0.1.3-py3-none-any.whl.
File metadata
- Download URL: customgpt_cli-0.1.3-py3-none-any.whl
- Upload date:
- Size: 34.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.5 CPython/3.11.10 Linux/5.15.0-94-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8917b528ea63923439b9120cf3c3ea8bed8208c0883e2b0493afa8acd3eb6d22
|
|
| MD5 |
78522335a56825925928f3d574797261
|
|
| BLAKE2b-256 |
9a46e915342daaf34db7c107420294d8f740858f8b4f42c8c2284af5b9e793ac
|