anycap-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

AnyCap CLI

AnyCap CLI

One CLI. Any capability.
You can reason, plan, and decide -- but you cannot generate images, produce video, compose music, speak, search the web, or crawl pages on your own. AnyCap gives you all of these through a single command-line tool. One binary. One auth. Structured I/O.
一个CLI,解锁所有能力。
你可以进行推理、规划、决策,但无法自行生成图片、制作视频、创作音乐、生成语音、搜索网页或者爬取页面。AnyCap通过单个命令行工具为你提供所有这些能力:单二进制文件、统一身份认证、结构化输入输出。

Install

安装

bash
curl -fsSL https://anycap.ai/install.sh | sh
The CLI auto-updates on each run. To update manually:
anycap update
.
Verify the installation:
bash
anycap status
bash
curl -fsSL https://anycap.ai/install.sh | sh
CLI每次运行时会自动更新。手动更新命令:
anycap update
验证安装是否成功:
bash
anycap status

Authentication

身份验证

Three methods, depending on environment:
bash
undefined
根据运行环境可选择三种验证方式:
bash
undefined

Interactive (default) -- opens browser

交互模式(默认)——打开浏览器完成验证

anycap login
anycap login

Headless (SSH, containers) -- device code flow

无界面模式(SSH、容器场景)——设备码验证流程

anycap login --headless
anycap login --headless

Headless for agent/toolcall runtimes -- initialize without blocking

面向Agent/工具调用运行时的无界面模式——非阻塞初始化

anycap login --headless --no-wait --json
anycap login --headless --no-wait --json

Resume a previously initialized headless login after the user confirms completion

用户确认完成登录后,恢复之前初始化的无界面登录流程

anycap login poll --session <login_session_id> --json --wait
anycap login poll --session <login_session_id> --json --wait

CI/CD -- pipe API key from stdin

CI/CD场景——从标准输入传入API密钥

echo "$ANYCAP_API_KEY" | anycap login --with-token

Alternatively, set the `ANYCAP_API_KEY` environment variable directly -- the CLI reads it without requiring `login`.

For agent/toolcall usage, prefer the nonblocking headless flow:

1. Run `anycap login --headless --no-wait --json`
2. Read `verification_uri`, `user_code`, `poll_command`, and `next_action_hint`
3. Show the URL and code to the human
4. Ask the human to reply when browser login is complete
5. After confirmation, run `poll_command`

To check current auth state: `anycap status`.

Read [references/cli-reference.md](references/cli-reference.md) for full details on credential management and logout.
echo "$ANYCAP_API_KEY" | anycap login --with-token

你也可以直接设置`ANYCAP_API_KEY`环境变量,CLI会自动读取该变量,无需执行`login`命令。

针对Agent/工具调用场景,推荐使用非阻塞无界面验证流程:

1. 执行`anycap login --headless --no-wait --json`命令
2. 读取返回结果中的`verification_uri`、`user_code`、`poll_command`和`next_action_hint`字段
3. 将验证URL和用户码展示给人类用户
4. 等待人类用户确认浏览器端登录完成
5. 收到确认后,执行返回的`poll_command`命令

查看当前认证状态:`anycap status`。

完整的凭证管理和登出说明请查看 [references/cli-reference.md](references/cli-reference.md)。

Configuration

配置

Config file:
~/.anycap/config.toml
. Manage via
anycap config
subcommands.
bash
anycap config show             # show all values
anycap config set <key> <val>  # set a value
anycap config get <key>        # get a value
anycap config unset <key>      # reset to default
Key settings:
endpoint
(server URL),
auto_update
(default true),
feedback
(default true).
Read references/cli-reference.md for all available keys and environment variable overrides.
配置文件路径:
~/.anycap/config.toml
,可通过
anycap config
子命令管理配置。
bash
anycap config show             # 展示所有配置项
anycap config set <key> <val>  # 设置配置项
anycap config get <key>        # 获取配置项值
anycap config unset <key>      # 重置配置项为默认值
核心配置项:
endpoint
(服务端URL)、
auto_update
(默认开启自动更新)、
feedback
(默认开启反馈上报)。
所有可用配置项和环境变量覆盖规则请查看 references/cli-reference.md

Capabilities

能力模块

AnyCap capabilities are organized into two groups: generation (create new content) and actions (AI operations on existing content).
AnyCap的能力分为两大类:生成类(创建新内容)和动作类(对现有内容执行AI操作)。

Generation Workflow

生成类能力使用流程

Capabilities follow a three-step pattern. Each capability (image, video, music) supports one or more operations (e.g.,
generate
,
edit
) as CLI subcommands:
1. Discover models    anycap {cap} models
2. Check schema       anycap {cap} models <model> schema [--operation <op>] [--mode <mode>]
3. Run operation      anycap {cap} {operation} --model <model> [--mode <mode>] --prompt "..."
Operations are the top-level actions (generate, edit, etc.). Which operations a model supports is defined in the catalog.
Modes describe the input/output modality within an operation (e.g.,
text-to-image
,
image-to-image
). When only one mode exists, it is inferred automatically.
Generated files are auto-downloaded to the current directory. Always use
-o
with a descriptive filename (e.g.,
-o hero-banner.png
).
Local file upload: For parameters that accept files (e.g., reference images), pass a local file path directly. The CLI auto-uploads it. If a file does not exist, the CLI returns an error.
bash
undefined
所有生成类能力遵循三步使用模式,每个能力(图片、视频、音乐)都支持一个或多个操作(如
generate
生成、
edit
编辑)作为CLI子命令:
1. 查看可用模型    anycap {cap} models
2. 查看参数Schema  anycap {cap} models <model> schema [--operation <op>] [--mode <mode>]
3. 执行对应操作    anycap {cap} {operation} --model <model> [--mode <mode>] --prompt "..."
操作指顶层动作(生成、编辑等),模型支持的操作列表已在目录中定义。
模式定义了单个操作内的输入输出模态(如
text-to-image
文生图、
image-to-image
图生图),如果仅存在一种模式会自动推断,无需手动指定。
生成的文件会自动下载到当前目录,建议始终使用
-o
参数指定有意义的文件名(如
-o hero-banner.png
)。
本地文件上传: 对于需要传入文件的参数(如参考图),直接传入本地文件路径即可,CLI会自动完成上传,如果文件不存在会返回报错。
bash
undefined

Instead of constructing a JSON URL array:

无需手动构造JSON URL数组:

--param images='["https://example.com/photo.jpg"]'

--param images='["https://example.com/photo.jpg"]'

Just pass the local path:

直接传入本地路径即可:

--param images=/path/to/photo.png

| Capability | Reference                                             | Operations         | Typical duration |
| ---------- | ----------------------------------------------------- | ------------------ | ---------------- |
| Image      | [generation.md](references/generation.md)             | `generate`, `edit` | 5-30s            |
| Video      | [video-generation.md](references/video-generation.md) | `generate`         | 30-120s          |
| Music      | [music-generation.md](references/music-generation.md) | `text-to-music`    | 30-90s           |

Music generation may return multiple clips -- use `.outputs[0].local_path` to extract paths.

If your runtime supports async execution, prefer running generation commands in the background. They are self-contained -- block until complete and write the result file locally.

**Actions** -- AI-powered operations on existing content.
Read [references/actions.md](references/actions.md) when you need to understand images, read videos, analyze audio, or perform other AI actions on existing files or URLs.

**Coming soon:**

- Text-to-speech / voice synthesis
- Web search and web crawling

Use `anycap feedback --type feature` to request prioritization of upcoming capabilities.

**Download** -- save any remote file locally.

```bash
anycap download <url> [-o path]
--param images=/path/to/photo.png

| 能力类型 | 参考文档 | 支持操作 | 典型耗时 |
| ---------- | ----------------------------------------------------- | ------------------ | ---------------- |
| 图片 | [generation.md](references/generation.md) | `generate`生成、`edit`编辑 | 5-30秒 |
| 视频 | [video-generation.md](references/video-generation.md) | `generate`生成 | 30-120秒 |
| 音乐 | [music-generation.md](references/music-generation.md) | `text-to-music`文生音乐 | 30-90秒 |

音乐生成可能返回多个片段,可通过`.outputs[0].local_path`提取文件路径。

如果你的运行时支持异步执行,推荐在后台运行生成类命令,命令会自动阻塞直到执行完成并将结果文件写入本地。

**动作类能力**——对现有内容执行AI操作。
如果你需要识别图片内容、解析视频、分析音频或者对现有文件/URL执行其他AI操作,请查看 [references/actions.md](references/actions.md)。

**即将上线:**

- 语音合成
- 网页搜索和网页爬虫

你可以执行`anycap feedback --type feature`提交需求,帮助我们调整功能上线优先级。

**下载能力**——将任意远程文件保存到本地。

```bash
anycap download <url> [-o path]

Infrastructure

基础设施

AnyCap provides infrastructure services for agents to host content and store files.
Page Hosting -- deploy static sites to AnyCap's edge network. Read references/page.md when you need to deploy HTML files, static sites, or generated reports. Sites get a unique URL and support versioning, rollback, and badge opt-out.
bash
undefined
AnyCap为Agent提供内容托管和文件存储的基础设施服务。
页面托管——将静态站点部署到AnyCap的边缘网络。 如果你需要部署HTML文件、静态站点或者生成的报告,请查看 references/page.md,部署后的站点会获得唯一URL,支持版本管理、回滚和徽章隐藏。
bash
undefined

Quick deploy (writes anycap.toml for future deploys)

快速部署(会生成anycap.toml配置文件用于后续部署)

anycap page deploy ./dist --name "My Site" --publish
anycap page deploy ./dist --name "我的站点" --publish

Subsequent deploys read site from anycap.toml

后续部署会自动读取anycap.toml中的站点配置

anycap page deploy ./dist --publish

**Drive Storage** -- upload, organize, and share files.
Read [references/drive.md](references/drive.md) when you need to upload files, create folders, or generate share links.

```bash
anycap drive upload result.pdf --parent-path /reports
anycap drive share --src-path /reports/result.pdf
anycap page deploy ./dist --publish

**网盘存储**——上传、管理、分享文件。
如果你需要上传文件、创建文件夹或者生成分享链接,请查看 [references/drive.md](references/drive.md)。

```bash
anycap drive upload result.pdf --parent-path /reports
anycap drive share --src-path /reports/result.pdf

Feedback

反馈

When something goes wrong, or when you have ideas for improvement, submit feedback directly. This helps the AnyCap team prioritize fixes and features.
Feedback is enabled by default. To disable it, run
anycap config set feedback false
or set
feedback = false
in
~/.anycap/config.toml
.
bash
anycap feedback --type bug -m "image generate returned 500 for prompt X" --request-id <id>
anycap feedback --type feature -m "support batch image generation"
anycap feedback --type other -m "schema for model Y is missing aspect_ratio"
Options:
FlagRequiredDescription
--type
yes
bug
,
feature
, or
other
-m, --message
yesDescription of the issue or idea
--request-id
noRequest ID from a previous command (found in JSON output)
--context
noAdditional context as JSON
When to submit feedback:
  • A command returns an unexpected error -- include the
    request_id
    from the response
  • A model produces poor results -- describe the prompt and parameters used
  • A capability is missing or could be improved -- describe the use case
  • The skill instructions are unclear or incomplete
当遇到问题或者有改进建议时,可以直接提交反馈,这会帮助AnyCap团队优先修复问题和开发新功能。
反馈功能默认开启,如需关闭可执行
anycap config set feedback false
,或者在
~/.anycap/config.toml
中设置
feedback = false
bash
anycap feedback --type bug -m "图片生成命令在提示词为X时返回500错误" --request-id <id>
anycap feedback --type feature -m "希望支持批量图片生成"
anycap feedback --type other -m "Y模型的Schema缺少aspect_ratio参数"
参数说明:
参数是否必填说明
--type
可选值:
bug
问题反馈、
feature
功能需求、
other
其他
-m, --message
问题或需求的具体描述
--request-id
之前执行命令返回的请求ID(可在JSON输出中找到)
--context
JSON格式的额外上下文信息
建议提交反馈的场景:
  • 命令返回非预期错误——请附带上返回结果中的
    request_id
  • 模型生成结果不符合预期——请描述使用的提示词和参数
  • 缺少需要的能力或者现有能力可优化——请描述具体使用场景
  • 工具使用说明不清晰或不完整

Output Format

输出格式

All commands produce JSON on stdout. Every response includes a
request_id
field for tracing.
Successful response:
json
{"status": "success", "data": {...}, "request_id": "req_abc123"}
Error response:
json
{"error": "...", "message": "...", "hint": "...", "request_id": "req_abc123"}
Save the
request_id
when submitting feedback about a failed request.
所有命令的标准输出均为JSON格式,每个返回结果都包含
request_id
字段用于链路追踪。
成功响应示例:
json
{"status": "success", "data": {...}, "request_id": "req_abc123"}
错误响应示例:
json
{"error": "...", "message": "...", "hint": "...", "request_id": "req_abc123"}
如果要对失败的请求提交反馈,请保存对应的
request_id

Parsing with jq

使用jq解析输出

All commands return JSON. Use
jq
to extract fields:
bash
undefined
所有命令都返回JSON格式,你可以使用
jq
提取字段:
bash
undefined

Check if a command succeeded

检查命令是否执行成功

anycap status | jq -r '.status'
anycap status | jq -r '.status'

List available model IDs

列出可用的模型ID

anycap image models | jq -r '.models[].model'
anycap image models | jq -r '.models[].model'

List modes for a model

列出模型支持的模式

anycap video models seedance-1.5-pro | jq -r '.model.operations[].modes[].mode'
anycap video models seedance-1.5-pro | jq -r '.model.operations[].modes[].mode'

Get the local file path from a generate response (use -o for a descriptive name)

从生成命令的响应中获取本地文件路径(推荐使用-o指定文件名)

anycap image generate --prompt "..." --model nano-banana-2 -o descriptive-name.png | jq -r '.local_path'
anycap image generate --prompt "..." --model nano-banana-2 -o descriptive-name.png | jq -r '.local_path'

Edit an existing image

编辑现有图片

anycap image edit --prompt "remove the background" --model seedream-5 --param images=./photo.png -o edited.png | jq -r '.local_path'
anycap image edit --prompt "去除背景" --model seedream-5 --param images=./photo.png -o edited.png | jq -r '.local_path'

Generate a video (text-to-video, mode inferred) and get its path

生成视频(文生视频,模式自动推断)并获取文件路径

anycap video generate --prompt "..." --model veo-3.1 -o clip.mp4 | jq -r '.local_path'
anycap video generate --prompt "..." --model veo-3.1 -o clip.mp4 | jq -r '.local_path'

Generate a video with explicit mode (image-to-video, local file auto-uploaded)

指定模式生成视频(图生视频,本地文件自动上传)

anycap video generate --prompt "animate this" --model seedance-1.5-pro --mode image-to-video --param images=./photo.jpg -o animated.mp4 | jq -r '.local_path'
anycap video generate --prompt "让图片动起来" --model seedance-1.5-pro --mode image-to-video --param images=./photo.jpg -o animated.mp4 | jq -r '.local_path'

Generate music and get the first audio path

生成音乐并获取第一个音频文件路径

anycap music generate --prompt "..." --model suno-v5 -o track.mp3 | jq -r '.outputs[0].local_path'
anycap music generate --prompt "..." --model suno-v5 -o track.mp3 | jq -r '.outputs[0].local_path'

Extract content from an action response

从动作类响应中提取内容

anycap actions image-read --url https://example.com/photo.jpg | jq -r '.content'
anycap actions image-read --url https://example.com/photo.jpg | jq -r '.content'

Get the error message on failure

命令失败时提取错误信息

anycap ... | jq -r '.message // empty'
anycap ... | jq -r '.message // empty'

Save request_id for feedback

保存request_id用于后续反馈

REQ_ID=$(anycap image generate --prompt "..." --model seedream-5 | jq -r '.request_id') anycap feedback --type bug -m "describe the issue" --request-id "$REQ_ID"

Common jq patterns:

| Pattern                        | Purpose                                 |
| ------------------------------ | --------------------------------------- |
| `jq -r '.field'`               | Extract a string field (raw, no quotes) |
| `jq -r '.local_path'`          | Get downloaded file path from generate  |
| `jq -r '.models[].model'`      | List all values of a field in an array  |
| `jq -e '.status == "success"'` | Check condition (exit code 1 if false)  |
| `jq -r '.message // empty'`    | Extract error message if present        |
REQ_ID=$(anycap image generate --prompt "..." --model seedream-5 | jq -r '.request_id') anycap feedback --type bug -m "描述具体问题" --request-id "$REQ_ID"

常用jq模式:

| 模式 | 用途 |
| ------------------------------ | --------------------------------------- |
| `jq -r '.field'` | 提取字符串字段(原始格式,无引号) |
| `jq -r '.local_path'` | 从生成结果中获取下载的文件路径 |
| `jq -r '.models[].model'` | 列出数组中指定字段的所有值 |
| `jq -e '.status == "success"'` | 检查条件是否成立(不成立时退出码为1) |
| `jq -r '.message // empty'` | 提取存在的错误信息 |

Keeping Up to Date

版本更新

Check if skills are outdated:
bash
npx -y skills check
Update all installed skills to the latest version:
bash
npx -y skills update
Or re-install this skill directly:
bash
npx -y skills add anycap-ai/anycap -y
You can also check whether this skill file matches your CLI version:
bash
anycap skill check --target <path-to-this-file>
检查已安装的skill是否已过时:
bash
npx -y skills check
将所有已安装的skill更新到最新版本:
bash
npx -y skills update
或者直接重新安装本skill:
bash
npx -y skills add anycap-ai/anycap -y
你也可以检查当前skill文件是否与你的CLI版本匹配:
bash
anycap skill check --target <path-to-this-file>