CLI harness for AnyGen OpenAPI - Generate docs, slides, websites and more via AnyGen cloud API. Requires: ANYGEN_API_KEY
Project description
AnyGen CLI
A stateful command-line interface for AnyGen OpenAPI — generate professional slides, documents, websites, diagrams, and more from natural language prompts. Designed for AI agents and power users.
Prerequisites
- Python 3.10+
requests(HTTP client)click(CLI framework)- AnyGen API key (
sk-xxx)
Optional (for interactive REPL):
prompt_toolkit
Install Dependencies
pip install requests click prompt_toolkit
Get an API Key
- Go to anygen.io/home → Setting → Integration
- Create an API key (format:
sk-xxx) - Configure it:
# Option 1: Config file (recommended)
cli-anything-anygen config set api_key "sk-xxx"
# Option 2: Environment variable
export ANYGEN_API_KEY="sk-xxx"
How to Run
All commands are run from the agent-harness/ directory or via the installed command.
One-shot Commands
# Show help
cli-anything-anygen --help
# Full workflow: create → poll → download
cli-anything-anygen task run --operation slide --prompt "AI trends presentation" --output ./
# Create a task (returns task ID)
cli-anything-anygen task create --operation doc --prompt "Technical design document"
# Check task status
cli-anything-anygen task status task_xxx
# Poll until completion (with auto-download)
cli-anything-anygen task poll task_xxx --output ./
# Download result file
cli-anything-anygen task download task_xxx --output ./
# JSON output for agent consumption
cli-anything-anygen --json task status task_xxx
Interactive REPL
cli-anything-anygen
Inside the REPL, type help for all available commands.
Command Reference
Task
task create --operation <type> --prompt <text> [options]
task run --operation <type> --prompt <text> [--output dir] [options]
task status <task-id>
task poll <task-id> [--output dir]
task download <task-id> --output <dir>
task thumbnail <task-id> --output <dir>
task list [--limit N] [--status completed]
task prepare --message <text> [--file-token tk_xxx] [--save conv.json]
Operations: slide, doc, smart_draw, chat, storybook, data_analysis, website
Create / run options:
--language/-l— zh-CN or en-US--slide-count/-c— Number of slides (slide only)--template/-t— Slide template (slide only)--ratio/-r— 16:9 or 4:3 (slide only)--export-format/-f— pptx/image/thumbnail/docx/drawio/excalidraw--file-token— File token from upload (repeatable)--style/-s— Style preference
File
file upload <path>
Config
config set api_key "sk-xxx"
config set default_language "en-US"
config get [key]
config delete <key>
config path
Session
session status
session history [--limit N]
session undo
session redo
JSON Mode
Add --json before the subcommand for machine-readable output:
cli-anything-anygen --json task status task_xxx
cli-anything-anygen --json task list --limit 5
Running Tests
cd agent-harness
# Unit tests (mock HTTP, no API key needed)
python3 -m pytest cli_anything/anygen/tests/test_core.py -v
# E2E tests (requires ANYGEN_API_KEY)
ANYGEN_API_KEY=sk-xxx python3 -m pytest cli_anything/anygen/tests/test_full_e2e.py -v
# All tests
python3 -m pytest cli_anything/anygen/tests/ -v
Example Workflow
# Configure API key
cli-anything-anygen config set api_key "sk-xxx"
# Upload a reference file
cli-anything-anygen file upload ./quarterly_data.pdf
# Output: ✓ Uploaded: quarterly_data.pdf → token: tk_abc123
# Requirement analysis (multi-turn)
cli-anything-anygen task prepare --message "I need a quarterly review slide deck" --save conv.json
# AnyGen asks clarifying questions...
cli-anything-anygen task prepare --message "Focus on revenue growth, 10 slides" --input conv.json --save conv.json
# Status: ready, suggested operation: slide
# Create and download in one step
cli-anything-anygen task run \
--operation slide \
--prompt "Quarterly business review..." \
--file-token tk_abc123 \
--slide-count 10 \
--style "business formal" \
--output ./output/
# Or step-by-step
cli-anything-anygen task create --operation slide --prompt "..."
# Task ID: task_xxx
cli-anything-anygen task poll task_xxx --output ./output/
# ✓ Downloaded: ./output/presentation.pptx (2,048,576 bytes)
# Verify the file
cli-anything-anygen --json task status task_xxx
Supported Operations
| Operation | Type | Output | Downloadable |
|---|---|---|---|
| Slides | slide |
PPTX | Yes |
| Documents | doc |
DOCX | Yes |
| Diagrams | smart_draw |
drawio/excalidraw | Yes |
| General | chat |
— | No (URL) |
| Storybooks | storybook |
— | No (URL) |
| Data Analysis | data_analysis |
— | No (URL) |
| Websites | website |
— | No (URL) |
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 cli_anything_anygen-1.0.0.tar.gz.
File metadata
- Download URL: cli_anything_anygen-1.0.0.tar.gz
- Upload date:
- Size: 27.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
062f4717879c9cd2fe24425603a5c67ccc00d6fd9ea06002f8d0349642d248b1
|
|
| MD5 |
bff6c9566b2a6cc224a9c3f1d1ad818b
|
|
| BLAKE2b-256 |
6aa531e30a4ed6e4f94e6148667e1c7c71c6badbb3c40a9c176d1239e11af463
|
File details
Details for the file cli_anything_anygen-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cli_anything_anygen-1.0.0-py3-none-any.whl
- Upload date:
- Size: 32.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e1817b022e2d67fbad5130181577b586e0efa07a37370d17987eccb83d2aa1ce
|
|
| MD5 |
04c1d91975cfbbc13fc17d30d36a4b5f
|
|
| BLAKE2b-256 |
1d2d7e1ab13cf287be3d93e3558f6901bbc8426a6ee6e205fd96ae9b4baa7947
|