cli-anything-anygen
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesecli-anything-anygen
cli-anything-anygen
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.
这是一款基于AnyGen OpenAPI的有状态命令行界面(CLI),可通过自然语言提示生成专业幻灯片、文档、网站、图表等多种内容,专为AI Agent和高级用户设计。
Installation
安装
This CLI is installed as part of the cli-anything-anygen package:
bash
pip install cli-anything-anygenPrerequisites:
- Python 3.10+
- anygen must be installed on your system
该CLI作为cli-anything-anygen包的一部分进行安装:
bash
pip install cli-anything-anygen前提条件:
- Python 3.10+
- 系统中必须已安装anygen
Usage
使用方法
Basic Commands
基础命令
bash
undefinedbash
undefinedShow help
显示帮助信息
cli-anything-anygen --help
cli-anything-anygen --help
Start interactive REPL mode
启动交互式REPL模式
cli-anything-anygen
cli-anything-anygen
Create a new project
创建新项目
cli-anything-anygen project new -o project.json
cli-anything-anygen project new -o project.json
Run with JSON output (for agent consumption)
以JSON格式输出(供Agent调用)
cli-anything-anygen --json project info -p project.json
undefinedcli-anything-anygen --json project info -p project.json
undefinedREPL Mode
REPL模式
When invoked without a subcommand, the CLI enters an interactive REPL session:
bash
cli-anything-anygen当不指定子命令调用时,CLI会进入交互式REPL会话:
bash
cli-anything-anygenEnter commands interactively with tab-completion and history
交互式输入命令,支持自动补全和历史记录
undefinedundefinedCommand Groups
命令组
Task
任务(Task)
Task management — create, poll, download, and run tasks.
| Command | Description |
|---|---|
| Create a generation task |
| Query task status (non-blocking) |
| Poll task until completion (blocking) |
| Download the generated file for a completed task |
| Download thumbnail image for a completed task |
| Full workflow: create, poll, download |
| List locally cached task records |
| Multi-turn requirement analysis before creating a task |
任务管理——创建、轮询、下载和运行任务。
| 命令 | 描述 |
|---|---|
| 创建生成任务 |
| 查询任务状态(非阻塞) |
| 轮询任务直至完成(阻塞) |
| 下载已完成任务的生成文件 |
| 下载已完成任务的缩略图 |
| 完整工作流:创建、轮询、下载 |
| 列出本地缓存的任务记录 |
| 创建任务前的多轮需求分析 |
File
文件(File)
File operations — upload reference files.
| Command | Description |
|---|---|
| Upload a reference file to get a file_token |
文件操作——上传参考文件。
| 命令 | 描述 |
|---|---|
| 上传参考文件以获取file_token |
Config
配置(Config)
Configuration management — API key and settings.
| Command | Description |
|---|---|
| Set a configuration value |
| Get a configuration value (or show all) |
| Delete a configuration value |
| Show the config file path |
配置管理——API密钥和设置。
| 命令 | 描述 |
|---|---|
| 设置配置值 |
| 获取配置值(或显示所有配置) |
| 删除配置值 |
| 显示配置文件路径 |
Session
会话(Session)
Session management — history, undo, redo.
| Command | Description |
|---|---|
| Show session status |
| Show command history |
| Undo last command |
| Redo last undone command |
会话管理——历史记录、撤销、重做。
| 命令 | 描述 |
|---|---|
| 显示会话状态 |
| 显示命令历史 |
| 撤销上一条命令 |
| 重做上一条已撤销的命令 |
Examples
示例
Create a New Project
创建新项目
Create a new anygen project file.
bash
cli-anything-anygen project new -o myproject.json创建新的anygen项目文件。
bash
cli-anything-anygen project new -o myproject.jsonOr with JSON output for programmatic use
或以JSON格式输出供程序化调用
cli-anything-anygen --json project new -o myproject.json
undefinedcli-anything-anygen --json project new -o myproject.json
undefinedInteractive REPL Session
交互式REPL会话
Start an interactive session with undo/redo support.
bash
cli-anything-anygen启动支持撤销/重做功能的交互式会话。
bash
cli-anything-anygenEnter commands interactively
交互式输入命令
Use 'help' to see available commands
使用'help'查看可用命令
Use 'undo' and 'redo' for history navigation
使用'undo'和'redo'导航历史记录
undefinedundefinedState Management
状态管理
The CLI maintains session state with:
- Undo/Redo: Up to 50 levels of history
- Project persistence: Save/load project state as JSON
- Session tracking: Track modifications and changes
该CLI通过以下方式维护会话状态:
- 撤销/重做:最多支持50级历史记录
- 项目持久化:以JSON格式保存/加载项目状态
- 会话跟踪:跟踪修改和变更
Output Formats
输出格式
All commands support dual output modes:
- Human-readable (default): Tables, colors, formatted text
- Machine-readable (flag): Structured JSON for agent consumption
--json
bash
undefined所有命令支持两种输出模式:
- 人类可读格式(默认):表格、颜色、格式化文本
- 机器可读格式(参数):结构化JSON,供Agent调用
--json
bash
undefinedHuman output
人类可读输出
cli-anything-anygen project info -p project.json
cli-anything-anygen project info -p project.json
JSON output for agents
供Agent使用的JSON输出
cli-anything-anygen --json project info -p project.json
undefinedcli-anything-anygen --json project info -p project.json
undefinedFor AI Agents
面向AI Agent的使用说明
When using this CLI programmatically:
- Always use flag for parseable output
--json - Check return codes - 0 for success, non-zero for errors
- Parse stderr for error messages on failure
- Use absolute paths for all file operations
- Verify outputs exist after export operations
程序化使用该CLI时:
- 始终使用参数以获得可解析的输出
--json - 检查返回码——0表示成功,非0表示错误
- 解析stderr以获取失败时的错误信息
- 所有文件操作使用绝对路径
- 导出操作后验证输出是否存在
More Information
更多信息
- Full documentation: See README.md in the package
- Test coverage: See TEST.md in the package
- Methodology: See HARNESS.md in the cli-anything-plugin
- 完整文档:查看包中的README.md
- 测试覆盖率:查看包中的TEST.md
- 方法学:查看cli-anything-plugin中的HARNESS.md
Version
版本
1.0.0
1.0.0