arkcli-config

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

arkcli config

arkcli config

⚠️ 0.1.16 起命令树迁移:
arkcli config init/list/show/switch/delete
已标记 deprecated,请改用
arkcli profile create/list/show/use/delete
(行为一致 + 新增 profile 切面字段 type/project/owner_trn/available_api_keys)。
arkcli config reset
保留(清整个本地状态,超出单 profile)。0.2.x 删除全部已 deprecated 子命令。
CRITICAL — 开始前 MUST 先用 Read 工具读取
../arkcli-shared/SKILL.md
,其中包含认证闸门、命令选择顺序与共享安全规则
CRITICAL — 配置类写操作前必须确认用户意图。
profile show/list/keys list
可能同步远端 Key 并回写本地库存或默认 Key,不能当作无配置副作用的准入探测。
⚠️ Command tree migration since 0.1.16:
arkcli config init/list/show/switch/delete
have been deprecated; use
arkcli profile create/list/show/use/delete
instead (same behavior + new profile dimension fields type/project/owner_trn/available_api_keys).
arkcli config reset
is retained (clears the entire local state, extending beyond a single profile). All deprecated subcommands will be removed in 0.2.x.
CRITICAL — Before starting, you MUST first use the Read tool to read
../arkcli-shared/SKILL.md
, which contains the authentication gate, command selection order, and shared security rules
CRITICAL — User intent must be confirmed before configuration write operations.
profile show/list/keys list
may synchronize remote Keys and write back to the local inventory or default Key, so they must not be treated as side-effect-free admission probes.

唤起信号(When To Trigger)

Trigger Signals (When To Trigger)

  • 用户提到:
    profile
    、
    base-url
    、
    api-key
    覆盖混乱,或仍在使用已删除的全局
    --region/--project-name
  • 用户现象:同一条业务命令“打到了错误环境/错误 base URL/错误账号”,怀疑是配置来源不一致
  • 用户目标:初始化/更新 profile、切换默认 profile、重置本地配置文件
  • 用户目标:启用、关闭或恢复 arkcli 的自动更新/更新提示策略
  • The user mentions
    profile
    ,
    base-url
    ,
    api-key
    override confusion, or is still using the removed global
    --region/--project-name
  • The same business command “hits the wrong environment/wrong base URL/wrong account,” suggesting inconsistent configuration sources
  • The user wants to initialize/update a profile, switch the default profile, or reset the local configuration file
  • The user wants to enable, disable, or restore arkcli's automatic update/update prompt policy

反唤起信号(When NOT To Trigger)

Non-Trigger Signals (When NOT To Trigger)

  • 用户要解决的是“未登录/401/鉴权失败/没有权限”:先走
    arkcli auth status
    ,必要时转
    ../arkcli-auth/SKILL.md
  • 用户目标是业务功能(models/+chat/+gen/+deploy/usage 等):不要停留在 config,排除配置后回到原任务
  • The user's issue is “not logged in/401/authentication failure/no permission”: first use
    arkcli auth status
    , and if necessary, refer to
    ../arkcli-auth/SKILL.md
  • The user's goal is a business feature (models/+chat/+gen/+deploy/usage, etc.): do not remain in config; after ruling out configuration issues, return to the original task

适用场景

Applicable Scenarios

  • 初始化或更新 profile
  • 查看当前解析后的配置
  • 切换默认 profile
  • 删除单个 profile 或重置整个本地配置
  • 排查为什么业务命令连到了错误环境、错误账号或错误 base URL
  • Initialize or update a profile
  • View the currently resolved configuration
  • Switch the default profile
  • Delete a single profile or reset the entire local configuration
  • Troubleshoot why business commands connect to the wrong environment, account, or base URL

Agent 快速执行顺序

Agent Quick Execution Order

  1. 先遵守 shared 的认证及宿主边界。普通 CLI 的当前身份/Profile 诊断用
    arkcli auth status --format json
    、
    arkcli auth whoami --format json
    ;宿主禁止额外认证探测时,使用宿主已给的上下文,不自行探测。
  2. Chat/Gen 的默认模型和路由用
    arkcli resources list --modality <text|image|video> --format json
    ,按 Resources Skill 区分发现、兼容性和真实调用验证。仅查看默认模型不等于授权发送收费请求。
  3. 切换默认 profile:
    arkcli profile use <name>
  4. 创建 profile:
    arkcli profile create --type=...
    (详见 arkcli-profile 子树,本 skill 不重复)
  5. arkcli config reset
    是破坏性操作(清整个本地配置文件),必须确认用户意图
  6. 更新策略只使用 allowlist 命令:
    arkcli config set update.mode automatic|disabled
  7. 用户明确需要 Profile 详情、清单或 Key 管理时才考虑
    arkcli profile show
    /
    arkcli profile list
    ;执行前说明可能同步并回写 Key。用户要求“不改配置/Key”时不执行它们,也不改用旧
    config show/list
    绕过限制。
  1. First comply with the shared authentication and host-boundary rules. For current identity/Profile diagnostics with the regular CLI, use
    arkcli auth status --format json
    and
    arkcli auth whoami --format json
    . When the host prohibits additional authentication probes, use the context already provided by the host and do not probe independently.
  2. For default models and routing in Chat/Gen, use
    arkcli resources list --modality <text|image|video> --format json
    , distinguishing discovery, compatibility, and actual invocation validation according to the Resources Skill. Merely viewing default models does not authorize sending a billable request.
  3. Switch the default profile:
    arkcli profile use <name>
  4. Create a profile:
    arkcli profile create --type=...
    (see the arkcli-profile subtree for details; this skill does not repeat them)
  5. arkcli config reset
    is destructive (it clears the entire local configuration file), so user intent must be confirmed
  6. For update policy, use only the allowlisted command:
    arkcli config set update.mode automatic|disabled
  7. Only consider
    arkcli profile show
    /
    arkcli profile list
    when the user explicitly needs Profile details, a list, or Key management. Before execution, explain that Keys may be synchronized and written back. If the user requests “no configuration/Key changes,” do not execute these commands, and do not use the old
    config show/list
    commands to circumvent the restriction.

配置归因(优先级)

Configuration Attribution (Priority)

arkcli
的解析优先级(从高到低):
  • Profile 选择:
    --profile
    flag >
    ARK_PROFILE
    环境变量 >
    config.yaml
    的
    default_profile
    > 第一个
    type=platform
    的 profile >
    "default"
    sentinel
  • API Key:
    --api-key
    >
    ARK_API_KEY
    > profile > 同 identity store > 产品
    .env
    兼容值
  • Base URL:
    --base-url
    >
    ARK_BASE_URL
    > profile 自定义值 > 按 Profile 的 Region/Type 派生 > 默认值
  • Region/Project: 由所选 Profile 持有;
    ARK_REGION
    /
    ARK_PROJECT_NAME
    不再覆盖运行时
--api-key/--base-url
仅供数据面命令使用。无 Profile 时必须成对提供;覆盖 Base URL 时也必须显式提供 API Key。控制面/本地命令显式收到这两个 flag 会 fail-fast。
排障时要明确”是谁覆盖了谁”,不要直接猜测。
0.1.16 修正:
--profile
现在优先于
ARK_PROFILE
(对齐 CLI 行业惯例 flag > env > config)。0.1.15 及更早版本是 env > flag,与本规则相反。
arkcli
resolution precedence, from highest to lowest:
  • Profile selection:
    --profile
    flag >
    ARK_PROFILE
    environment variable >
    default_profile
    in
    config.yaml
    > the first profile with
    type=platform
    > the
    "default"
    sentinel
  • API Key:
    --api-key
    >
    ARK_API_KEY
    > profile > the same identity store > product-specific
    .env
    compatibility value
  • Base URL:
    --base-url
    >
    ARK_BASE_URL
    > custom profile value > value derived from the Profile's Region/Type > default value
  • Region/Project: held by the selected Profile;
    ARK_REGION
    /
    ARK_PROJECT_NAME
    no longer override runtime behavior
The
--api-key/--base-url
flags are only for data-plane commands. When no Profile exists, they must be provided together; when overriding Base URL, an API Key must also be explicitly provided. Control-plane/local commands fail fast if they explicitly receive either flag.
When troubleshooting, clearly explain “who overrode whom”; do not guess.
0.1.16 correction:
--profile
now takes precedence over
ARK_PROFILE
, aligning with the CLI industry convention of flag > env > config. In 0.1.15 and earlier versions, env took precedence over flag, which is the opposite of this rule.

证据与结论

Evidence and Conclusions

说明本轮实际检查了什么、哪些来源覆盖仍未验证,不要求复述固定评测词句。
auth whoami
的 Profile 字段是持久切面摘要,不能据此声称临时 API Key/Base URL override 已验证或数据面调用一定成功。缺少证据时明确保留未知,不为补字段执行可能回写配置的命令。路径展示使用
$HOME/...
,不读取凭证文件。
Explain what was actually checked in the current round and which override sources remain unverified; there is no need to repeat fixed evaluation wording. The Profile field in
auth whoami
is a persistent profile-dimension summary and cannot be used to claim that temporary API Key/Base URL overrides have been verified or that a data-plane invocation will necessarily succeed. When evidence is missing, explicitly retain the unknown status and do not run commands that may write back configuration merely to fill in fields. Display paths as
$HOME/...
and do not read credential files.

核心规则

Core Rules

  • 本 skill 负责解释“为什么命令打到了错误环境/错误账号/错误 base URL”,并兼容历史
    config init/list/show/switch/delete
    命令排障语义
  • 常规准入沿
    auth status/whoami
    →
    resources
    ,不把 Profile 管理命令当无副作用查询
  • profile 写操作(create / use / set-default / delete)走
    arkcli profile
    子树
  • arkcli config reset
    负责全量清理;
    arkcli config set update.mode <mode>
    只写更新策略。不要用它写任意 YAML 路径。
  • This skill explains “why a command hit the wrong environment/wrong account/wrong base URL” and maintains compatibility with the troubleshooting semantics of the historical
    config init/list/show/switch/delete
    commands
  • The standard admission path is
    auth status/whoami
    →
    resources
    ; do not treat Profile management commands as side-effect-free queries
  • Profile write operations (create / use / set-default / delete) go through the
    arkcli profile
    subtree
  • arkcli config reset
    is responsible for full cleanup;
    arkcli config set update.mode <mode>
    only writes the update policy. Do not use it to write arbitrary YAML paths.

Guard Checklist(必做)

Guard Checklist (Required)

  • 只读意图:不执行可能回写 Key 的
    profile show/list/keys list
    ;脱敏不等于无副作用,命令名为 show/list 也不等于只读
  • 写操作确认:
    profile use/delete
    与
    config reset
    执行前必须复述影响范围并征得确认
  • 全量清理提醒:
    arkcli config reset
    删除
    config.yaml/config.json
    ,不会清理
    $HOME/.arkcli/.env
    (token)或 identity store;要清理凭证请用
    arkcli auth logout
  • Read-only intent: do not execute
    profile show/list/keys list
    if they may write back Keys; redaction does not mean the absence of side effects, and command names such as show/list do not imply read-only operations
  • Write-operation confirmation: before executing
    profile use/delete
    or
    config reset
    , restate the scope of impact and obtain confirmation
  • Full-cleanup warning:
    arkcli config reset
    deletes
    config.yaml/config.json
    , but does not clear
    $HOME/.arkcli/.env
    (token) or the identity store; use
    arkcli auth logout
    to clear credentials

与其他 skill 的串联

Connections to Other Skills

  • profile 创建 / 切换 / 资源 default 设置 / API Key 管理 → 转
    arkcli-profile
    (推荐)或继续看本 skill 的兼容映射
  • 业务命令失败且怀疑是
    --profile
    、
    --base-url
    、API Key 来源或 Profile 的 Region/Project 不一致时,先转到这里
  • 配置问题排除后,再回到原始业务 skill 继续
  • 配置仍无法解释问题时,再考虑转
    ../arkcli-auth/SKILL.md
    或
    ../arkcli-api-explorer/SKILL.md
  • Profile creation/switching/resource default settings/API Key management → refer to
    arkcli-profile
    (recommended), or continue with this skill's compatibility mapping
  • When a business command fails and
    --profile
    ,
    --base-url
    , API Key source, or the Profile's Region/Project is suspected to be inconsistent, start here
  • After ruling out configuration issues, return to the original business skill
  • If the configuration still cannot explain the problem, then consider referring to
    ../arkcli-auth/SKILL.md
    or
    ../arkcli-api-explorer/SKILL.md

命令一览

Command Overview

命令说明状态
arkcli config reset
删除整个本地配置文件(保留)✅ 活跃
arkcli config set update.mode automatic
显式为当前 exact install 启用 automatic;从非 latest 版本恢复时先安装 latest 再执行✅ 活跃
arkcli config set update.mode disabled
关闭静默自动安装,保留隐式版本检查、更新提示和手工 update✅ 活跃
arkcli profile show [--profile <name>]
查看 Profile;可能同步并回写 Key✅ Profile 管理,替代
config show
arkcli profile list
列出 Profile;可能同步并回写各 Profile 的 Key✅ Profile 管理,替代
config list
arkcli profile use <name>
切换默认 profile✅ 替代
config switch
arkcli profile delete <name>
删除单个 profile✅ 替代
config delete
arkcli profile create --type=...
创建 profile(替代旧
config init
)
✅ 替代
config init
arkcli config init/list/show/switch/delete
旧子命令,0.2.x 移除⚠️ deprecated
公开模式只有
automatic
和
disabled
。
disabled
保留隐式版本检查和更新提示,但绝不静默安装;显式
arkcli update
和
arkcli update --check
也始终可用。缺失
update.mode
和历史配置中的
notify
对外都按
disabled
处理,历史配置中的
notify
继续按
disabled
兼容读取,但不得再建议用户设置
notify
。
Windows、macOS、Linux 的 fail-closed transaction 与六个产品/平台生产 gate 均已开启。stable 全局 npm postinstall 会将安装后版本与 registry 当前
latest
比较:非 latest 持久化
disabled
;当前 latest 不改 mode,已有
automatic
时为新 exact install 换发授权。postinstall 不立即执行版本替换。
CommandDescriptionStatus
arkcli config reset
Deletes the entire local configuration file (command retained)✅ Active
arkcli config set update.mode automatic
Explicitly enables automatic for the current exact install; when restoring from a non-latest version, install latest first✅ Active
arkcli config set update.mode disabled
Disables silent automatic installation while retaining implicit version checks, update prompts, and manual update✅ Active
arkcli profile show [--profile <name>]
View a Profile; may synchronize and write back Keys✅ Profile management, replaces
config show
arkcli profile list
List Profiles; may synchronize and write back Keys for each Profile✅ Profile management, replaces
config list
arkcli profile use <name>
Switch the default Profile✅ Replaces
config switch
arkcli profile delete <name>
Delete a single Profile✅ Replaces
config delete
arkcli profile create --type=...
Create a Profile✅ Replaces
config init
arkcli config init/list/show/switch/delete
Legacy subcommands, removed in 0.2.x⚠️ Deprecated
The only public modes are
automatic
and
disabled
.
disabled
retains implicit version checks and update prompts, but never performs silent installation; explicit
arkcli update
and
arkcli update --check
are always available. Both a missing
update.mode
and the historical
notify
setting behave externally as
disabled
. The historical
notify
setting in legacy configurations continues to be read compatibly as
disabled
, but users must no longer be advised to set
notify
.
The fail-closed transaction and all six product/platform production gates for Windows, macOS, and Linux are enabled. The stable global npm postinstall compares the installed version with the registry's current
latest
: a non-latest version persistently uses
disabled
; the current latest does not change the mode, and when
automatic
already exists, fresh authorization is issued for the new exact install. The postinstall does not immediately perform a version replacement.

新安装 enrollment

New Installation Enrollment

只有能证明“此前没有产品状态目录”且安装版本等于 registry
latest
的 stable 全局 npm 新安装,才默认写入
automatic
并创建绑定当前 exact install 的惰性 pending evidence:
  1. 第一次成功的、符合安全条件的人工业务命令在一个策略事务中完成 pending → grace → active。
  2. 重新检查确认 exact-install consent 已 active 后,该 invocation 即可调度 automatic patch 更新。
由 npm
postinstall
启动的全部 CLI 进程(包括其中的
+connect
)以及用户手工执行的
+connect
都不消耗 enrollment、不做隐式版本检查,也不调度 automatic。AI Skill、CI、非 TTY、Client Preview、
config
、
update
和内部维护命令同样不消耗 enrollment,也不调度 automatic。更新成功后,下一次成功的人工业务命令只在 stderr 显示一次
旧版本 -> 新版本
结果,不修改 stdout 或业务退出码。
当前生产 automatic 按明确产品策略关闭 24/48/72 小时与 10%/50%/100% cohort admission;原 rollout 实现与回归测试仍保留,在线 Probe 仍要求两次独立观测。普通 automatic 仍须满足 exact consent、实时 registry target/SRI/tarball 校验、reservation、退避和全部 staged-apply 安全边界。
每次 npm 重装都不得沿用旧 exact-install receipt。若安装版本等于当前
latest
,不改既有 mode:
automatic
换发新 receipt,
disabled
/ 历史
notify
仍保持关闭。若安装版本不等于
latest
,持久化
disabled
。registry 失败时不改 mode、不发新 receipt;
--ignore-scripts
也不会完成对齐。从非 latest 版本恢复时,先安装 latest,再明确执行
arkcli config set update.mode automatic
。长期锁定版本使用:
bash
arkcli config set update.mode disabled
npm i @volcengine/ark-cli@<exact-version> -g --registry https://registry.npmjs.org
为避免 registry 不可用时的不确定,需要确定锁版时仍建议先执行
arkcli config set update.mode disabled
再安装精确版本。
disabled
位于
$HOME/.arkcli/config.yaml
,安装
@latest
也不会自动改回
automatic
。
arkcli config reset
会尽力撤销 exact consent 后再清配置。npm 解析
@latest
与 postinstall 查询之间恰好发新版时,存在极小概率误判为非 latest 的竞态。
Only a stable global npm new installation for which it can be proven that no product state directory existed previously and that the installed version equals the registry's
latest
defaults to writing
automatic
and creating lazy pending evidence bound to the current exact install:
  1. The first successful manual business command that satisfies the safety conditions completes pending → grace → active in a single policy transaction.
  2. After a recheck confirms that exact-install consent has become active, that invocation can schedule an automatic patch update.
All CLI processes launched by npm postinstall (including +connect) and manually executed +connect commands neither consume enrollment, perform implicit version checks, nor schedule automatic updates. AI Skill, CI, non-TTY, Client Preview, config, update, and internal maintenance commands likewise neither consume enrollment, perform implicit version checks, nor schedule automatic updates. After a successful update, the next successful manual business command displays the old version -> new version result once on stderr, without modifying stdout or the business exit code.
Current production automatic explicitly disables 24/48/72-hour and 10%/50%/100% cohort admission under the defined product policy. The original rollout implementation and regression tests are retained, and the online Probe still requires two independent observations. Ordinary automatic operation must still satisfy exact-install consent, real-time registry target/SRI/tarball verification, reservation, backoff, and all staged-apply safety boundaries.
Every npm reinstallation must not carry over an old exact-install receipt. If the installed version equals the current
latest
, the existing mode is not changed: the
automatic
mode receives a newly issued receipt, while
disabled
/ the historical
notify
mode remains off. If the installed version does not equal
latest
,
disabled
is persisted. A registry failure does not change the mode or issue a new receipt, and
--ignore-scripts
does not complete the alignment. To restore from a non-latest version, first install latest and then explicitly execute
arkcli config set update.mode automatic
. For long-term version locking, use:
bash
arkcli config set update.mode disabled
npm i @volcengine/ark-cli@<exact-version> -g --registry https://registry.npmjs.org
To avoid uncertainty when the registry is unavailable, version locking still requires first executing
arkcli config set update.mode disabled
and then installing the exact version.
disabled
is stored in
$HOME/.arkcli/config.yaml
, and installing
@latest
does not automatically change it back to
automatic
.
arkcli config reset
attempts to revoke exact consent before clearing the configuration. There is an extremely small race condition in which a new version is released exactly between npm resolving
@latest
and the postinstall query, potentially causing a non-latest misclassification.

参考

References

  • references/arkcli-config-init.md
  • references/arkcli-config-profile.md
  • references/evals.md
  • references/arkcli-config-init.md
  • references/arkcli-config-profile.md
  • references/evals.md