CLI

安装并使用 Atlas Cloud CLI,在终端里对话、查看模型 Schema、生成图片和视频。

Atlas Cloud CLI 提供 atlas 命令,可在终端或自动化脚本中调用 Atlas Cloud。它支持登录认证、LLM 对话、模型 Schema 查看、图片生成、视频生成和异步任务轮询。

GitHub 仓库:AtlasCloudAI/cli

安装

Homebrew

brew install AtlasCloudAI/tap/atlascloud

Homebrew formula 名称是 atlascloud,安装后的命令仍然是 atlas

npm

npm install -g atlascloud-cli

npm 包是轻量 wrapper,会按当前支持的平台下载对应的预编译 Release 二进制。

Windows PowerShell

irm https://raw.githubusercontent.com/AtlasCloudAI/cli/main/install.ps1 | iex

PowerShell installer 会下载对应的 Windows Release zip,用 checksums.txt 校验,安装 atlas.exe,并默认加入用户 PATH。

macOS / Linux Shell Installer

curl -fsSL https://raw.githubusercontent.com/AtlasCloudAI/cli/main/install.sh | sh

Shell installer 支持 macOS 和 Linux。手动下载请使用 GitHub Releases

验证安装

atlas version

登录认证

先在 Atlas Cloud Console 创建 API Key,然后登录:

atlas auth login

CI 或非交互环境可以用 --token

atlas auth login --token "$ATLASCLOUD_API_KEY"

查看本地登录状态,不调用账号接口:

atlas auth status

当前 CLI 中账号和余额相关命令标记为 upcoming。在服务端账号接口开放前,请先在 Console 中查看账号余额和计费信息。

对话

使用 atlas chat 调用兼容 OpenAI 格式的对话模型:

atlas chat "Explain UUID v7 in two sentences" \
  --model deepseek-ai/DeepSeek-V3-0324

也可以从管道读取输入:

cat error.log | atlas chat "Find the root cause and suggest a fix"

当 stdout 不是 TTY 时,CLI 会自动输出 JSON。也可以显式指定 --json

atlas chat "say only OK" \
  --model deepseek-ai/DeepSeek-V3-0324 \
  --json | jq -r '.choices[0].message.content'

模型

列出和搜索模型:

atlas models list --json
atlas models search deepseek --json

查看模型 Schema:

atlas models get deepseek-ai/DeepSeek-V3-0324 --json
atlas models get google/nano-banana-2/text-to-image --json
atlas models get google/veo3.1/image-to-video --json
atlas models get bytedance/seedance-2.0-fast/image-to-video --json
atlas models get alibaba/wan-2.7/image-to-video --json

当前 models listmodels search 主要覆盖对话模型。部分图片和视频模型即使没有出现在列表中,也可以通过已知 model id 直接使用。媒体模型建议从模型文档中获取 model id,或直接用 atlas models get 查看参数。

生成图片

生成图片并等待完成:

atlas generate image google/nano-banana-2/text-to-image \
  -p "a tiny cat"

立即返回 prediction id,不等待结果:

atlas generate image google/nano-banana-2/text-to-image \
  -p "a tiny cat" \
  --no-wait \
  --json

查询或等待异步任务:

atlas generate get <prediction_id> --json
atlas generate wait <prediction_id> --json --no-download

默认情况下,atlas generate image 会等待任务完成并把输出下载到当前目录。Agent 或脚本只需要 URL 时,建议加 --no-download

生成视频

Image-to-video 模型需要传入图片 URL 或本地文件:

atlas generate video google/veo3.1/image-to-video \
  -p "A cinematic camera push-in" \
  --image "https://example.com/input.png" \
  --resolution 1080p \
  --duration 8 \
  --no-wait \
  --json

后续可以用 atlas generate wait <prediction_id> 轮询任务。

视频模型的 Schema 不完全一致。--image--images--end-image--video--audio--resolution--size--duration 这些常见字段都有一等 flag。新模型或厂商私有字段可以用 --params-json 或重复传入 --param key=value,字段名直接按模型 Schema 写:

atlas generate video google/veo3.1/image-to-video \
  --params-json '{"prompt":"A cinematic camera push-in","image":"https://example.com/input.png","resolution":"1080p","duration":8}' \
  --no-wait \
  --json

Agent 友好用法

脚本和 AI Agent 场景建议优先使用稳定的机器可读输出:

atlas models get google/nano-banana-2/text-to-image --json

atlas generate image google/nano-banana-2/text-to-image \
  -p "a tiny cat" \
  --no-wait \
  --json

atlas generate video google/veo3.1/image-to-video \
  --params-json '{"prompt":"A cinematic camera push-in","image":"https://example.com/input.png","resolution":"1080p","duration":8}' \
  --no-wait \
  --json

atlas generate wait <prediction_id> \
  --json \
  --no-download

推荐 flags:

Flag用途
--json强制输出 JSON,方便解析
--no-wait创建生成任务后立即返回 prediction id
--no-download只输出结果 URL,不写文件
--quiet自动化场景中减少进度文本
--params-json直接传入模型 Schema 对应的完整参数对象
--param增加或覆盖一个模型私有字段

环境变量

变量说明
ATLAS_API_BASE覆盖 API Base URL。末尾 /v1 会自动规范化。
ATLAS_TOKEN_FILE指定 token 存储文件,适合多账号或 CI 场景。
NO_COLOR禁用彩色输出。

已知限制

  • atlas accountatlas auth whoami 在服务端账号接口开放前仍是 upcoming。
  • /v1/models 仍主要面向对话模型时,atlas models list --type imageatlas models list --type video 可能不完整。已知媒体模型请使用 atlas models get MODEL_ID --json
  • install.sh 覆盖 macOS 和 Linux;Windows 请使用 PowerShell installer。Scoop/Winget 可以后续作为包管理器渠道补充。