modelstudioai/cli

bailian-cli

阿里云百炼 / Aliyun Bailian / DashScope 资源管理与 bl CLI hub: 应用调用与管理(bl flow-agent:调用/创建/更新/发布/删除/复制/版本、工作流画布;旧 bl app call/list 已废弃)、决策模型推理(bl decision)、模型目录/模型列表、用量/额度/配额、免费额度、 工作空间、MCP 市场、pipeline、文件上传、ParseX 文档/音视频解析与字段抽取、Batch 批量推理与 CSV 转换、同步 Batch Chat、consol…

ソースを見る

使い方

  1. インストールコマンドをコピーし、自分の環境へ導入する前にソースを確認します。
  2. 必要なツール、認証情報、対応環境を原文で確認します。
  3. 入力と成果物を指定し、出力を資料と照合します。
npx skills add https://github.com/modelstudioai/cli --skill bailian-cli

開始前の確認

  • 導入にはモデル契約、API枠、ファイルへのアクセス許可は含まれません。
  • スター数や導入数は活動の指標であり、独立した品質・安全性試験ではありません。
リポジトリの原文

見出し、例、コード、表、リンク、参照画像を含む原文を表示しています。

Aliyun Model Studio CLI (bl)

CRITICAL — Before executing, MUST read the shared protocol in [`../bailian-protocol/SKILL.md`](../bailian-protocol/SKILL.md): Provider selection and consent, Version & updates (pre-flight checklist), Call attribution (every Agent `bl` command), Setup & auth, and CLI errors: report an issue. If that protocol file is missing, stop and run `bl skill init`; do not guess auth/consent.

Call attribution: Examples below and in reference/ stay bare bl …. When running a command, wrap it with `bailian-protocol` → Call attribution (bash or PowerShell). One sample for this skill (BAILIAN_SKILL_NAME=bailian-cli; replace codex with this host). When copying commands into a reusable script / template / task definition, switch to the protocol `script` template (never keep `agent`); the sample below is for this-turn inline execution only. Strip attribution when handing a command to the user to paste.

bash
BAILIAN_CALLER_TYPE=agent BAILIAN_CALLER_NAME=codex BAILIAN_SKILL_NAME=bailian-cli BAILIAN_SKILL_VERSION=<metadata.version> bl text chat --message "Write a poem about spring"
Family hub — This skill owns Bailian resource commands and the hub reference/ (apps, usage, auth, config, …). Shared protocol → `../bailian-protocol/SKILL.md` (install the full family with bl skill init). Soft hand-offs by skill name (Read if installed; else bl … --help / prompt bl skill init): bailian-gen (media) · bailian-finetune (training) · bailian-managed-agent (agents.yaml IaC) · bailian-sandbox (Sandbox lifecycle) · bailian-web-search (web search routing) · bailian-knowledge (personal documents in everyday tasks and knowledge workflows). Tasks that need the user’s own historical documents belong to bailian-knowledge; ordinary writing does not itself select a cloud provider. Do not invoke it for ordinary reasoning, coding, writing, translation, summarization, generic research, or image understanding the host agent can complete directly. Install (supported): bl skill init

Command reference (authoritative)

Hub-owned commands, flags, usage strings, and examples are documented in:

Domain skills own their own generated reference trees (soft hand-off — do not require them for hub work):

  • bailian-gen → image / video / speech / omni / vision (fallback: bl image\|video\|speech\|omni\|vision --help)
  • bailian-finetune → dataset / finetune / deploy (fallback: bl dataset\|finetune\|deploy --help)
  • bailian-managed-agent → managed-agent (fallback: bl managed-agent --help)
  • bailian-sandbox → sandbox (fallback: bl sandbox --help)
  • bailian-web-search → web search routing (hub still owns reference/search.md flags; must route via this skill before bl search web)

Auto-generated from the CLI source at build time (pnpm --filter bailian-cli run generate:reference). Before running an unfamiliar command:

  1. Open the owning skill's reference/index.md (if that skill is installed) → Quick index (or By group) to locate the command.
  2. Open the matching reference/<group>.md for Usage, Flags, and Examples.
  3. Run bl <command> --help for the same information in the terminal.

Do not guess flags — use the reference files or --help.


When to use which command

Use this table only after the decision table in `bailian-protocol` has routed the request to bl (class 4, or class 2 after the user picks Bailian). Hub-owned intents only — for media / fine-tune / agents.yaml / Sandbox, soft hand-off to the domain skill.

User intentCommandNotes
Explicit Bailian model chat / text executionbl text chatDefault qwen3.8-max
百炼异步文件批量推理 / CSV 转换bl batch convert / create / list / get / cancel / downloadCSV → JSONL → 异步任务 → 原始结果,可额外导出 CSV;格式样例见 reference/batch.md
百炼单次同步 Batch Chatbl text chat --batch等待单次响应,不创建任务 ID;messages-file 是同一请求的对话上下文,边界见 reference/text.md
Typed decision model inferencebl decisionWorkspace endpoint; returns choice / noul / score values and probabilities, not generated text
Explicit ParseX parsing / structured field extractionbl parsex parse submit / result; bl parsex extract submit / resultWorkspace + API key; submit returns biz_id, result --follow waits. HTTP(S) source URLs; extraction can reuse a parsed document. See reference/parsex.md.
Bailian agent / workflowbl flow-agent callNeeds --app-id
Find app by namebl flow-agent list then bl flow-agent callConsole auth; --type workflow lists workflows
Create / update / publish / delete / copy an appbl flow-agent create / update / publish / delete / copy / get / versionsConsole auth; agent config via --model/--instructions/--config-json; delete needs --yes; see `reference/flow-agent.md`
Workflow canvas read / save / publish / exportbl flow-agent workflow get / save / publish / exportConsole auth; save replaces the whole draft canvas; see `reference/flow-agent.md`
Personal memory / Bailian memory resources→ skill bailian-memoryUser-enabled personal memory; explicit resource operations use bl memory --help as fallback.
Personal documents / Bailian knowledge workflowsRead skill bailian-knowledgeIf missing: bl knowledge --help or bl skill init
Resolve a Console file key / error-report URLbl file urlConsole auth; use the returned business file key, not a file ID or upload URI. Resolves only; no download or fixed expiry. Existing URLs need no resolution.
Upload a file as a step of a Bailian workflowbl file uploadWhen you need oss:// URL explicitly; not for generic hosting
Bailian model selection / recommendationbl advisor recommendIntent → candidate recall → LLM ranking
Bailian model catalog / pricing / paramsbl model listNo auth (public catalog); --model <family> for detail, --enrich for input params
Find a model by keyword / modalitybl model searchWeighted ranking; --input-modality / --output-modality; offline models hidden by default
SDK sample code for calling a modelbl model code`--sdk openai\dashscope, --lang`; text output is the snippet alone, safe to redirect
Install / list / update / remove registry skillsbl skill add / list / update / removeBailian skill registry; see `reference/skill.md`
Bailian MCP marketplace discovery / callbl mcp list / tools / call—
Register or remove a Bailian MCP in an Agentbl mcp connect / disconnectCodex, Claude Code, Cursor, Qoder, Qoder Work, QwenWork, Qwen Code, Gemini, OpenCode, OpenClaw, DeepSeek Harness, ZCode, WorkBuddy
Bailian pipeline workflow (a step in a bl flow)bl pipeline run / validateJSON/YAML workflow definitions
Bailian rate limits / quotabl quota list / check / requestConsole auth; class 2 — ask which product first if unnamed
Bailian free tier / usage statsbl usage free / stats / freetierConsole auth; class 2 — ask which product first if unnamed
Bailian Token Plan quota usagebl usage token-planConsole auth; class 2 — ask which product first if unnamed
Token Plan harness entitlement quotabl token-plan harness-quotaConsole auth; issued quota usage + still-issuing harnesses
Bailian Coding Plan quota usagebl usage coding-planConsole auth; class 2 — ask which product first if unnamed
Model monitoring (calls, latency, errors, delivery)bl monitor overview / models / metrics / errors / delivery *Console auth; see `reference/monitor.md`
Model call logs / tracesbl log audit * / bl log inference * / bl log status / bl log trace *Console auth; audit and inference logs have separate APIs and switches; see `reference/log.md`
Model alert rules / templates / historybl alert list / create / update / delete / enable / disable / history / metrics / template *Console auth; contacts are managed in the CloudMonitor console; see `reference/alert.md`
Console API (advanced)bl console callConsole auth
Bailian workspace listingbl workspace listConsole auth
Switch CLI Help / Quick Start languagebl config set --key language --value zh-CNUse en-US to switch back; follows the active config profile
Image / video / speech / omni / vision→ skill bailian-genFallback: `bl image\video\speech\omni\vision --help`
Training dataset / fine-tune / deploy→ skill bailian-finetuneFallback: `bl dataset\finetune\deploy --help`
agents.yaml IaC / managed-agent sessions→ skill bailian-managed-agentFallback: bl managed-agent --help; apply/destroy need --yes after plan
Bailian Sandbox instance / template lifecycle→ skill bailian-sandboxFallback: bl sandbox --help
Web search (mode-aware routing)→ skill bailian-web-searchDefault model mode vs explicit --mode mcp + fallback; fallback: bl search web --help

Flags, usage, and examples: see hub `reference/` or bl <command> --help — do not guess flags. Domain command details live in the owning skill's reference/. Examples in reference/ stay bare; wrap with Call attribution when running.


Quick examples

bash
bl text chat --message "Write a poem about spring in Chinese"
bl decision --workspace-id <id> --state "Is this requesting a refund?" --questions '{"refund":{"type":"noul"}}'
bl flow-agent list --output json
bl flow-agent call --app-id <code> --prompt "Hello"
bl flow-agent create --name "My agent" --model qwen3-max
bl usage stats
bl model list --model qwen

More examples per command: see reference/<group>.md (e.g. `reference/text.md`, `reference/flow-agent.md`).


Agent workflows

Find and call an app

  1. bl flow-agent list --name <keyword> --output json
  2. Pick code (app ID); handle user_prompt_params via --biz-params '{"key":"value"}'
  3. bl flow-agent call --app-id <code> --prompt "..."

Create and configure an app

  1. bl flow-agent create --name <name> [--type workflow] --output json → returns app_code
  2. Agent: bl flow-agent update --app-id <code> --model <model> --instructions "..." (reads the draft, merges, writes)
  3. bl flow-agent publish --app-id <code> to release; bl flow-agent get --app-id <code> to inspect
  4. Workflow canvas: bl flow-agent workflow get --app-id <code> --output-file canvas.json → edit → bl flow-agent workflow save --app-id <code> --config-file canvas.json → bl flow-agent workflow publish --app-id <code>
bl app call / bl app list are deprecated aliases of bl flow-agent call / bl flow-agent list; the rest of the app group moved to flow-agent.

Batch 文件工作流

  1. 文件推理统一使用异步任务。读取 reference/batch.md 的数据样例;CSV 用 bl batch convert 构造,已有标准 Batch JSONL 可直接使用。
  2. batch create --dry-run 完整校验;确认模型、数据上传和费用后创建任务。create 上传/提交后返回任务 ID,不等待完成。
  3. 用返回的 ID 执行 batch get --follow 等待终态,再 batch download --csv 下载。Ctrl-C 仅结束本地等待;JSONL 为保真产物,CSV 为有损展示。下载部分失败保留原文件,确认目标后按提示用 --force 恢复。

单次同步推理使用 text chat --batch,通过 message 或 messages-file 提供同一请求的对话上下文,不用于独立请求文件;命令等待该次响应,不创建任务 ID。Batch 不适用于 Token Plan;显式 Batch/自定义代理使用现有解析凭证,不推断 Key 类型。端点、请求超时及互斥参数见 reference/text.md。

Command metadata for agents

Use the owning skill's `reference/index.md` (or sibling skill reference trees), the matching reference/<group>.md, and bl <command> --help as the command schema surface. Do not call removed schema-export commands.


Routing reminders

  • Image/video/audio generation or editing → skill bailian-gen (class 3 consent from bailian-protocol). Fine-tuning / datasets / deployments → bailian-finetune. agents.yaml IaC → bailian-managed-agent. Soft hand-off: Read sibling skill if installed; else bl … --help or prompt bl skill init. Image understanding the host agent can do → host-first; use bl vision / bl omni only when the user names a Bailian model or the media (video/audio files) exceeds host capability.
  • Web search inside a Bailian workflow → skill bailian-web-search (routing: default bl search web model mode for every identity; explicit --mode mcp for regular keys; MCP failure → fall back once). Generic web research the host can do stays host-first — do not bounce it through bl.
  • Answer ordinary reasoning, coding, writing, translation, summarization, and generic research with the host agent's native capabilities; do not bounce them through bl text chat or bl search web.
  • Usage / quota / credits questions that do not name a product → ask which product (Bailian or another AI service) first; run bl usage / bl quota only after the user picks Bailian or Bailian context is already established.
  • Personal recall, new long-term personal facts, and "remember this" requests → read bailian-memory if installed to check enablement, including first-use onboarding. Once enabled, use it for authorized personal recall/extraction; installation alone does not authorize cloud uploads. If unavailable or declined, respect the user’s host-memory choice. Explicit Bailian memory resource operations also route to bailian-memory.
  • bl file upload and bl pipeline run are steps inside a Bailian workflow; do not use them to capture generic "upload this file" or "run a pipeline" requests.
  • For risk: high commands or requires_confirmation, follow the shared protocol; never add --yes automatically.
  • bl managed-agent apply / destroy have an additional domain rule: run plan first and show the diff before asking for confirmation.
  • When a matched bl command accepts a file URL, pass local paths directly; never require the user to host the file first.
  • Console login → use bl auth login --console for China; add --console-site international for the international site. It may create an ordinary API Key. Token Plan and other subscription plans must use bl auth login --api-key <key>. See `../bailian-protocol/assets/setup.md`.
同じリポジトリから

関連する Skills

すべての Skills
modelstudioai
コミュニティ

bailian-opd

Guided end-to-end pure Model OPD distillation (pgopd) on Alibaba Cloud Bailian: authorize → dataset validate → parameter probes → dry-run consent gate → confirmed submit → verified terminal state, driven by deterministic scripts. Use when the user wants to distill a student model from a teacher model (teachermodel / OPD / 蒸馏 / 在线蒸馏) and run the whole creation chain safely. Not for RL / agentic rollout training, SFT/DPO/CPT fine-tuning, or deployment (those go to bailian-finetune); not for model

1時間の導入数
1
GitHub Stars
371
更新日
11月20日
modelstudioai
コミュニティ

bailian-finetune

阿里云百炼模型精调训练入口:用户要精调、微调、训练自己的模型(fine-tune,支持 SFT / SFT-LoRA / DPO / DPO-LoRA / CPT, 覆盖文本、语音、图像)、校验或上传训练数据集、看训练进度和日志、挑 checkpoint、导出精调产物、 把专属模型部署成服务时使用 bl dataset / bl finetune / bl deploy。链路是 validate 校验数据 → upload 拿 file-id → finetune create 建任务 → watch 看进度 → export 导出 → 可选 compress 量化压缩 → deploy 上线,需要 API key; Console 版本状态与独立部署服务查询使用 Console 鉴权。 写操作先用 --dry-run 预览。反触发:用户点名火山方舟/ark 的精调不走本 skill;只是要选哪个模型走 bailian-model-recommend;用现成模型生图生视频走 bailian-gen;百炼其他资源管理走 bailian-cli。 官方安装:bl skill init(与共

1時間の導入数
4
GitHub Stars
372
更新日
11月13日
modelstudioai
コミュニティ

bailian-gen

阿里云百炼图片/视频/语音生成与理解入口:用户要生图、画图、生成照片、生成图片、AI 绘画、海报、头像、插画、 文生图(text-to-image)、图生图、改图、修图、多图合成、生成视频、文生视频、图生视频、参考生视频、视频编辑、风格转换、 配音、语音合成(TTS)、朗读、转写、语音识别(ASR),或图片理解、看图问答、视频理解、读视频、多模态理解时使用 bl image / bl video / bl speech / bl vision describe / bl omni。 默认行为:用户未指定服务商时,生成/编辑默认走本技能;视频理解与宿主放不了的音视频理解也走本技能。 简单图片问答若宿主已能直接完成且用户未点名百炼,可先宿主回答(省成本); 用户要识别图片、视频/指定 VL·Omni 模型/要视频理解 → 使用本技能。 图片和语音同步返回并落地本地文件,视频是异步任务、用 --download 或轮询取回;本地文件直接传路径,CLI 自动上传。 反触发:普通问答、编程、写作、翻译不走本技能;百炼应用/知识库/用量/额度走 bailian-cli; 精调训练走 bailian

1時間の導入数
4
GitHub Stars
372
更新日
11月13日
modelstudioai
コミュニティ

bailian-knowledge

个人资料接入与知识库使用。当任务需要参考用户自己的历史文档、客户资料、旧方案、会议记录或学习材料时使用, 如“参考以前的资料准备会议”“照旧方案写一版”“之前为什么这样决定”;不要求用户说“知识库”或点名百炼。 用户希望一批资料以后反复使用,或要求接入、更新、查看、暂停、恢复、清理资料库时也使用。 也处理明确的 bl knowledge / kscli 资源操作。纯通用问答、仅总结当前附件、无历史资料需要的写作不触发; 个人偏好与聊天记忆属于 bailian-memory,钉钉文档管理、模型选型与微调不属于本 Skill。

1時間の導入数
4
GitHub Stars
372
更新日
11月13日