arkcli-shared
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesearkcli 共享规则
arkcli Shared Rules
本 skill 是 的统一执行协议入口。所有 skill 在执行前都应先读取本文件。
arkcliarkcli-*分层约定:本文正文只放"几乎每个任务都命中"的规则。稀有路径 / 查表类细节下沉到 reference,命中对应场景时再读:
场景 读哪个 "我的 / my xxx" 自指资源过滤 ../arkcli-auth/references/identity-resolution.mdAK/SK 态能调什么 / 数据面 API Key 报错恢复 ../arkcli-auth/references/auth-modes.md开通 / 部署 / 精调前的实名检查 ../arkcli-auth/references/realname-gate.md /+chat/+gen的默认资源与漂移 nudge+deployreferences/profile-defaults.md临时传入 Profile / API Key / Base URL / Endpoint / 模型名 references/execution-context.md版本是否最新 / 刷新版本信息 / 显式升级 arkcli references/update.md全局 flags 速查 references/global-flags.md报错不知归类 / 故障分流 references/troubleshooting.md
This skill is the unified execution protocol entry point for . Every skill should read this file before execution.
arkcliarkcli-*Layering convention: The main body contains only rules that apply to almost every task. Rare paths and lookup-table details are pushed down into references and read only when the corresponding scenario is encountered:
Scenario What to read Identity-based resource filtering for “my / my xxx” ../arkcli-auth/references/identity-resolution.mdWhat can be invoked in AK/SK mode / recovering from a data-plane API Key error ../arkcli-auth/references/auth-modes.mdReal-name verification before provisioning, deployment, or fine-tuning ../arkcli-auth/references/realname-gate.mdDefault resources and drift nudges for /+chat/+gen+deployreferences/profile-defaults.mdTemporarily supplying a Profile / API Key / Base URL / Endpoint / model name references/execution-context.mdChecking whether the version is current / refreshing version information / explicitly upgrading arkcli references/update.mdGlobal flags quick reference references/global-flags.mdClassifying an error / troubleshooting routing references/troubleshooting.md
事实与交付闸门
Facts and Delivery Gates
- 每个最终事实必须对应实际返回、已读取的文档正文或已查看的输入/产物。未看图片时使用“参考图”等中性称呼,不能从文件名、自己填写的 display_name 或生成 prompt 推断物体、颜色和人物;输入参数表达期望,不证明产物已经满足要求。
- 查询覆盖范围与返回状态分开报告:截断、分页未完成或只取部分行时,只能描述已核对部分,不能宣称“全部启用/全部没有”。接口或页面行为必须来自真实契约、官方正文或实际界面,不发明“点击即可复制”等步骤。
- 生成/创建成功以真实终态和返回的产物/资源 ID 为准;本地文件保存、附件提交和最终答复分别验收。已经完成的部分应保留并交付,未完成项准确列出,不能因最后一步失败把全部说成未执行,也不能把中间成功包装为整体完成。
- Every final fact must correspond to an actual response, the body of documentation that was read, or an input/artifact that was viewed. When an image has not been viewed, use a neutral term such as “reference image”; do not infer objects, colors, or people from a filename, a self-entered , or a generation prompt. Input parameters express intent; they do not prove that the artifact meets the requirements.
display_name - Report query coverage separately from return status. If output was truncated, pagination was incomplete, or only some rows were retrieved, describe only the portion that was verified; do not claim that everything is enabled or absent. Interface or page behavior must come from an actual contract, official documentation, or a real interface. Do not invent steps such as “click to copy.”
- Generation or creation is successful only when there is a genuine terminal state and a returned artifact/resource ID. Saving a local file, submitting an attachment, and delivering the final response must be verified separately. Preserve and deliver completed portions, accurately list incomplete items, do not claim that everything was unexecuted merely because the final step failed, and do not present an intermediate success as overall completion.
排障交付:先给证据范围,再给修复分支
Troubleshooting Delivery: Present the Evidence Scope First, Then the Remediation Branches
用户询问调用失败、Key 是否有问题或客户端为何不能用时,最终答复按下面三项组织;有明确原请求证据时直接给对应修复,缺证据时也交付已完成的检查:
- 已验证:列出本次检查的账号/资源、时间、协议与实际结果,仅披露必要的非敏感标识。原请求与本机对照分开;只查状态就写“状态已核对”,只有真实业务调用成功才能写“该次调用成功”。
- 仍未知:点明尚未取得的原客户端 URL、模型、时间或错误,说明它使哪条结论仍不能成立。检查没有复现用户问题时,收口为“本次对照成功,原请求原因尚未定位”,不要把下一步排查对象写成已经确认的根因。
- 下一步:按现有证据给最短的条件分支,使用脱敏后的原请求信息即可核对;没有新请求的成本授权时不追加推理测试。确有原请求与契约或受控复现支持根因时,引用这条证据并给出修复,不机械重复“未知”。
| 实际拿到的证据 | 可交付结论 | 尚不能推出 |
|---|---|---|
| Endpoint Running、Key Active | 查询时的管理状态 | 用户的具体请求成功、历史从未失败 |
| Key LastAccessTime | 接口返回的最近访问时间 | 那次请求成功、之后持续正常、历史故障是临时异常 |
| 本机一组协议/模型/Key 调用成功 | 这组条件下这一次调用成功 | 平台所有链路正常、用户客户端配置一定错 |
| unknown field 错误,原 URL/SDK 调用未提供 | 该请求有字段不兼容信号;按 Chat/Responses 契约给条件修复 | 仅凭字段名锁定用户实际协议、排除模型/SDK/网关差异 |
上述范围核对在发送最终答复时执行,包含开头摘要和结尾;不能正文写“尚未定位”,标题却写“排查完成,根因是本地配置”。
When a user asks why a call failed, whether a Key is problematic, or why a client cannot be used, organize the final response into the following three sections. When clear evidence from the original request is available, directly provide the corresponding fix; when evidence is missing, still deliver the checks that were completed:
- Verified: List the account/resource, time, protocol, and actual result checked in this session, disclosing only necessary non-sensitive identifiers. Keep the original request separate from the local comparison. If only the status was checked, state that the “status has been verified”; only an actual successful business call justifies saying that “this call succeeded.”
- Still unknown: Identify the original client URL, model, time, or error that has not yet been obtained, and explain which conclusion therefore remains unsupported. If the checks did not reproduce the user's issue, conclude with “this comparison succeeded, but the cause of the original request has not yet been identified.” Do not present the next troubleshooting target as a confirmed root cause.
- Next step: Provide the shortest conditional branches supported by the available evidence. Sanitized information from the original request is sufficient for verification. Do not run additional inference tests without authorization for their cost. When the original request and either the contract or a controlled reproduction support the root cause, cite that evidence and provide the fix instead of mechanically repeating that the cause is unknown.
| Actual evidence obtained | Conclusion that can be delivered | What still cannot be inferred |
|---|---|---|
| Endpoint Running, Key Active | The management state at query time | That the user's specific request succeeded or had never failed historically |
| Key LastAccessTime | The most recent access time returned by the API | That the request succeeded, that operation continued normally afterward, or that the historical fault was temporary |
| One local call with a protocol/model/Key succeeded | That this call succeeded under those conditions | That every platform path is healthy or that the user's client configuration must be incorrect |
An | A signal that the request has a field-compatibility issue; provide a conditional fix based on the Chat/Responses contract | The user's actual protocol based on the field name alone, or that model/SDK/gateway differences can be ruled out |
The scope verification above must be performed when sending the final response, including both the opening summary and the conclusion. Do not write “not yet identified” in the body while using a heading such as “Troubleshooting completed; the root cause is local configuration.”
配置与首次使用
Configuration and First Use
- 首次使用或怀疑配置归因(/
--profile/ 全局 flags /ARK_PROFILE谁覆盖谁)不对时,先看.env../arkcli-config/SKILL.md - profile 类写操作(create / use / set-default / keys / models / delete / rename)走
../arkcli-profile/SKILL.md - 看可用资源(endpoint / plan 模型 ID)走
../arkcli-resources/SKILL.md - 首次远端调用前,先看
../arkcli-auth/SKILL.md - 是产品 CLI,不是 OpenAPI Action 浏览器;不要从 Action 名反推命令设计
arkcli - 安装: (公开版)
npm i @volcengine/ark-cli -g - 版本检查与显式升级按需读取 ;
references/update.md的读取、写入与 automatic gate 仍走update.mode../arkcli-config/SKILL.md
- On first use, or when configuration precedence is suspected to be incorrect (/
--profile/ global flags /ARK_PROFILE—which one overrides which), first read.env.../arkcli-config/SKILL.md - Profile write operations (create / use / set-default / keys / models / delete / rename) should use .
../arkcli-profile/SKILL.md - To inspect available resources (Endpoint / Plan model IDs), use .
../arkcli-resources/SKILL.md - Before the first remote call, first read .
../arkcli-auth/SKILL.md - is a product CLI, not an OpenAPI Action browser. Do not infer command design from Action names.
arkcli - Installation: (public release).
npm i @volcengine/ark-cli -g - For version checks and explicit upgrades, read as needed. Reading and writing
references/update.md, as well as the automatic gate, still goes throughupdate.mode.../arkcli-config/SKILL.md
调用归因协议
Invocation Attribution Protocol
当 AI Agent 通过任意 业务 skill 执行 命令时,必须使用下面的单命令环境变量前缀。它既标记调用来源和 owning skill,也冻结本次 Skill workflow 的 CLI 版本:不做隐式 registry 更新检查、不打印更新提示、不在任一子命令结束后调度 automatic apply。人类直接在终端调用 时不要手动补这些变量。
arkcli-*arkcliarkclibash
ARKCLI_NO_UPDATE_NOTIFIER=1 \
ARKCLI_CALLER_TYPE=ai_agent \
ARKCLI_CALLER_NAME=<agent-id> \
ARKCLI_SKILL_NAME=<current-arkcli-skill> \
arkcli <command> ...约定:
- 使用稳定 Agent ID,例如
ARKCLI_CALLER_NAME/codex/claude-code/opencode/openclaw/trae;无法可靠判断时用cursorunknown_agent - 填当前业务 skill 名,例如
ARKCLI_SKILL_NAME/arkcli-gen/arkcli-chat/arkcli-modelsarkcli-deploy - 一般业务 workflow 不要把 填进
arkcli-shared,归因必须落到实际 owning skill;仅当本 skill 直接处理版本检查或显式升级时,它就是 owning skill,使用ARKCLI_SKILL_NAMEARKCLI_SKILL_NAME=arkcli-shared - 的兼容变量名虽然只写了 notifier,但契约覆盖全部隐式更新活动:缓存读取/刷新、提示和 automatic 调度;它不阻止用户明确要求的
ARKCLI_NO_UPDATE_NOTIFIER=1/arkcli updatearkcli update --check - Skill 内每一条 子命令都必须带完整前缀,不能只给第一条加;这样多命令 workflow 从开始到结束都使用同一已安装版本
arkcli - 只给当前命令加前缀,不要 到整个 shell 会话,避免串到后续无关命令
export
When an AI Agent executes an command through any business skill, it must use the following environment-variable prefix for the single command. This both identifies the invocation source and owning skill and freezes the CLI version for the current Skill workflow: no implicit registry update checks, no update notifications, and no automatic apply scheduling after any subcommand completes. Humans invoking directly in a terminal should not manually add these variables.
arkcliarkcli-*arkclibash
ARKCLI_NO_UPDATE_NOTIFIER=1 \
ARKCLI_CALLER_TYPE=ai_agent \
ARKCLI_CALLER_NAME=<agent-id> \
ARKCLI_SKILL_NAME=<current-arkcli-skill> \
arkcli <command> ...Conventions:
- should use a stable Agent ID, such as
ARKCLI_CALLER_NAME/codex/claude-code/opencode/openclaw/trae. Usecursorwhen it cannot be determined reliably.unknown_agent - Set to the current business skill name, such as
ARKCLI_SKILL_NAME/arkcli-gen/arkcli-chat/arkcli-models.arkcli-deploy - A general business workflow should not set to
ARKCLI_SKILL_NAME; attribution must identify the actual owning skill. Only when this skill directly handles a version check or explicit upgrade is it the owning skill, in which case usearkcli-shared.ARKCLI_SKILL_NAME=arkcli-shared - Although the compatibility variable mentions only the notifier, its contract covers all implicit update activity: cache reads/refreshes, notifications, and automatic scheduling. It does not prevent an explicitly requested
ARKCLI_NO_UPDATE_NOTIFIER=1/arkcli update.arkcli update --check - Every subcommand within a Skill must include the complete prefix, rather than adding it only to the first command. This ensures that a multi-command workflow uses the same installed version from start to finish.
arkcli - Prefix only the current command. Do not the variables into the entire shell session, where they could leak into unrelated commands.
export
统一 CLI 与 Profile
Unified CLI and Profile
当前 的产品身份在编译时固定;Profile 只选择该产品内的身份与消耗切面,不能切换产品:
arkclibash
arkcli profile create --type platform --set-default # 新建火山 profile(旧 config init/switch 已 deprecated)
arkcli profile use <name> # 切换默认 profile切换 profile 会联动切换登录身份、API Key、控制面路由等上下文。详细命令树看 。不能从 Profile 的名称或 字段推断、切换当前编译产品。
../arkcli-profile/SKILL.mdtenant只查当前身份/Profile 时,普通 CLI 使用 / ;默认模型与路由使用 并按 Resources Skill 验证。 可能同步远端 Key 并回写本地库存或默认 Key,不能作为常规 Chat/Gen 准入或“不改配置/Key”请求的无副作用查询。显式 Profile 管理任务保留这些命令,但先说明同步影响;不改用 deprecated 绕过限制。此边界同样约束业务 Skill/reference 的旧建议。
只读核对身份与默认资源时,每次 Bash 调用只执行一条 、 或 ;直接检查该命令的原始 JSON 与执行状态。不要用 、管道截断或重定向包装核对命令,避免宿主拒绝或丢失事实来源。若命令被拒绝,报告未完成的核对,不把拒绝推断为账号或资源状态。
arkcli auth statusarkcli auth whoamiarkcli resources list --modality <text|image|video>profile show/list/keys listconfig show/listarkcli auth statusauth whoamiresources list --modality ... --format json; echoThe product identity of the current is fixed at compile time. A Profile only selects an identity and usage lane within that product and cannot switch products:
arkclibash
arkcli profile create --type platform --set-default # 新建火山 profile(旧 config init/switch 已 deprecated)
arkcli profile use <name> # 切换默认 profileSwitching Profiles also switches the login identity, API Key, control-plane routing, and related context. See for the full command tree. The compiled product cannot be inferred or switched based on a Profile's name or field.
../arkcli-profile/SKILL.mdtenantWhen checking only the current identity/Profile, the regular CLI uses / . For the default model and routing, use and validate them according to the Resources Skill. may synchronize remote Keys and write back to the local inventory or default Key, so they cannot be used as side-effect-free queries for regular Chat/Gen access or requests that must not modify configuration or Keys. Retain these commands for explicit Profile management tasks, but first explain their synchronization effects. Do not switch to the deprecated to bypass this restriction. This boundary also applies to older recommendations in business Skills and references.
For read-only verification of identity and default resources, each Bash invocation must execute only one of , , or . Inspect that command's raw JSON and exit status directly. Do not wrap verification commands with , pipeline truncation, or redirection, because the host may reject them or the factual source may be lost. If a command is rejected, report that the verification was not completed; do not infer the account or resource state from the rejection.
arkcli auth statusarkcli auth whoamiarkcli resources list --modality <text|image|video>profile show/list/keys listconfig show/listarkcli auth statusauth whoamiresources list --modality ... --format json; echo命令路由与执行顺序
Command Routing and Execution Order
优先按用户目标判断,而不是按命令名思考:
Prioritize the user's goal rather than reasoning from command names.
先判断执行面:控制面 vs 数据面
First Determine the Execution Plane: Control Plane vs Data Plane
同一个 里,不同命令使用不同凭证和执行面。显式传入不属于该命令的 / 会 fail-fast,不要把它们当通用凭证:
arkcli--api-key--base-url| 功能 | 执行面 | 凭证 / 路由 | 硬约束 |
|---|---|---|---|
| 模型目录、Endpoint、自定义模型、Dataset、精调训练、用量/账单等管理 | 控制面(OpenTOP / BFF) | SSO 派生的 STS( | 不消费数据面 |
| 数据面 | Profile API Key、套餐席位 Key,或显式 | 只做推理/会话调用,不改控制面资源;Plan Key 与 Platform paygo Key 不能互借 |
精调是控制面,不是 Agent Plan 模型调用。/arkcli train finetune *走 SSO/STS;arkcli dataset *明确拒绝train finetune create。训练数据用--api-key/--train-file由 CLI 自动上传到 Ark 托管 TOS,不要把本地路径直接当后端数据地址。SFT/LoRA/DPO/RL 都不要转--validation-file/+chat。+gen
| 用户目标 | 路径 | 关键点 |
|---|---|---|
| 试用模型 / 快速验证效果 | | Plan lane 用模型名;Platform lane 用 Endpoint |
| 专项多模态理解(转写/抽取/字幕/框目标…) | | 有明确产出形态时走 understand,不是 chat |
| 语音合成 / TTS / 配音 / 朗读 | | 火山 Agent Plan 个人版/企业版的 seed-tts-2.0;原生 ASR 使用 `+understand asr/asr-align --audio-protocol ws-bidirectional |
| 正式接入 / 稳定调用 | | 核心资源是 Endpoint,不是 +chat/+gen |
模型精调 / SFT / LoRA / DPO / RL / 训练任务 / | | 控制面 SSO/STS;不是 |
| 排查存量调用 / 看消耗 | | — |
| 本地 AI Agent 集成 | | — |
| 明确查官方文档 / 读取文档 URL / 业务 Skill 缺少产品知识 | | 搜索后读取正文;不替代资源操作、鉴权、诊断和 CLI help |
易混动词路由(避免选错 skill):
- 列 / 绑 / 分 / 轮换席位 APIKey → ;用 / 消耗 / 还剩多少额度 →
arkcli-plansarkcli-usage - profile 写操作(create/use/set-default/keys)→ ;配置排障 / 老 yaml →
arkcli-profilearkcli-config - 开放式带图对话 → ;生成图/视频 →
+chat;有产出形态的理解 →+gen+understand - 语音合成 / TTS / 配音 / 朗读:Agent Plan 个人版/企业版走 的
arkcli-gen,执行前读其+gen --modality audio。该命令使用已绑定 profile 的个人版专属 Key 或企业版席位 Key,不创建 Endpoint。原生 ASR 和打轴使用references/arkcli-gen-audio.md,执行前读取 Understand 的语音 reference。其他广场语音模型只做发现。+understand asr/asr-align --audio-protocol ws-bidirectional|ws-unidirectional
命令选择顺序(始终按此):
- 先用产品命令 或
arkcli <domain> <verb>arkcli +<workflow> - 有对应 reference 文档先读 reference 再执行
- 产品命令确实不覆盖,最后才走 (不要把 Raw API Explorer 当默认入口)
arkcli api - 读操作优先直接执行;写 / 删除 / 切换默认配置前必须确认用户意图
Different commands in the same use different credentials and execution planes. Explicitly passing a / that does not belong to the command will fail fast; do not treat them as universal credentials:
arkcli--api-key--base-url| Capability | Execution plane | Credential / routing | Hard constraints |
|---|---|---|---|
| Model catalog, Endpoint, custom models, Dataset, fine-tuning training, usage/billing, and other management | Control plane (OpenTOP / BFF) | SSO-derived STS ( | Does not consume data-plane |
| Data plane | Profile API Key, plan-seat Key, or an explicit | Only performs inference/session calls and does not modify control-plane resources; Plan Key and Platform paygo Key cannot be used interchangeably |
Fine-tuning is a control-plane operation, not an Agent Plan model call./arkcli train finetune *use SSO/STS.arkcli dataset *explicitly rejectstrain finetune create. Training data is uploaded automatically by the CLI to Ark-managed TOS through--api-key/--train-file; do not pass a local path directly as the backend data address. Do not redirect SFT/LoRA/DPO/RL requests to--validation-file/+chat.+gen
| User goal | Path | Key points |
|---|---|---|
| Try a model / quickly validate results | | The Plan lane uses a model name; the Platform lane uses an Endpoint |
| Specialized multimodal understanding (transcription / extraction / subtitles / object detection, etc.) | | Use understand rather than chat when there is a defined output shape |
| Speech synthesis / TTS / dubbing / read-aloud | | Volcengine Agent Plan personal/enterprise editions provide seed-tts-2.0; native ASR uses `+understand asr/asr-align --audio-protocol ws-bidirectional |
| Production integration / stable invocation | | The core resource is an Endpoint, not |
Model fine-tuning / SFT / LoRA / DPO / RL / training jobs / | | Control-plane SSO/STS; not |
| Troubleshoot existing calls / inspect usage | | — |
| Local AI Agent integration | | — |
| Explicitly search official documentation / read a documentation URL / obtain missing product knowledge for a business Skill | | Search and then read the body; this does not replace resource operations, authentication, diagnostics, or CLI help |
Routing for easily confused verbs (avoid choosing the wrong Skill):
- List / bind / allocate / rotate a seat APIKey → ; use / consume / check the remaining quota →
arkcli-plans.arkcli-usage - Profile write operations (create/use/set-default/keys) → ; configuration troubleshooting / old YAML →
arkcli-profile.arkcli-config - Open-ended conversations with images → ; image/video generation →
+chat; understanding with a defined output shape →+gen.+understand - Speech synthesis / TTS / dubbing / read-aloud: Agent Plan personal/enterprise editions use with
arkcli-gen. Before execution, read its+gen --modality audio. This command uses the personal-edition-exclusive Key bound to the Profile or an enterprise seat Key and does not create an Endpoint. Native ASR and beat alignment usereferences/arkcli-gen-audio.md; before execution, read the Understand speech reference. Other marketplace speech models are only discoverable resources.+understand asr/asr-align --audio-protocol ws-bidirectional|ws-unidirectional
Command selection order (always follow this order):
- First use a product command, , or
arkcli <domain> <verb>.arkcli +<workflow> - If a corresponding reference document exists, read it before execution.
- Only when product commands genuinely do not cover the task, use . Do not treat the Raw API Explorer as the default entry point.
arkcli api - Execute read operations directly. Before write, delete, or default-configuration switch operations, confirm the user's intent.
认证闸门
Authentication Gate
除 、、、 外,默认认为业务命令需要先过认证检查。不要跳过认证检查就连续重试一串业务命令。
arkcli auth ...arkcli profile list/showarkcli +connect listarkcli update ...待授权优先于重新登录。 本轮或用户提供的上一轮状态为 、用户尚未完成授权且没有 code 时,等待用户;不要重新执行任何 、 或原业务命令。可只读检查一次 :若已有所需的有效凭据则恢复原任务; 只说明尚未登录,不表示 pending 过期或丢失,仍须等待。仅收到 CLI 明确的会话过期/不存在错误或用户明确要求重启登录,才重开 Phase 1。
stage=authorize_pendingauth loginconfig initauth statuslogged_in=false- 先运行 ;已登录就继续目标命令
arkcli auth status - 未登录 / 凭证失效:保持当前编译产品,按其认证 Skill 选择登录命令,不靠 Profile 推断或切换产品
- 火山:直接 Bash 执行
arkcli auth login volc-sso - 执行前一句话告知用户"检测到未登录,正在启动 SSO 登录,请在浏览器完成授权";Bash 调用设 (10 分钟);成功后立即回到原始任务,不要停在 auth 结果
timeout=600000 - SSO 同时覆盖控制面 BFF 和数据面,所以默认走 SSO;AK/SK 登录通道 0.1.16 暂关。CI / agent / 沙箱(非 TTY)走 两段式:Phase 1 跑它拿
arkcli auth login --no-browserJSON 里的authorize_pending转发给用户,待其浏览器授权后回粘 base64 授权码,再跑authorize_url完成(细节见arkcli auth login --no-browser --code <授权码>)。不要在非 TTY 直接指望它阻塞等粘贴(旧版会../arkcli-auth/SKILL.md崩)EOF - 启动 SSO 失败(无浏览器 / 失败 / 端口占用 / 超时)→ 不原地重试,把 stderr 原样贴回用户、请其手动在终端登录后回来
open - 登录流程细节、whoami、apikey 选择见
../arkcli-auth/SKILL.md
- 火山:直接 Bash 执行
追加闸门 / 错误恢复(命中才读,避免常驻):
- 命中开通 / 部署 / 精调 / 激活模型(/
+deploy/infer endpoint create/train finetune create)→ 第一步先做实名检查,见models activate../arkcli-auth/references/realname-gate.md - 当前是 AK/SK 态、要判断能调什么,或数据面 API Key 报 401/403/AccessDenied 要恢复 →
../arkcli-auth/references/auth-modes.md - 用户说"我的 / my xxx"要按身份过滤资源 →
../arkcli-auth/references/identity-resolution.md
Except for , , , and , assume that a business command requires an authentication check first. Do not skip the check and then repeatedly retry a sequence of business commands.
arkcli auth ...arkcli profile list/showarkcli +connect listarkcli update ...Pending authorization takes precedence over logging in again. If the current turn or the previous user-provided turn has , the user has not completed authorization, and no code has been provided, wait for the user. Do not run , , or the original business command again. A single read-only check is allowed: if valid credentials are already available, resume the original task. means only that the user is not logged in; it does not mean that the pending authorization expired or was lost, so the wait is still required. Reopen Phase 1 only after receiving an explicit CLI error indicating that the session expired or does not exist, or when the user explicitly requests restarting the login.
stage=authorize_pendingauth loginconfig initauth statuslogged_in=false- First run ; if already logged in, continue with the target command.
arkcli auth status - If not logged in or credentials are invalid, retain the current compiled product and select the login command according to its authentication Skill. Do not infer or switch the product based on a Profile.
- Volcengine: execute directly in Bash.
arkcli auth login volc-sso - Before execution, notify the user in one sentence: “Not logged in detected; starting SSO login. Please complete authorization in your browser.” Set (10 minutes) for the Bash invocation. Immediately return to the original task after success instead of stopping at the authentication result.
timeout=600000 - SSO covers both the control-plane BFF and the data plane, so use SSO by default. The AK/SK login channel is temporarily disabled in 0.1.16. In CI / agent / sandbox environments (non-TTY), use the two-stage flow: in Phase 1, run it and forward the
arkcli auth login --no-browserfrom theauthorize_urlJSON to the user. After the user authorizes in the browser, have them paste the base64 authorization code back, then runauthorize_pendingto complete the flow. Seearkcli auth login --no-browser --code <authorization code>for details. Do not expect the non-TTY command to block while waiting for pasted input in older versions, which crash with../arkcli-auth/SKILL.md.EOF - If SSO startup fails (no browser / failure / port already in use / timeout), do not retry in place. Return stderr to the user verbatim and ask them to log in manually in a terminal and then return.
open - See for login flow details, whoami, and API Key selection.
../arkcli-auth/SKILL.md
- Volcengine: execute
Additional gates / error recovery (read only when triggered to avoid keeping them resident):
- For provisioning, deployment, fine-tuning, or model activation (/
+deploy/infer endpoint create/train finetune create), perform the real-name verification first. Seemodels activate.../arkcli-auth/references/realname-gate.md - When in AK/SK mode and determining what can be invoked, or when recovering from a data-plane API Key 401/403/AccessDenied error, use .
../arkcli-auth/references/auth-modes.md - When the user says “my / my xxx” and resources must be filtered by identity, use .
../arkcli-auth/references/identity-resolution.md
输出规则
Output Rules
- 全局 支持
--format、json、yaml、table、wide、csv、jsonl;脚本场景优先用pretty/json,需要抽字段时配合yaml--transform - 只放结构化结果;解释 / 调试 / 错误都走
stdoutstderr - 消费结构化输出时,禁止先用 /
head/tail/sed -n按行或字节截断再解析。这样既可能破坏 JSON,也会漏掉数组后部的目标项、default 标记或 warning 对应的数据。输出较大时,优先使用命令自己的head -c;没有该 flag 时只把完整 stdout 重定向到文件,再用--output <file>/jq提取所需字段。yq - 首次调用和决定结论的调用不得用 吞掉 stderr;scope 提示、软截断告警和可恢复错误可能只出现在 stderr。
2>/dev/null
- Global supports
--format,json,yaml,table,wide,csv, andjsonl. Preferpretty/jsonin scripts and useyamlwhen fields need to be extracted.--transform - must contain only structured results. Explanations, debugging output, and errors go to
stdout.stderr - When consuming structured output, never truncate it by lines or bytes with /
head/tail/sed -nbefore parsing it. This can corrupt JSON and can omit target items at the end of an array, default markers, or data corresponding to warnings. For large output, prefer the command's ownhead -c. If the flag is unavailable, redirect the complete stdout to a file and then use--output <file>/jqto extract the required fields.yq - Never use to suppress stderr on the first invocation or on an invocation whose result determines the conclusion. Scope hints, soft-truncation warnings, and recoverable errors may appear only on stderr.
2>/dev/null
TTY 表达力
TTY Expressiveness
- 交互终端下,长任务会自动使用 Spinner、Heartbeat、下载/上传字节进度条和阶段标签;这些都是 装饰,不改变 stdout 契约,agent / pipe / CI 下静默降级。
stderr - 需要人读列表/详情时显式使用 (策展列)或
--format table(全列;嵌套结构转 Panel);机器消费继续用--format wide/json/yaml/csv。jsonl - 不要给脚本硬加 UI flag。需要一键关闭所有 TUI 装饰时设置 ;需要单独关闭某类效果时再使用细粒度逃生门:
ARKCLI_NO_TUI=1、ARKCLI_NO_SPINNER、ARKCLI_NO_PROGRESS、ARKCLI_NO_NOTES、ARKCLI_NO_CELEBRATE、ARKCLI_NO_INLINE_IMAGE、ARKCLI_NO_STEPPER、ARKCLI_NO_BADGE、ARKCLI_NO_CALLOUT、ARKCLI_NO_CODE_BLOCK。NO_COLOR - Stepper、Badge、Callout、CodeBlock 等结构化表达组件仅在交互终端生效;脚本 / Agent / 管道环境下通过 或对应
NO_COLOR自动降级为纯文本,不改变 stdout JSON 契约。ARKCLI_NO_* - 长下载、TOS 上传、自动下载、
+gen下载会显示字节进度;命令仍在等待但暂时没有字节时,先看 Spinner/Heartbeat 的 elapsed,不要因短暂无输出重复提交计费任务。gen get - 裸 的 TTY dashboard 会展示 workspace、profile defaults、gallery 占用和带解释的 next actions;Tab 补全覆盖模型、Profile、训练任务和生成任务。
arkcli
- In an interactive terminal, long-running tasks automatically use a Spinner, Heartbeat, upload/download byte progress bars, and stage labels. These are decorations and do not change the stdout contract; they degrade silently in agent, pipe, and CI environments.
stderr - When a human-readable list or detail view is needed, explicitly use (curated columns) or
--format table(all columns; nested structures are converted to Panels). Continue using--format wide/json/yaml/csvfor machine consumption.jsonl - Do not hardcode UI flags into scripts. To disable all TUI decorations at once, set . When disabling only one category of effect, use the corresponding fine-grained escape hatch:
ARKCLI_NO_TUI=1,ARKCLI_NO_SPINNER,ARKCLI_NO_PROGRESS,ARKCLI_NO_NOTES,ARKCLI_NO_CELEBRATE,ARKCLI_NO_INLINE_IMAGE,ARKCLI_NO_STEPPER,ARKCLI_NO_BADGE,ARKCLI_NO_CALLOUT,ARKCLI_NO_CODE_BLOCK.NO_COLOR - Structured presentation components such as Stepper, Badge, Callout, and CodeBlock are active only in interactive terminals. In script, Agent, and pipeline environments, they automatically degrade to plain text through or the corresponding
NO_COLORsetting, without changing the stdout JSON contract.ARKCLI_NO_* - Long downloads, TOS uploads, automatic downloads, and
+gendownloads display byte progress. If a command is still waiting but temporarily has no byte output, inspect the elapsed time shown by the Spinner/Heartbeat. Do not resubmit a billable task merely because there was briefly no output.gen get - The bare TTY dashboard displays the workspace, profile defaults, gallery usage, and next actions with explanations. Tab completion covers models, Profiles, training jobs, and generation jobs.
arkcli
安全规则
Safety Rules
- 禁止输出完整 AK/SK、token、secret
- 写入、删除、切换配置前需要确认用户意图
- 只有已注册 Action 才能通过 调用
arkcli api - 涉及创建 Endpoint、修改 profile、清理凭证等操作时,先看叶子命令 :支持 Client Preview 才能用
--help;不支持时改用只读命令核对并取得明确确认,绝不生成不存在的 flag--dry-run
- Never output a complete AK/SK, token, or secret.
- Confirm the user's intent before writes, deletions, or configuration switches.
- Only registered Actions may be invoked through .
arkcli api - Before creating an Endpoint, modifying a profile, cleaning up credentials, or performing a similar operation, first check the leaf command's . Use
--helponly if Client Preview is supported. Otherwise, verify with a read-only command and obtain explicit confirmation; never invent a flag that does not exist.--dry-run
意图澄清与结构化选择
Intent Clarification and Structured Selection
意图澄清只解决“用户要操作哪个真实目标”,不代替写操作授权。用户目标已经唯一,或可从
本轮输入与当前权威结果安全确定时,不要额外提问。确有歧义时遵守以下硬规则:
- 先做一次最小、有界的只读查询;候选只能来自本轮完整结构化结果,不能从模型记忆、示例或截断输出补全。
- 只允许用用户明确给出的硬约束和产品权威 eligibility 字段过滤候选;相关度排序、展示顺序、推荐语和 Agent 自己的优劣判断都不是硬约束,不得用主观“最合适”把 N 个候选自行收敛成 1 个。
- 按 0 / 1 / N 收敛:0 个时补充一个最关键条件;1 个时复述精确 ID 后继续;N 个且选择会改变远端结果时必须询问用户,并在用户选定前停止,不得进入下游 preview、create、update 或 delete。
- N 个候选优先使用当前宿主提供的结构化选择能力,选项直接携带区分目标所需的真实 ID 与关键字段;可以标注推荐及依据,但推荐不能代替用户选择。通用 Skill 不写死任何宿主工具名,也不重复添加宿主自动提供的自由输入项。
- 宿主没有结构化选择能力时,退化为精简编号列表并要求用户回复精确 ID。用户选定后只沿原 workflow 继续,不重新查询同一批候选。
- 因 N 个候选停机询问时,除让用户选「这次用哪个」,一并给出把它固定下来的方式,让用户还能选
「以后都用它」——该候选集有持久化开关时就说明怎么开:生成类模态默认值走
写当前 profile 的该模态默认值, 下次同类请求不再询问。否则同类请求每次都要重新问一遍,无人值守场景会持续卡住。 这是写操作,只在用户明确同意后执行;询问本身仍按上述规则停机,不要替用户预选。
arkcli profile set-default --modality <image|video> <ep-id>
任务型选型例外:用户要求创建 Managed Agent、未指定主模型时,按 owning
的模型选择流程,允许根据本轮实时资格、详情与用户意图择优并说明依据,
不必仅因候选多于一个就提问。择优不等于把多个候选谎称为唯一候选;明确硬约束必须有
对应版本证据,费用/能力差异实质影响任务且无法安全判断时仍先询问。此例外不允许替换
用户明确模型、切换身份/计费路径或为更新、删除等操作擅选已有资源,也不替代执行授权。
arkcli-agentIntent clarification only resolves which actual target the user wants to operate on; it does not replace authorization for write operations. Do not ask an unnecessary question when the user's goal is already unique or can be safely determined from the current turn and authoritative current results. When genuine ambiguity exists, follow these hard rules:
- First perform one minimal, bounded read-only query. Candidates must come only from the complete structured result in the current turn and must not be supplemented from model memory, examples, or truncated output.
- Candidates may be filtered only by hard constraints explicitly provided by the user and by product-authoritative eligibility fields. Relevance ranking, display order, recommendation wording, and the Agent's own quality judgments are not hard constraints. Do not use a subjective “best choice” to collapse N candidates into one.
- Converge to 0 / 1 / N: with 0 candidates, ask for one additional key constraint; with 1 candidate, restate the exact ID and continue; with N candidates where the choice would change the remote result, ask the user and stop before any downstream preview, create, update, or delete operation.
- When there are N candidates, prefer the host's structured selection capability. Each option should directly include the real ID and key fields needed to distinguish the targets. A recommendation and its rationale may be included, but a recommendation cannot replace the user's selection. A general Skill must not hardcode host tool names or redundantly add free-input options that the host already provides.
- If the host has no structured selection capability, fall back to a concise numbered list and ask the user to reply with the exact ID. After the user selects an option, continue only along the original workflow; do not query the same candidate set again.
- When stopping to ask because there are N candidates, ask which one to use “this time” and also explain how to make it persistent so the user can choose “use it from now on.” When the candidate set has a persistent switch, explain how to enable it: for generated modalities, use to write the current Profile's per-modality default, so subsequent requests of the same type no longer need to ask. Otherwise, every request of the same type will ask again, and unattended scenarios will remain blocked. This is a write operation and must only be executed after the user explicitly agrees. The question itself must still stop execution according to the rules above; do not preselect on the user's behalf.
arkcli profile set-default --modality <image|video> <ep-id>
Task-oriented selection exception: When the user asks to create a Managed Agent but does not specify a primary model, the owning model-selection process may choose based on current real-time eligibility, details, and user intent without asking merely because there is more than one candidate. Selection does not mean falsely claiming that multiple candidates are a single unique candidate. An explicit hard constraint must have corresponding version evidence. If cost or capability differences materially affect the task and cannot be determined safely, ask the user first. This exception does not allow replacing a model explicitly specified by the user, switching identity or billing paths, choosing an existing resource for update or deletion without authorization, or replacing execution authorization.
arkcli-agent二次确认错误处理(human-in-the-loop)
Secondary-Confirmation Error Handling (Human-in-the-Loop)
高危操作(删除资源、变更凭证、产生费用等)需要二次确认。CLI 自动检测环境:交互式终端显示 Y/N 提示;非交互式(Agent 调用)返回 错误、。
ExitValidationtype="requires_confirmation"当 arkcli 返回 且 时:
ExitValidationtype="requires_confirmation"- 不要直接报错给用户 —— 这是正常的二次确认流程
- 调用宿主提供的用户确认能力 —— 提示内容可从 CLI 错误的 字段提取,或通用提示"即将执行高危操作,确认继续吗?"
hint - 用户确认 → 给原命令加 flag 重试
--yes - 用户取消 → 返回"操作已取消"
当前会触发二次确认的命令:、、、、、。后续新增高危命令遵循同一约定。
plans personal rotate-apikeyplans team rotate-apikeymodels activate <model-name>profile delete <profile-name>profile project [<project-name>]config delete <profile-name>High-risk operations (deleting resources, changing credentials, incurring charges, etc.) require secondary confirmation. The CLI automatically detects the environment: an interactive terminal displays a Y/N prompt, while a non-interactive invocation (an Agent call) returns an error with .
ExitValidationtype="requires_confirmation"When arkcli returns an with :
ExitValidationtype="requires_confirmation"- Do not report it directly as an error—this is the normal secondary-confirmation flow.
- Invoke the host's user-confirmation capability—the prompt may be extracted from the CLI error's field, or use the generic prompt “A high-risk operation is about to be executed. Confirm whether to continue?”
hint - If the user confirms, retry the original command with the flag.
--yes - If the user cancels, return “Operation canceled.”
Commands that currently trigger secondary confirmation include: , , , , , and . Newly added high-risk commands should follow the same convention.
plans personal rotate-apikeyplans team rotate-apikeymodels activate <model-name>profile delete <profile-name>profile project [<project-name>]config delete <profile-name>Agent 禁止行为
Prohibited Agent Behaviors
- 不要把 当默认入口
arkcli api - 不要在未检查认证状态前连续重试业务命令
- 不要把中间步骤当最终结果;登录、查模型、切 profile 完成后应回到用户原始任务
- 不要在业务 skill 里重复共享规则;共享规则统一以本 skill(及其 references)为准
- 不要一概声称“试用不需要 Endpoint”:Plan lane 使用模型名,Platform lane 必须使用 Endpoint。按 判断;正式接入仍走
references/execution-context.md+deploy - 广场可搜不证明某语音模型可调用。已实现的 TTS 入口为火山 Agent Plan 个人版/企业版 ;不要把它扩展为 Platform、Coding Plan、Endpoint 或语音模型 usage 能力;原生 ASR 另走
+gen --modality audio的 WS 契约。+understand - 语音生成按 的
arkcli-gen契约;其他未封装语音能力只说明支持边界,不擅自创建资源或改 Key。+gen --modality audio - 不要给业务命令增加临时 Project/Region override;根命令已删除 与
--project-name。持久上下文通过--region管理,单次切换使用arkcli profile create/use。--profile
- Do not use as the default entry point.
arkcli api - Do not repeatedly retry business commands before checking authentication status.
- Do not treat an intermediate step as the final result. After login, model lookup, or a Profile switch, return to the user's original task.
- Do not duplicate shared rules in business Skills. Shared rules are defined centrally by this Skill and its references.
- Do not categorically claim that trials do not require an Endpoint. The Plan lane uses a model name, while the Platform lane requires an Endpoint. Judge according to ; production integration still uses
references/execution-context.md.+deploy - The ability to find a voice model in the marketplace does not prove that it can be invoked. The implemented TTS entry point is Volcengine Agent Plan personal/enterprise . Do not extend it to Platform, Coding Plan, Endpoint, or voice-model usage capabilities. Native ASR follows the separate
+gen --modality audioWS contract.+understand - Voice generation follows the
arkcli-gencontract. For other unwrapped voice capabilities, only describe the supported boundary; do not create resources or change Keys on your own.+gen --modality audio - Do not add temporary Project/Region overrides to business commands. The root command has removed and
--project-name. Manage persistent context through--region, and usearkcli profile create/usefor a one-off switch.--profile
参考
References
- arkcli-auth — 认证状态检查、登录与退出登录;其 放身份解析 / AK-SK 边界 / API Key 恢复 / 实名闸门
references/ - arkcli-config — profile、base-url、region 配置排障
- arkcli-api-explorer — 产品命令未覆盖时的 raw API 兜底入口
- references/profile-defaults.md — profile 默认资源、漂移检测、跨模态
- references/execution-context.md — 五类 Profile × 三种模态、临时 Key/Base URL/Endpoint 组合与 Client Preview 边界
- references/global-flags.md — 常用全局 flags 速查
- references/troubleshooting.md — 故障分流与能力边界
- arkcli-auth — Authentication status checks, login, and logout; its contain identity resolution / AK-SK boundaries / API Key recovery / the real-name gate.
references/ - arkcli-config — Profile, base-url, and region configuration troubleshooting.
- arkcli-api-explorer — Raw API fallback entry point when product commands do not cover a task.
- references/profile-defaults.md — Profile default resources, drift detection, and cross-modality behavior.
- references/execution-context.md — Five Profile types × three modalities, temporary Key/Base URL/Endpoint combinations, and Client Preview boundaries.
- references/global-flags.md — Quick reference for common global flags.
- references/troubleshooting.md — Error routing and capability boundaries.