Skip to main content

No-code AI agent creation platform for enterprise knowledge automation

Project description

CustomGPT CLI

PyPI version Python Support Documentation Status Coverage Status Code style: black License: MIT Docker Pulls

🚀 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:

  1. Environment Variable (recommended):
export CUSTOMGPT_API_KEY=your_api_key
customgpt-cli list-projects
  1. 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

Scripting Examples

Here is an examples of how to use the CLI in scripts:

  1. 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 parsing
  • csv: CSV format for stats data
  • id-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
  • --force flag 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

customgpt_cli-0.1.0.tar.gz (34.3 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

customgpt_cli-0.1.0-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

Details for the file customgpt_cli-0.1.0.tar.gz.

File metadata

  • Download URL: customgpt_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 34.3 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

Hashes for customgpt_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 b04c059b810ac856155abac120d50d49aae5df388d3c6b3d938c4ed9d4871cef
MD5 e0ac2dc44e13a2a685935f878494eeb0
BLAKE2b-256 5a97fe69d489459222bc2092c0cbaee0e5200f65060686806d66e8a0675910cd

See more details on using hashes here.

File details

Details for the file customgpt_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: customgpt_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 33.7 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

Hashes for customgpt_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b703f2c813c59d1fb17331ea128ff61c03ed9ec02052394f5b85faa562bad825
MD5 1a5bcbab3fa49d2f30fb8512423d1df7
BLAKE2b-256 c389b51c041cd3ea39c5f200427a370903ff8bfdeff6ed84193a56d59ef1bc4c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page