Skip to main content

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

  1. Go to anygen.io/home → Setting → Integration
  2. Create an API key (format: sk-xxx)
  3. 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)

Release files for cli-anything-anygen 1.0.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for cli-anything-anygen 1.0.0
File Size Uploaded
cli_anything_anygen-1.0.0.tar.gz 27.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for cli-anything-anygen 1.0.0
File Interpreter ABI Platform
cli_anything_anygen-1.0.0-py3-none-any.whl Python 3 none any Details

Total release size: 60.3 kB

Release files / cli_anything_anygen-1.0.0.tar.gz

Download URL cli_anything_anygen-1.0.0.tar.gz
Size 27.8 kB
Tags Source
SHA-256 checksum
How to use checksums
062f4717879c9cd2fe24425603a5c67ccc00d6fd9ea06002f8d0349642d248b1
BLAKE2b-256 checksum
How to use checksums
6aa531e30a4ed6e4f94e6148667e1c7c71c6badbb3c40a9c176d1239e11af463
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release files / cli_anything_anygen-1.0.0-py3-none-any.whl

Download URL cli_anything_anygen-1.0.0-py3-none-any.whl
Size 32.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e1817b022e2d67fbad5130181577b586e0efa07a37370d17987eccb83d2aa1ce
BLAKE2b-256 checksum
How to use checksums
1d2d7e1ab13cf287be3d93e3558f6901bbc8426a6ee6e205fd96ae9b4baa7947
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.13.12

Release history Release notifications | RSS feed

This release

1.0.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page