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.1.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.1-py3-none-any.whl (33.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: customgpt_cli-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 d66c928b9c83e55ab32baf572c816bba824c694a91b3af9e8484d385a11d5b48
MD5 81f18088f20b41c980bb372cef3f3bb1
BLAKE2b-256 0175798a8b2e4db05e4071e31c3db483292653d1585b5ace7b2579c500cadf1c

See more details on using hashes here.

File details

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

File metadata

  • Download URL: customgpt_cli-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 3b01ff3d23185dee8976d2f909d71f891e58fd39eeefbfda06ead9e3cf57517a
MD5 901a87db72d373bc3a5ee2f3e0b5281d
BLAKE2b-256 bc01bd6f62c1079e98574a2fcdd30c08ef38f6657ceeb0294628365e4c864e38

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