arkcli Shared Rules
This skill is the unified execution protocol
entry point for
. Every
skill should read this file before execution.
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.md
|
| What can be invoked in AK/SK mode / recovering from a data-plane API Key error | ../arkcli-auth/references/auth-modes.md
|
| Real-name verification before provisioning, deployment, or fine-tuning | ../arkcli-auth/references/realname-gate.md
|
| Default resources and drift nudges for / / | references/profile-defaults.md
|
| Temporarily supplying a Profile / API Key / Base URL / Endpoint / model name | references/execution-context.md
|
| Checking whether the version is current / refreshing version information / explicitly upgrading arkcli | |
| Global flags quick reference | references/global-flags.md
|
| Classifying an error / troubleshooting routing | references/troubleshooting.md
|
Facts and Delivery Gates
- 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.
- 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
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 error, with no original URL/SDK call provided | 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
- On first use, or when configuration precedence is suspected to be incorrect ( / / global flags / —which one overrides which), first read
../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 .
- is a product CLI, not an OpenAPI Action browser. Do not infer command design from Action names.
- Installation:
npm i @volcengine/ark-cli -g
(public release).
- For version checks and explicit upgrades, read as needed. Reading and writing , as well as the automatic gate, still goes through
../arkcli-config/SKILL.md
.
Invocation Attribution Protocol
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.
bash
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 / / / / / . Use when it cannot be determined reliably.
- Set to the current business skill name, such as / / / .
- A general business workflow should not set to ; 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 use
ARKCLI_SKILL_NAME=arkcli-shared
.
- Although the compatibility variable
ARKCLI_NO_UPDATE_NOTIFIER=1
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 / .
- 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.
- Prefix only the current command. Do not the variables into the entire shell session, where they could leak into unrelated commands.
Unified CLI and Profile
The 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:
bash
arkcli profile create --type platform --set-default # 新建火山 profile(旧 config init/switch 已 deprecated)
arkcli profile use <name> # 切换默认 profile
Switching Profiles also switches the login identity, API Key, control-plane routing, and related context. See
../arkcli-profile/SKILL.md
for the full command tree. The compiled product cannot be inferred or switched based on a Profile's name or
field.
When checking only the current identity/Profile, the regular CLI uses
/
. For the default model and routing, use
arkcli resources list --modality <text|image|video>
and validate them according to the Resources Skill.
profile show/list/keys list
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
resources list --modality ... --format json
. 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.
Command Routing and Execution Order
Prioritize the user's goal rather than reasoning from command names.
First Determine the Execution Plane: Control Plane vs Data Plane
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:
| 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 ( / ); is available | Does not consume data-plane / ; in only serves inference and cannot be used to create training jobs or upload to TOS |
| / / / Managed Agent sessions and files / raw | Data plane | Profile API Key, plan-seat Key, or an explicit (with when needed) | 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. /
use SSO/STS.
explicitly rejects
. Training data is uploaded automatically by the CLI to Ark-managed TOS through
/
; do not pass a local path directly as the backend data address. Do not redirect SFT/LoRA/DPO/RL requests to
/
.
| User goal | Path | Key points |
|---|
| Try a model / quickly validate results | → / (optional) → / | 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 | with | 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 | → → → if none exists, | The core resource is an Endpoint, not / |
| Model fine-tuning / SFT / LoRA / DPO / RL / training jobs / | → | Control-plane SSO/STS; not / , and not through the Agent Plan data plane. Data goes to TOS or is uploaded automatically through |
| 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 → .
- Profile write operations (create/use/set-default/keys) → ; configuration troubleshooting / old YAML → .
- Open-ended conversations with images → ; image/video generation → ; understanding with a defined output shape → .
- Speech synthesis / TTS / dubbing / read-aloud: Agent Plan personal/enterprise editions use with . Before execution, read its
references/arkcli-gen-audio.md
. 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 use +understand asr/asr-align --audio-protocol ws-bidirectional|ws-unidirectional
; before execution, read the Understand speech reference. Other marketplace speech models are only discoverable resources.
Command selection order (always follow this order):
- First use a product command, , or .
- 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.
- Execute read operations directly. Before write, delete, or default-configuration switch operations, confirm the user's intent.
Authentication Gate
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.
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.
- First run ; if already logged in, continue with the target command.
- 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
arkcli auth login volc-sso
directly in Bash.
- 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.
- 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
arkcli auth login --no-browser
flow: in Phase 1, run it and forward the from the JSON to the user. After the user authorizes in the browser, have them paste the base64 authorization code back, then run arkcli auth login --no-browser --code <authorization code>
to complete the flow. See for details. Do not expect the non-TTY command to block while waiting for pasted input in older versions, which crash with .
- 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.
- See for login flow details, whoami, and API Key selection.
Additional gates / error recovery (read only when triggered to avoid keeping them resident):
- For provisioning, deployment, fine-tuning, or model activation ( / / / ), perform the real-name verification first. See
../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
- Global supports , , , , , , and . Prefer / in scripts and use when fields need to be extracted.
- must contain only structured results. Explanations, debugging output, and errors go to .
- When consuming structured output, never truncate it by lines or bytes with / / / before 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 own . If the flag is unavailable, redirect the complete stdout to a file and then use / to extract the required fields.
- 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.
TTY Expressiveness
- 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.
- When a human-readable list or detail view is needed, explicitly use (curated columns) or (all columns; nested structures are converted to Panels). Continue using / / / for machine consumption.
- 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: , , , , , , , , , .
- 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 setting, without changing the stdout JSON contract.
- Long downloads, TOS uploads, automatic downloads, and downloads 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.
- 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.
Safety Rules
- 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 .
- Before creating an Endpoint, modifying a profile, cleaning up credentials, or performing a similar operation, first check the leaf command's . Use only if Client Preview is supported. Otherwise, verify with a read-only command and obtain explicit confirmation; never invent a flag that does not exist.
Intent Clarification and Structured Selection
Intent 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
arkcli profile set-default --modality <image|video> <ep-id>
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.
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.
Secondary-Confirmation Error Handling (Human-in-the-Loop)
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
type="requires_confirmation"
.
When arkcli returns an
with
type="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?”
- If the user confirms, retry the original command with the flag.
- If the user cancels, return “Operation canceled.”
Commands that currently trigger secondary confirmation include:
plans personal rotate-apikey
,
,
models activate <model-name>
,
profile delete <profile-name>
,
profile project [<project-name>]
, and
config delete <profile-name>
. Newly added high-risk commands should follow the same convention.
Prohibited Agent Behaviors
- Do not use as the default entry point.
- 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
references/execution-context.md
; production integration still uses .
- 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 WS contract.
- Voice generation follows the contract. For other unwrapped voice capabilities, only describe the supported boundary; do not create resources or change Keys on your own.
- Do not add temporary Project/Region overrides to business commands. The root command has removed and . Manage persistent context through
arkcli profile create/use
, and use for a one-off switch.
References
- arkcli-auth — Authentication status checks, login, and logout; its contain identity resolution / AK-SK boundaries / API Key recovery / the real-name gate.
- 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.