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"

查看本機登入狀態,不呼叫帳號 API:

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用途
--jsonForce JSON output for parsing
--no-waitStart a generation job and return the prediction ID immediately
--no-downloadPrint result URLs without writing files
--quietSuppress progress text in automation
--params-jsonPass an exact model input object from the model schema
--paramAdd or override one model-specific field

環境變數

Variable說明
ATLAS_API_BASEOverride the API base URL. A trailing /v1 is normalized automatically.
ATLAS_TOKEN_FILEStore the CLI token in a custom file, useful for multiple accounts or CI.
NO_COLORDisable color output.

已知限制

  • 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 可後續作為套件管理器渠道補充。