@byteplus/ark-cli-darwin-x64 0.0.0-stage → 1.0.46-prerelease.dc921200a42d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +201 -0
- package/bin/arkcli-darwin-amd64 +4 -0
- package/manifest.json +43 -0
- package/package.json +20 -4
- package/skills/arkcli-agent/SKILL.md +152 -0
- package/skills/arkcli-agent/references/agent.md +398 -0
- package/skills/arkcli-agent/references/byok.md +65 -0
- package/skills/arkcli-agent/references/context-management.md +42 -0
- package/skills/arkcli-agent/references/debug-export.md +26 -0
- package/skills/arkcli-agent/references/evals.md +178 -0
- package/skills/arkcli-agent/references/events-chat.md +148 -0
- package/skills/arkcli-agent/references/interfaces-gaps.md +52 -0
- package/skills/arkcli-agent/references/mcp-vault.md +111 -0
- package/skills/arkcli-agent/references/model-config.md +46 -0
- package/skills/arkcli-agent/references/self-hosted.md +47 -0
- package/skills/arkcli-agent/references/session-files.md +149 -0
- package/skills/arkcli-agent/references/session-upgrade.md +61 -0
- package/skills/arkcli-agent/references/skills.md +87 -0
- package/skills/arkcli-agent/references/todo-write.md +31 -0
- package/skills/arkcli-api-explorer/SKILL.md +188 -0
- package/skills/arkcli-api-explorer/references/arkcli-api.md +180 -0
- package/skills/arkcli-api-explorer/references/evals.md +176 -0
- package/skills/arkcli-auth/SKILL.md +184 -0
- package/skills/arkcli-auth/references/arkcli-auth-login.md +92 -0
- package/skills/arkcli-auth/references/arkcli-auth-status.md +109 -0
- package/skills/arkcli-auth/references/arkcli-auth-whoami.md +56 -0
- package/skills/arkcli-auth/references/auth-modes.md +78 -0
- package/skills/arkcli-auth/references/evals.md +82 -0
- package/skills/arkcli-auth/references/identity-resolution.md +33 -0
- package/skills/arkcli-auth/references/realname-gate.md +69 -0
- package/skills/arkcli-billing/SKILL.md +122 -0
- package/skills/arkcli-billing/references/arkcli-billing-list.md +259 -0
- package/skills/arkcli-billing/references/evals.md +107 -0
- package/skills/arkcli-chat/SKILL.md +114 -0
- package/skills/arkcli-chat/references/arkcli-chat.md +283 -0
- package/skills/arkcli-chat/references/caching-thinking.md +124 -0
- package/skills/arkcli-chat/references/chat-meta.md +77 -0
- package/skills/arkcli-chat/references/evals.md +34 -0
- package/skills/arkcli-chat/references/stream-events.md +124 -0
- package/skills/arkcli-chat/references/text-format.md +167 -0
- package/skills/arkcli-chat/references/tools.md +119 -0
- package/skills/arkcli-config/SKILL.md +197 -0
- package/skills/arkcli-config/references/arkcli-config-init.md +89 -0
- package/skills/arkcli-config/references/arkcli-config-profile.md +106 -0
- package/skills/arkcli-config/references/evals.md +154 -0
- package/skills/arkcli-connect/SKILL.md +196 -0
- package/skills/arkcli-connect/references/arkcli-connect.md +165 -0
- package/skills/arkcli-connect/references/evals.md +231 -0
- package/skills/arkcli-custommodel/SKILL.md +167 -0
- package/skills/arkcli-custommodel/references/arkcli-custommodel-available-quantizations.md +29 -0
- package/skills/arkcli-custommodel/references/arkcli-custommodel-delete.md +37 -0
- package/skills/arkcli-custommodel/references/arkcli-custommodel-get.md +45 -0
- package/skills/arkcli-custommodel/references/arkcli-custommodel-list.md +65 -0
- package/skills/arkcli-custommodel/references/arkcli-custommodel-quantize.md +59 -0
- package/skills/arkcli-custommodel/references/arkcli-custommodel-update.md +47 -0
- package/skills/arkcli-custommodel/references/arkcli-custommodel-upload.md +64 -0
- package/skills/arkcli-custommodel/references/evals.md +59 -0
- package/skills/arkcli-datasets/SKILL.md +39 -0
- package/skills/arkcli-datasets/references/commands.md +83 -0
- package/skills/arkcli-datasets/references/evals.md +31 -0
- package/skills/arkcli-deploy/SKILL.md +89 -0
- package/skills/arkcli-deploy/references/arkcli-deploy.md +141 -0
- package/skills/arkcli-deploy/references/evals.md +80 -0
- package/skills/arkcli-docs/SKILL.md +453 -0
- package/skills/arkcli-docs/references/commands.md +283 -0
- package/skills/arkcli-docs/references/evals.md +201 -0
- package/skills/arkcli-docs/references/failure-modes.md +85 -0
- package/skills/arkcli-doctor/CONTRIBUTING.md +54 -0
- package/skills/arkcli-doctor/SKILL.md +367 -0
- package/skills/arkcli-doctor/references/error-codes.md +162 -0
- package/skills/arkcli-doctor/references/evals.md +385 -0
- package/skills/arkcli-doctor/references/scope-account.md +94 -0
- package/skills/arkcli-doctor/references/scope-cli.md +88 -0
- package/skills/arkcli-doctor/references/scope-infer-endpoint.md +132 -0
- package/skills/arkcli-doctor/references/scope-metrics.md +157 -0
- package/skills/arkcli-doctor/references/scope-model.md +130 -0
- package/skills/arkcli-doctor/references/verify-origin.md +102 -0
- package/skills/arkcli-gen/SKILL.md +188 -0
- package/skills/arkcli-gen/references/arkcli-gen.md +230 -0
- package/skills/arkcli-gen/references/gen-meta.md +154 -0
- package/skills/arkcli-gen/references/image-stream.md +105 -0
- package/skills/arkcli-helper/SKILL.md +200 -0
- package/skills/arkcli-helper/references/arkcli-helper.md +298 -0
- package/skills/arkcli-helper/references/evals.md +334 -0
- package/skills/arkcli-iam/SKILL.md +46 -0
- package/skills/arkcli-iam/references/arkcli-iam-userid.md +54 -0
- package/skills/arkcli-iam/references/evals.md +24 -0
- package/skills/arkcli-infer-endpoint/SKILL.md +82 -0
- package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-capability-get.md +50 -0
- package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-create.md +121 -0
- package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-delete.md +71 -0
- package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-get.md +43 -0
- package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-list.md +82 -0
- package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-start.md +36 -0
- package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-stop.md +36 -0
- package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-update.md +78 -0
- package/skills/arkcli-infer-endpoint/references/evals.md +24 -0
- package/skills/arkcli-models/SKILL.md +305 -0
- package/skills/arkcli-models/references/arkcli-models-activate.md +103 -0
- package/skills/arkcli-models/references/arkcli-models-get.md +94 -0
- package/skills/arkcli-models/references/arkcli-models-list.md +71 -0
- package/skills/arkcli-models/references/arkcli-models-scenario-table.md +75 -0
- package/skills/arkcli-models/references/arkcli-models-search.md +170 -0
- package/skills/arkcli-models/references/evals.md +57 -0
- package/skills/arkcli-onboard/SKILL.md +169 -0
- package/skills/arkcli-onboard/references/evals.md +156 -0
- package/skills/arkcli-plans/SKILL.md +135 -0
- package/skills/arkcli-plans/references/arkcli-plans-buy.md +125 -0
- package/skills/arkcli-plans/references/arkcli-plans-get.md +84 -0
- package/skills/arkcli-plans/references/arkcli-plans-model-apply.md +58 -0
- package/skills/arkcli-plans/references/arkcli-plans-model-list.md +114 -0
- package/skills/arkcli-plans/references/arkcli-plans-renew.md +125 -0
- package/skills/arkcli-plans/references/arkcli-plans-team-rotate-apikey.md +61 -0
- package/skills/arkcli-plans/references/arkcli-plans-team-seat-assign.md +147 -0
- package/skills/arkcli-plans/references/arkcli-plans-team-seat-list.md +100 -0
- package/skills/arkcli-plans/references/evals.md +178 -0
- package/skills/arkcli-pricing/SKILL.md +120 -0
- package/skills/arkcli-pricing/references/arkcli-pricing-models.md +258 -0
- package/skills/arkcli-pricing/references/arkcli-pricing-plans.md +139 -0
- package/skills/arkcli-profile/SKILL.md +168 -0
- package/skills/arkcli-profile/references/arkcli-profile-create.md +92 -0
- package/skills/arkcli-profile/references/arkcli-profile-keys.md +135 -0
- package/skills/arkcli-profile/references/arkcli-profile-set-default.md +81 -0
- package/skills/arkcli-profile/references/evals.md +93 -0
- package/skills/arkcli-resources/SKILL.md +112 -0
- package/skills/arkcli-resources/references/arkcli-resources-list.md +105 -0
- package/skills/arkcli-shared/SKILL.md +209 -0
- package/skills/arkcli-shared/references/global-flags.md +77 -0
- package/skills/arkcli-shared/references/profile-defaults.md +35 -0
- package/skills/arkcli-shared/references/troubleshooting.md +49 -0
- package/skills/arkcli-shared/references/update.md +117 -0
- package/skills/arkcli-train-finetune/SKILL.md +109 -0
- package/skills/arkcli-train-finetune/references/create.md +274 -0
- package/skills/arkcli-train-finetune/references/download.md +50 -0
- package/skills/arkcli-train-finetune/references/evals.md +59 -0
- package/skills/arkcli-train-finetune/references/export-deploy.md +179 -0
- package/skills/arkcli-train-finetune/references/list.md +79 -0
- package/skills/arkcli-train-finetune/references/manage.md +140 -0
- package/skills/arkcli-understand/SKILL.md +105 -0
- package/skills/arkcli-understand/references/arkcli-understand.md +249 -0
- package/skills/arkcli-understand/references/evals.md +109 -0
- package/skills/arkcli-understand/references/sub-skills.md +137 -0
- package/skills/arkcli-usage/SKILL.md +123 -0
- package/skills/arkcli-usage/references/arkcli-usage-balance.md +196 -0
- package/skills/arkcli-usage/references/arkcli-usage-plan.md +153 -0
- package/skills/arkcli-usage/references/arkcli-usage-seats.md +199 -0
- package/skills/arkcli-usage/references/arkcli-usage-stats.md +160 -0
- package/README.md +0 -3
|
@@ -0,0 +1,249 @@
|
|
|
1
|
+
# +understand command reference
|
|
2
|
+
|
|
3
|
+
> **Prerequisite:** Read [`../../arkcli-shared/SKILL.md`](../../arkcli-shared/SKILL.md) (authentication, API Key error recovery, global parameters, safety rules) and [`sub-skills.md`](sub-skills.md) (purpose and expected output of 12 sub-skills).
|
|
4
|
+
|
|
5
|
+
`+understand` is a "one engine + semantic layer" multimodal understanding workflow built on the data-plane Responses API (`POST /responses`). It shares the same `CreateResponses` engine with `+chat`; every sub-skill provides an expert system prompt and a plan-profile fallback model. A Platform Profile instead uses its deployed `Resources.Text.Default` endpoint when `--model` is omitted.
|
|
6
|
+
|
|
7
|
+
## Command form
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
arkcli +understand <sub-skill> --input @file [prompt] # Explicit sub-skill
|
|
11
|
+
arkcli +understand "<prompt>" --input @file # Omit sub-skill → automatically route by --input modality
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
# Image description (minimal)
|
|
16
|
+
arkcli +understand image-caption --input @photo.jpg "Describe the main subject of the image in Chinese"
|
|
17
|
+
|
|
18
|
+
# Visual localization (bbox output)
|
|
19
|
+
arkcli +understand image-grounding --input @scene.jpg "Draw bounding boxes around all pedestrians in the image"
|
|
20
|
+
|
|
21
|
+
# Document extraction (by fields)
|
|
22
|
+
arkcli +understand doc-extract --input @invoice.pdf "Extract: invoice number / amount / invoice date"
|
|
23
|
+
|
|
24
|
+
# Speech transcription (no prompt required; task instructions are built into the sub-skill)
|
|
25
|
+
arkcli +understand asr --input @speech.mp3
|
|
26
|
+
|
|
27
|
+
# Generate SRT subtitles
|
|
28
|
+
arkcli +understand asr-align --input @speech.mp3
|
|
29
|
+
|
|
30
|
+
# Chapter-based video summary
|
|
31
|
+
arkcli +understand video-summary --input @clip.mp4 "Organize the output by chapter and provide a timestamp for each chapter"
|
|
32
|
+
|
|
33
|
+
# Omit sub-skill: automatically route by first --input modality (here .mp3 → asr)
|
|
34
|
+
arkcli +understand "Transcribe this recording" --input @speech.mp3
|
|
35
|
+
|
|
36
|
+
# Incremental streaming output
|
|
37
|
+
arkcli +understand asr --input @speech.mp3 --stream
|
|
38
|
+
|
|
39
|
+
# Append instructions after the built-in prompt (does not replace the expert prompt)
|
|
40
|
+
arkcli +understand image-caption --input @x.jpg --system-prompt-append "Answer in one sentence, in English"
|
|
41
|
+
|
|
42
|
+
# Complete JSON output
|
|
43
|
+
arkcli +understand asr --input @speech.mp3 --format json
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
## Positional argument parsing (sub-skill vs prompt)
|
|
47
|
+
|
|
48
|
+
`+understand` requires at least one positional argument (`MinArgs=1`):
|
|
49
|
+
|
|
50
|
+
- If `args[0]` matches the registry (one of 12), it is the sub-skill; `args[1:]` are joined as the prompt (layered on the built-in prompt as additional user requirements).
|
|
51
|
+
- If `args[0]` does not match, all `args` are the prompt, and the server **automatically routes** by the modality of the first `--input` (image→image-caption / video→video-qa / audio→asr / file→doc-extract).
|
|
52
|
+
- Many sub-skills such as `asr` / `asr-align` are fully defined by built-in prompts, so prompt may be omitted. However, the **number of positional arguments must still be ≥1**, so at least the sub-skill name is required.
|
|
53
|
+
|
|
54
|
+
## Parameters
|
|
55
|
+
|
|
56
|
+
> Strictly matches `arkcli +understand --help`. The `+understand` flag set is **smaller than `+chat`**: it replaces `+chat`'s `--instructions` with `--system-prompt-override/append`; it has **no** `--tools` / `--tools-file` / `--tool-choice` / `--caching` / `--cache-prefix` / `--text-format` / `--text-schema` / `--previous-response-id` / `--include-events` / `--expire-at`. Do not copy these flags from `+chat`.
|
|
57
|
+
|
|
58
|
+
| Parameter | Required | Type | Description |
|
|
59
|
+
|------|------|------|------|
|
|
60
|
+
| `<sub-skill>` | Yes* | positional | One of 12 (see [`sub-skills.md`](sub-skills.md)). When omitted, route automatically using first `--input`, but total positional arguments must still be ≥1 |
|
|
61
|
+
| `[prompt]` | No | positional | User requirements added above the built-in system prompt, such as extraction fields, a specific question, output language |
|
|
62
|
+
| `--input` | Yes | string (repeatable) | Input such as `@photo.jpg`; extension routes to image/video/audio/file. **Without it, returns `missing_input`** |
|
|
63
|
+
| `--model` | No | string | Explicit resource override and highest priority. When omitted, a Platform Profile uses its `Resources.Text.Default` `ep-xxx`; a plan profile uses the sub-skill fallback model. An explicit value must be a full versioned ID or `ep-xxx` |
|
|
64
|
+
| `--stream` | No | bool | Streaming output in two sections: `Thinking:` + `Response:` |
|
|
65
|
+
| `--system-prompt-override` | No | string | **Completely replace** built-in system prompt |
|
|
66
|
+
| `--system-prompt-append` | No | string | **Append** extra instructions to built-in prompt |
|
|
67
|
+
| `--temperature` | No | float | Sampling temperature, such as `0.7` |
|
|
68
|
+
| `--top-p` | No | float | Nucleus sampling top_p, such as `0.9` |
|
|
69
|
+
| `--max-output-tokens` | No | int | Reply token limit |
|
|
70
|
+
| `--reasoning-effort` | No | string | Reasoning intensity: `minimal` / `low` / `medium` / `high` (only supported models) |
|
|
71
|
+
| `--thinking` | No | string | Internal reasoning: `auto` / `enabled` / `disabled` |
|
|
72
|
+
| `--store` | No | bool | Persist response (retrieve later with `arkcli chat get <id>`) |
|
|
73
|
+
| `--no-progress` | No | bool | Disable stderr heartbeat for non-streaming calls (scripts) |
|
|
74
|
+
| `--timeout` | No | duration | Total limit for local-file preparation and inference. Default: `2m`. Pass a longer value such as `10m` explicitly for large files. |
|
|
75
|
+
| `--dry-run` | No | bool | Resolve the recipe, persisted Profile endpoint, explicit model, input references, and request summary locally. It does not read live metadata, upload files, call Responses, produce usage/response ID, or persist a response. |
|
|
76
|
+
|
|
77
|
+
\* At least a sub-skill name or routable `--input` is required; otherwise `missing_sub_skill`.
|
|
78
|
+
|
|
79
|
+
See [`../../arkcli-shared/references/global-flags.md`](../../arkcli-shared/references/global-flags.md) for global flags (`--profile` / `--api-key` / `--base-url` / `--format json` / `--transform` / `--debug`, and others).
|
|
80
|
+
|
|
81
|
+
## Model/endpoint resolution order
|
|
82
|
+
|
|
83
|
+
```text
|
|
84
|
+
explicit --model
|
|
85
|
+
-> Platform Profile: active Profile.Resources.Text.Default (must be ep-xxx)
|
|
86
|
+
-> plan profile: sub-skill recipe fallback model
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
- A Platform Profile without `Resources.Text.Default` fails with guidance to configure a default resource; it must not silently fall back to a bare model name.
|
|
90
|
+
- A missing default must not make the Agent switch Profiles, replace the sub-skill, or route to another business command.
|
|
91
|
+
- `--dry-run` and real execution use the same resolved resource, but preview reads only local Profile configuration and performs no live Endpoint discovery.
|
|
92
|
+
|
|
93
|
+
## System prompt resolution chain
|
|
94
|
+
|
|
95
|
+
Every sub-skill has a built-in system prompt injected into Responses `instructions`:
|
|
96
|
+
|
|
97
|
+
```
|
|
98
|
+
Built-in prompt (by sub-skill)
|
|
99
|
+
→ when --system-prompt-override is non-empty: replace entirely with override
|
|
100
|
+
→ when --system-prompt-append is non-empty: append to previous result (one blank line between)
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
- To **fine-tune** a task (language/output constraints): use `--system-prompt-append` and preserve the expert prompt.
|
|
104
|
+
- For **complete customization**: use `--system-prompt-override`, effectively reducing the sub-skill to `+chat` with a specified model + custom prompt.
|
|
105
|
+
- The `[prompt]` positional argument is a **user message**, separate from the system prompt: the sub-skill defines "who you are/how to work"; prompt defines "what this request needs".
|
|
106
|
+
|
|
107
|
+
## `@file` upload mechanism (audio is special)
|
|
108
|
+
|
|
109
|
+
`--input @<path>` infers modality by extension:
|
|
110
|
+
|
|
111
|
+
- `.jpg/.jpeg/.png/.webp/.gif/.bmp` → image
|
|
112
|
+
- `.mp4/.mov/.webm/.mkv/.avi` → video
|
|
113
|
+
- `.mp3/.wav/.m4a/.aac/.flac/.ogg` → audio
|
|
114
|
+
- Others → file (such as `.pdf`)
|
|
115
|
+
|
|
116
|
+
Supported references: `@<path>` (local, resolved to absolute `file://`), `<path>` (without prefix, equivalent to `@<path>`), `https://` / `http://` (remote URL), and constructed `file://` / `tos://` URLs.
|
|
117
|
+
|
|
118
|
+
Local inputs use product-safe preparation paths:
|
|
119
|
+
|
|
120
|
+
- **image / video / doc, aggregate size up to 45 MiB**: arkcli uses Responses-native inline forms (`image_url` / `video_url` data URLs and `input_file.file_data`). This avoids a separate Files API request on BytePlus plan endpoints while leaving headroom below the 64 MiB request-body limit after base64 expansion.
|
|
121
|
+
- **image / video / doc above 45 MiB**: arkcli uploads through Files API and waits for file status before inference. Only `active` files are attached to Responses as `file_id`. A `failed` file returns its file-service code/message and exits non-zero before inference; arkcli never sends that failed file to the model.
|
|
122
|
+
- **audio**: the SDK preprocessor **does not process audio**; arkcli inlines local audio as a **base64 data URL** before sending.
|
|
123
|
+
|
|
124
|
+
`--timeout` covers both file preparation and Responses inference for streaming and non-streaming execution. A timeout returns the stable `understand_timeout` error type and exits non-zero. Agents must not treat it as success or wait without a bound.
|
|
125
|
+
|
|
126
|
+
### Audio size constraints
|
|
127
|
+
|
|
128
|
+
| Form | Limit | Current state |
|
|
129
|
+
|---|---|---|
|
|
130
|
+
| base64 (`@local-audio`, inline data URL) | **25 MB** | Current implementation; **oversize is not blocked or warned** (product decision), so large files may fail or be rejected |
|
|
131
|
+
| Public URL (`https://...`) | 25 MB | The backend downloads it, so the URL must be reachable from the service environment |
|
|
132
|
+
| Files API (file_id, 512 MB) | 512 MB | Pending SDK upgrade; unavailable now |
|
|
133
|
+
|
|
134
|
+
> For audio **over 25 MB**, warn first and recommend splitting or reducing bitrate. Do not pretend large files will definitely work.
|
|
135
|
+
|
|
136
|
+
## Return value
|
|
137
|
+
|
|
138
|
+
> **Identical to `+chat`: arkcli flat schema, not native Responses `output[].content[].text`.** Read assistant text directly from `.content`. Global `--format` accepts only `json` and does not restore the native nested shape.
|
|
139
|
+
|
|
140
|
+
`--dry-run` is the exception: it returns `preview.v1` rather than a model response and never includes model-response `id`, `content`, or `usage`:
|
|
141
|
+
|
|
142
|
+
```json
|
|
143
|
+
{
|
|
144
|
+
"dry_run": true,
|
|
145
|
+
"mode": "local",
|
|
146
|
+
"validation_level": "local",
|
|
147
|
+
"validated": true,
|
|
148
|
+
"plan": {
|
|
149
|
+
"operation": "arkruntime.create_responses",
|
|
150
|
+
"recipe": "image-caption",
|
|
151
|
+
"model": "dola-seed-2.0-lite",
|
|
152
|
+
"prompt": "Describe the image",
|
|
153
|
+
"inputs": [{"kind": "image", "source": "file:///abs/photo.jpg"}],
|
|
154
|
+
"stream": false,
|
|
155
|
+
"instructions_source": "recipe"
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
**Default/`--format json` output**:
|
|
161
|
+
|
|
162
|
+
```json
|
|
163
|
+
{
|
|
164
|
+
"id": "resp_021776932247884ea9dc72e4279a1799608cb64438f5f0f125439",
|
|
165
|
+
"model": "seed-2-0-lite-260428",
|
|
166
|
+
"content": "...",
|
|
167
|
+
"reasoning_content": "...",
|
|
168
|
+
"usage": { "prompt_tokens": 88, "completion_tokens": 419, "total_tokens": 507 }
|
|
169
|
+
}
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
- `content`: sub-skill output (transcription / bbox JSON / SRT / extraction JSON / minutes Markdown, and others), **flattened to a string**. See [`sub-skills.md`](sub-skills.md).
|
|
173
|
+
- `reasoning_content`: reasoning process (non-empty only for reasoning models).
|
|
174
|
+
- `id`: response ID; after `--store`, retrieve with `arkcli chat get <id>`.
|
|
175
|
+
|
|
176
|
+
**Streaming output** (`--stream`):
|
|
177
|
+
|
|
178
|
+
```
|
|
179
|
+
Thinking:
|
|
180
|
+
<reasoning deltas...>
|
|
181
|
+
|
|
182
|
+
Response:
|
|
183
|
+
<response deltas...>
|
|
184
|
+
```
|
|
185
|
+
|
|
186
|
+
Streaming prints directly without JSON and ends with a newline.
|
|
187
|
+
|
|
188
|
+
### Parse with jq
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
# Extract main output (transcription / JSON / SRT ...)
|
|
192
|
+
arkcli +understand asr --input @speech.mp3 | jq -r .content
|
|
193
|
+
|
|
194
|
+
# JSON output such as bbox/extraction: content is a JSON string and requires a second parse
|
|
195
|
+
arkcli +understand image-grounding --input @x.jpg "Draw bounding boxes around everyone" | jq -r .content | jq .
|
|
196
|
+
|
|
197
|
+
# Extract token usage
|
|
198
|
+
arkcli +understand asr --input @speech.mp3 | jq .usage
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
Do not use `jq '.output[].content[].text'`; the output is flat. Model-generated JSON is a string in `.content`; first extract it with `jq -r .content`, then parse again with `jq .`.
|
|
202
|
+
|
|
203
|
+
## Common errors
|
|
204
|
+
|
|
205
|
+
| Error code / message | Cause | Handling |
|
|
206
|
+
|------|------|------|
|
|
207
|
+
| `missing_sub_skill`: `understand needs a sub-skill or an input file to auto-route` | No sub-skill and no routable `--input` | Add a sub-skill or `--input @file` |
|
|
208
|
+
| `unknown_sub_skill`: `unknown understand sub-skill "X"` | Misspelled/nonexistent sub-skill | Use one of 12 valid names in [`sub-skills.md`](sub-skills.md) |
|
|
209
|
+
| `missing_input`: `<sub> requires an input file via --input` | Sub-skill given without input | Add `--input @your-file` |
|
|
210
|
+
| `unroutable_input`: `cannot auto-route a "X" input` | No default mapping for inferred modality | Specify sub-skill explicitly |
|
|
211
|
+
| `input file not found: <path>` | Path does not exist or is directory | Check path/current directory |
|
|
212
|
+
| `understand_timeout` | File preparation or inference exceeded the client deadline | Validate the file and model modality first; pass `--timeout 10m` explicitly for a large file; retain `--debug` output for a repeatable failure |
|
|
213
|
+
| `uploaded responses file <id> failed preprocessing` | Files API marked the local input as `failed` | Use the returned code/message to inspect file content/format; never retry the same failed `file_id` |
|
|
214
|
+
| `ark runtime: API Key is required` | API Key not configured | `arkcli auth apikey` or set `ARK_API_KEY` |
|
|
215
|
+
| `Error code: 403 - {"code":"AccessDenied",...}` | Data-plane authentication/permission | **Do not retry**; follow API Key recovery in [`../../arkcli-auth/references/auth-modes.md`](../../arkcli-auth/references/auth-modes.md) |
|
|
216
|
+
| `Error code: 404 - InvalidEndpointOrModel.NotFound` | Unresolvable family name passed to `--model` | Use full `<name>-<primary_version>` or `ep-xxx`; see [`../../arkcli-models/SKILL.md`](../../arkcli-models/SKILL.md) |
|
|
217
|
+
|
|
218
|
+
## Direct `arkcli api` call (raw fallback)
|
|
219
|
+
|
|
220
|
+
The operation behind `+understand` is `+chat`'s `arkruntime.create_responses` / `arkruntime.create_responses_stream`. A sub-skill is a particular `model` + `instructions` and can be reproduced manually:
|
|
221
|
+
|
|
222
|
+
```bash
|
|
223
|
+
arkcli api arkruntime.create_responses --params '{
|
|
224
|
+
"model": "seed-2-0-lite-260428",
|
|
225
|
+
"instructions": "<Paste the built-in system prompt for the corresponding sub-skill here>",
|
|
226
|
+
"input": [{
|
|
227
|
+
"role": "user",
|
|
228
|
+
"content": [
|
|
229
|
+
{"type": "input_audio", "audio_url": "file:///abs/path/speech.mp3"},
|
|
230
|
+
{"type": "input_text", "text": "<Optional additional requirements>"}
|
|
231
|
+
]
|
|
232
|
+
}]
|
|
233
|
+
}'
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
In raw mode, arkcli no longer automatically inlines audio as base64. Construct a backend-accessible URL or data URL yourself. Prefer `+understand` whenever possible. See [`../../arkcli-api-explorer/SKILL.md`](../../arkcli-api-explorer/SKILL.md).
|
|
237
|
+
|
|
238
|
+
## Relation to other commands
|
|
239
|
+
|
|
240
|
+
- **[`arkcli +chat`](../../arkcli-chat/SKILL.md)**: Open conversation/reasoning, multi-turn continuation, tools, and `--text-format json_schema`. To follow up on `+understand`, use `--store`, then `+chat --previous-response-id <id>` (same engine).
|
|
241
|
+
- **[`arkcli +gen`](../../arkcli-gen/SKILL.md)**: Image/video **generation**, not understanding existing material.
|
|
242
|
+
- **[`arkcli models`](../../arkcli-models/SKILL.md)**: Query a full model version when overriding `--model`.
|
|
243
|
+
|
|
244
|
+
## Security and privacy
|
|
245
|
+
|
|
246
|
+
- `--input @<file>` uploads/inlines the **entire file** (Responses-native inline data for BytePlus image/video/doc up to 45 MiB, Files API above that threshold, and base64 for audio). Do not upload sensitive material casually; the service receives the complete content.
|
|
247
|
+
- `--dry-run` only checks the file locally and prints its reference summary; it does not upload or inline the file. The JSON may contain an absolute local `file://` path, so redact logs before sharing.
|
|
248
|
+
- `--debug` prints requests/responses (possibly base64 audio and file URLs) to stderr; redact logs before sharing.
|
|
249
|
+
- Responses persisted with `--store` remain server-side; delete when needed with `arkcli chat delete <id>`.
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
# Minimum arkcli-understand evaluation cases
|
|
2
|
+
|
|
3
|
+
Goal: verify stable trigger, automatic routing, anti-trigger, write-operation, and privacy-guard behavior, while preventing common hallucinations (nonexistent flags, command spelling, and incorrect JSON paths).
|
|
4
|
+
|
|
5
|
+
## 1) Trigger: understanding task with a specific output form
|
|
6
|
+
|
|
7
|
+
Input:
|
|
8
|
+
|
|
9
|
+
- "Transcribe this recording `@interview.mp3`."
|
|
10
|
+
- "Draw boxes around everyone in `@scene.jpg` and return coordinates."
|
|
11
|
+
|
|
12
|
+
Expected behavior:
|
|
13
|
+
|
|
14
|
+
- Route to `arkcli-understand`.
|
|
15
|
+
- Audio transcription → `arkcli +understand asr --input @interview.mp3`.
|
|
16
|
+
- Bounding-box localization → `arkcli +understand image-grounding --input @scene.jpg "Draw bounding boxes around everyone"`; explain output bbox `(x1,y1,x2,y2)` + confidence and secondary parsing with `jq -r .content | jq .`.
|
|
17
|
+
- **Do not** use `+chat` for these fixed-output tasks.
|
|
18
|
+
|
|
19
|
+
## 2) Automatic routing: omit sub-skill
|
|
20
|
+
|
|
21
|
+
Input:
|
|
22
|
+
|
|
23
|
+
- "Understand what this audio `@speech.mp3` says" (no sub-skill named).
|
|
24
|
+
|
|
25
|
+
Expected behavior:
|
|
26
|
+
|
|
27
|
+
- `arkcli +understand "<prompt>" --input @speech.mp3`; explain automatic routing by audio modality to `asr`.
|
|
28
|
+
- If the user truly wants translation / subtitles / multiple speakers, explain these are **not** selected automatically and require explicit `ast` / `asr-align` / `asr-speakers`.
|
|
29
|
+
|
|
30
|
+
## 3) Anti-trigger: open-ended image conversation
|
|
31
|
+
|
|
32
|
+
Input:
|
|
33
|
+
|
|
34
|
+
- "Look at `@cat.jpg`, chat with me about it, and let me ask follow-up questions."
|
|
35
|
+
|
|
36
|
+
Expected behavior:
|
|
37
|
+
|
|
38
|
+
- Route to [`arkcli-chat`](../../arkcli-chat/SKILL.md): open conversation + multi-turn continuation (`--store` / `--previous-response-id`) belongs to `+chat`.
|
|
39
|
+
- **Do not** force `+understand` (it is single-turn specialized understanding without `--previous-response-id`).
|
|
40
|
+
|
|
41
|
+
## 4) Anti-trigger: generation, not understanding
|
|
42
|
+
|
|
43
|
+
Input:
|
|
44
|
+
|
|
45
|
+
- "Generate a cyberpunk cat image."
|
|
46
|
+
|
|
47
|
+
Expected behavior:
|
|
48
|
+
|
|
49
|
+
- Route to [`arkcli-gen`](../../arkcli-gen/SKILL.md).
|
|
50
|
+
- **Do not** use `+understand` (it understands existing material; it does not generate).
|
|
51
|
+
|
|
52
|
+
## 5) Guard: large audio / private upload
|
|
53
|
+
|
|
54
|
+
Input:
|
|
55
|
+
|
|
56
|
+
- "Transcribe `@2hours-meeting.wav` (about 300 MB)."
|
|
57
|
+
|
|
58
|
+
Expected behavior:
|
|
59
|
+
|
|
60
|
+
- First state that audio uses base64 inline with a **25 MB limit**. Oversized files are not blocked but will likely fail; recommend splitting / lowering bitrate / transcoding. **Do not** pretend that a large file will work directly.
|
|
61
|
+
- Explain that `--input` uploads/inlines the complete file and sensitive material requires user confirmation.
|
|
62
|
+
|
|
63
|
+
## 6) Guard: do not retry data-plane authentication failure
|
|
64
|
+
|
|
65
|
+
Input (command response):
|
|
66
|
+
|
|
67
|
+
- `Error code: 403 - {"code":"AccessDenied",...}` or `ark runtime: API Key is required`
|
|
68
|
+
|
|
69
|
+
Expected behavior:
|
|
70
|
+
|
|
71
|
+
- **Do not retry in place**. Follow "API Key mode error recovery" in [`../../arkcli-auth/references/auth-modes.md`](../../arkcli-auth/references/auth-modes.md), guide the user to run `arkcli auth apikey`, select a key, and return to the original task.
|
|
72
|
+
|
|
73
|
+
## 7) Agent anti-hallucination checklist
|
|
74
|
+
|
|
75
|
+
Any of the following from the Agent is a failure:
|
|
76
|
+
|
|
77
|
+
- `arkcli understand ...` (missing `+`).
|
|
78
|
+
- `arkcli +understand ...` without `--input` (unless demonstrating an error).
|
|
79
|
+
- Using `--instructions` with `+understand` (it has no such flag; use `--system-prompt-override` / `--system-prompt-append`).
|
|
80
|
+
- Using `--tools` / `--tools-file` / `--text-format` / `--previous-response-id` / `--include-events` with `+understand` (these are `+chat` flags).
|
|
81
|
+
- Treating built-in catalog default `seed-2-0-lite` as a value sent directly to the data plane and manually adding a version. arkcli resolves the built-in name to its current primary version; a complete versioned ID is required **only when the user explicitly overrides `--model`**.
|
|
82
|
+
- Parsing with `jq '.output[].content[].text'` (output is flat; use `jq -r .content`, then `| jq .` for JSON output).
|
|
83
|
+
- Inventing nonexistent sub-skill names. The only valid names are `image-caption` / `image-grounding` / `image-gui` / `doc-extract` / `video-summary` / `video-qa` / `vau` / `asr` / `asr-align` / `asr-speakers` / `ast` / `meeting-minutes`.
|
|
84
|
+
- Treating `vau` as automatic video routing default (the default is `video-qa`; `vau` must be explicit).
|
|
85
|
+
|
|
86
|
+
## 8) Happy path (end-to-end; prerequisites required)
|
|
87
|
+
|
|
88
|
+
Prerequisite: logged in according to `arkcli auth status` and ARK API Key configured.
|
|
89
|
+
|
|
90
|
+
```bash
|
|
91
|
+
# Image description (easiest to reproduce)
|
|
92
|
+
arkcli +understand image-caption --input @<local-image> "Describe in one sentence" | jq -r .content
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
Check: exit code 0; `.content` is non-empty and describes the image. Run one corresponding happy path for each remaining modality (audio ≤25 MB).
|
|
96
|
+
|
|
97
|
+
## 9) Supporting machine evaluation
|
|
98
|
+
|
|
99
|
+
Machine-evaluation assets should be stored in `tests/skills/arkcli-understand/` (not under `skills/`). Rerun:
|
|
100
|
+
|
|
101
|
+
```bash
|
|
102
|
+
cd skill-creator
|
|
103
|
+
python3 -m scripts.run_arkcli_skill_benchmark \
|
|
104
|
+
--skill-path ../skills/arkcli-understand \
|
|
105
|
+
--workspace /tmp/arkcli-understand-bench \
|
|
106
|
+
--iteration 1 \
|
|
107
|
+
--runs-per-config 2 \
|
|
108
|
+
--runtime claude
|
|
109
|
+
```
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
# +understand sub-skill recipe catalog
|
|
2
|
+
|
|
3
|
+
> **Prerequisite:** Read [`arkcli-understand.md`](arkcli-understand.md) first (commands/flags/returns/errors).
|
|
4
|
+
|
|
5
|
+
The 12 sub-skills are 12 recipes `{modality, default model, built-in system prompt}` running on the same Responses engine. The "expected output" below comes from each sub-skill's built-in system prompt and guides the Agent when parsing `.content`.
|
|
6
|
+
|
|
7
|
+
General rules:
|
|
8
|
+
|
|
9
|
+
- **Do not override the default model** (verified working). Built-in catalog names are resolved to their current primary versions. A replacement `--model` must use a complete versioned ID or `ep-xxx`.
|
|
10
|
+
- The `[prompt]` positional argument is an **additional user requirement** layered on the expert prompt (fields, target, language, granularity, and others).
|
|
11
|
+
- To change output format/language while preserving expert capability, use `--system-prompt-append`; for complete customization, use `--system-prompt-override`.
|
|
12
|
+
- JSON outputs (grounding / gui / doc-extract) are strings in `.content` and require secondary parsing with `jq -r .content | jq .`.
|
|
13
|
+
|
|
14
|
+
---
|
|
15
|
+
|
|
16
|
+
## Image modality (default model `seed-2-0-lite`)
|
|
17
|
+
|
|
18
|
+
### `image-caption` — Image description / OCR
|
|
19
|
+
- **Purpose**: Clear, structured description and analysis of one or multiple images; for OCR, fully preserve image text without paraphrasing.
|
|
20
|
+
- **Expected output**: Natural-language description; verbatim text for OCR.
|
|
21
|
+
- **Examples**:
|
|
22
|
+
```bash
|
|
23
|
+
arkcli +understand image-caption --input @photo.jpg "Describe the main subject and scene"
|
|
24
|
+
arkcli +understand image-caption --input @receipt.png "Perform OCR and preserve all text and numbers exactly"
|
|
25
|
+
arkcli +understand image-caption --input @a.jpg --input @b.jpg "Compare the differences between these two images"
|
|
26
|
+
```
|
|
27
|
+
- **Automatic routing**: When sub-skill is omitted and the first `--input` is an image, falls back to this sub-skill.
|
|
28
|
+
|
|
29
|
+
### `image-grounding` — Visual localization (bbox)
|
|
30
|
+
- **Purpose**: Given an image and target description, precisely locate targets in the image.
|
|
31
|
+
- **Expected output**: bbox coordinates `(x1, y1, x2, y2)` + confidence for every target. If the target does not exist, output empty array `[]`; do not fabricate.
|
|
32
|
+
- **Examples**:
|
|
33
|
+
```bash
|
|
34
|
+
arkcli +understand image-grounding --input @scene.jpg "Draw bounding boxes around all red vehicles"
|
|
35
|
+
arkcli +understand image-grounding --input @ui.png "Locate the login button" | jq -r .content | jq .
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### `image-gui` — GUI action recognition
|
|
39
|
+
- **Purpose**: Given a UI screenshot and operation goal, output an executable action sequence for a GUI agent.
|
|
40
|
+
- **Expected output**: JSON array. Each step includes action type, target-element bbox where applicable, and required parameters such as typed text. Actions are limited to 12 types: `click` / `double-click` / `right-click` / `tap` / `long-press` / `scroll` / `swipe` / `drag` / `type` / `key` / `wait` / `screenshot`.
|
|
41
|
+
- **Example**:
|
|
42
|
+
```bash
|
|
43
|
+
arkcli +understand image-gui --input @screen.png "Enter arkcli in the search box and click Search"
|
|
44
|
+
```
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
48
|
+
## Video modality
|
|
49
|
+
|
|
50
|
+
### `video-summary` — Video summary (default `seed-2-0-lite`)
|
|
51
|
+
- **Purpose**: Structurally summarize video using visuals + audio.
|
|
52
|
+
- **Expected output**: User-selected granularity: `overall` / `segment` / `chapter`; each segment includes key timestamps (`HH:mm:ss`), visual points, dialogue points, and overall topic. Do not fabricate absent content.
|
|
53
|
+
- **Example**:
|
|
54
|
+
```bash
|
|
55
|
+
arkcli +understand video-summary --input @lecture.mp4 "Summarize by chapter and provide the start timestamp for each chapter"
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
### `video-qa` — Video Q&A (default `seed-2-0-lite`)
|
|
59
|
+
- **Purpose**: Answer a specific user question accurately using visuals / audio / timeline.
|
|
60
|
+
- **Expected output**: Direct answer first, with supporting evidence (visual description / dialogue / timestamp) when needed. If absent, clearly state that it is not covered; do not fabricate.
|
|
61
|
+
- **Example**:
|
|
62
|
+
```bash
|
|
63
|
+
arkcli +understand video-qa --input @clip.mp4 "How many people appear in the video, and what is each person doing?"
|
|
64
|
+
```
|
|
65
|
+
- **Automatic routing**: When sub-skill is omitted and the first `--input` is video, falls back to this sub-skill.
|
|
66
|
+
|
|
67
|
+
### `vau` — Joint audiovisual understanding (default `seed-2-0-lite`)
|
|
68
|
+
- **Purpose**: VAU (Video-Audio Understanding), deeply analyzes audio elements (voice / effects / music), acoustic characteristics, and narrative roles. Registered as video; **input remains a video file**.
|
|
69
|
+
- **Expected output**: Clearly structured, detailed audio analysis report.
|
|
70
|
+
- **Example**:
|
|
71
|
+
```bash
|
|
72
|
+
arkcli +understand vau --input @film_clip.mp4 "Analyze the sound design in this video"
|
|
73
|
+
```
|
|
74
|
+
- **Note**: `vau` is not the default video route (`video-qa` is); specify it **explicitly**.
|
|
75
|
+
|
|
76
|
+
---
|
|
77
|
+
|
|
78
|
+
## Audio modality (default model `seed-2-0-lite`)
|
|
79
|
+
|
|
80
|
+
> Audio is inlined as base64 with a **25 MB limit**. See [`arkcli-understand.md`](arkcli-understand.md).
|
|
81
|
+
|
|
82
|
+
### `asr` — Speech transcription
|
|
83
|
+
- **Purpose**: Pure ASR speech-to-text.
|
|
84
|
+
- **Expected output**: **Only** transcription text: no introduction, explanation, or Markdown. Output an empty string for unclear/no speech.
|
|
85
|
+
- **Examples**:
|
|
86
|
+
```bash
|
|
87
|
+
arkcli +understand asr --input @speech.mp3
|
|
88
|
+
arkcli +understand asr --input @speech.mp3 | jq -r .content # Retrieve transcription text directly
|
|
89
|
+
```
|
|
90
|
+
- **Automatic routing**: When sub-skill is omitted and the first `--input` is audio, falls back to this sub-skill.
|
|
91
|
+
|
|
92
|
+
### `asr-align` — Subtitle alignment
|
|
93
|
+
- **Purpose**: Timestamped transcription producing subtitles.
|
|
94
|
+
- **Expected output**: **SRT** by default (index / start-end `HH:MM:SS,mmm --> HH:MM:SS,mmm` / text, with blank lines between entries); follow a user template if supplied.
|
|
95
|
+
- **Examples**:
|
|
96
|
+
```bash
|
|
97
|
+
arkcli +understand asr-align --input @speech.mp3 # Default SRT
|
|
98
|
+
arkcli +understand asr-align --input @speech.mp3 "Output in WebVTT format" # Custom template
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `asr-speakers` — Multi-speaker transcription
|
|
102
|
+
- **Purpose**: Transcribe multi-person dialogue and label speakers.
|
|
103
|
+
- **Expected output**: Speaker-labeled transcription: first speaker `[spk0]`, second `[spk1]`, and so on.
|
|
104
|
+
- **Example**:
|
|
105
|
+
```bash
|
|
106
|
+
arkcli +understand asr-speakers --input @meeting.wav
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
### `ast` — Speech translation
|
|
110
|
+
- **Purpose**: Translate spoken audio content into text (AST).
|
|
111
|
+
- **Expected output**: Translated text. The built-in prompt does not fix the target language; specify it with `[prompt]`, such as "translate into English".
|
|
112
|
+
- **Example**:
|
|
113
|
+
```bash
|
|
114
|
+
arkcli +understand ast --input @speech.m4a "Translate into English"
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
### `meeting-minutes` — Meeting minutes
|
|
118
|
+
- **Purpose**: Produce structured minutes from meeting audio (the built-in prompt also supports meeting-video semantics).
|
|
119
|
+
- **Expected output**: Markdown minutes containing meeting topic / participants (voiceprints labeled `spk0`, `spk1`, and others) / agenda and discussion points (chronological with timestamps) / decisions (Action Items with owner / deadline when identifiable) / follow-ups. Preserve key quotations and avoid subjective inference.
|
|
120
|
+
- **Example**:
|
|
121
|
+
```bash
|
|
122
|
+
arkcli +understand meeting-minutes --input @standup.m4a
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
---
|
|
126
|
+
|
|
127
|
+
## File modality (default model `seed-2-0-mini`)
|
|
128
|
+
|
|
129
|
+
### `doc-extract` — Document field extraction
|
|
130
|
+
- **Purpose**: Extract structured information from PDF/documents.
|
|
131
|
+
- **Expected output**: JSON following the user-specified schema (field names / meanings). Use `null` when absent; do not invent. Preserve source page number `page` for traceability in multi-page documents.
|
|
132
|
+
- **Examples**:
|
|
133
|
+
```bash
|
|
134
|
+
arkcli +understand doc-extract --input @invoice.pdf "Extract: invoice number / amount / invoice date / seller"
|
|
135
|
+
arkcli +understand doc-extract --input @contract.pdf "Extract Party A, Party B, contract amount, and signing date" | jq -r .content | jq .
|
|
136
|
+
```
|
|
137
|
+
- **Automatic routing**: When sub-skill is omitted and the first `--input` is a non-image/video/audio file such as `.pdf`, falls back to this sub-skill.
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: arkcli-usage
|
|
3
|
+
version: 1.3.3
|
|
4
|
+
description: "ARK usage queries: `usage stats` (tokens/requests, 5–30 minute delay), `usage plan` / `usage balance --type plan` (plan quota snapshots), `usage balance` (free quota/media asset/plan balances), and `usage seats --with-usage` (team usage by seat). Trigger for usage, consumed amount, remaining quota, plan percentage, in-plan/out-of-plan, or per-seat consumption. Seat listing/binding/assignment is management and routes to arkcli-plans; this skill answers usage only. Verb routing: use/consume/how much → here; list/bind/assign → arkcli-plans. Anti-trigger: TTS/ASR/voice model usage is unsupported."
|
|
5
|
+
metadata:
|
|
6
|
+
requires:
|
|
7
|
+
bins: ["arkcli"]
|
|
8
|
+
cliHelp: "arkcli usage stats --help"
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
# arkcli usage
|
|
12
|
+
|
|
13
|
+
**CRITICAL — Before starting, you MUST use Read to open [`../arkcli-shared/SKILL.md`](../arkcli-shared/SKILL.md), which contains authentication gates, configuration troubleshooting, and shared safety rules.**
|
|
14
|
+
**CRITICAL — Before executing `usage stats`, use Read to open [`references/arkcli-usage-stats.md`](references/arkcli-usage-stats.md); do not invoke blindly.**
|
|
15
|
+
**CRITICAL — Before executing `usage plan`, use Read to open [`references/arkcli-usage-plan.md`](references/arkcli-usage-plan.md); do not invoke blindly.**
|
|
16
|
+
**CRITICAL — Before executing `usage balance`, use Read to open [`references/arkcli-usage-balance.md`](references/arkcli-usage-balance.md); do not invoke blindly.**
|
|
17
|
+
**CRITICAL — Before executing `usage seats`, use Read to open [`references/arkcli-usage-seats.md`](references/arkcli-usage-seats.md); do not invoke blindly.**
|
|
18
|
+
|
|
19
|
+
> **Data freshness (Must read first): `usage stats` uses an upstream BFF aggregation pipeline and has a 5–30 minute delay. It is intended for daily/aggregate analysis.** Do not use it for real-time budget monitoring, rate limiting, or alerts requiring second-level precision. For those scenarios, read per-request `.usage` returned by inference commands such as `+chat` / `+gen` (zero delay; see [arkcli-chat](../arkcli-chat/SKILL.md) and [arkcli-gen](../arkcli-gen/SKILL.md)).
|
|
20
|
+
|
|
21
|
+
> **Agent Plan boundary**: BytePlus does not offer Agent Plan (`agent-plan` / `agent-plan-team`). When a user asks about **Agent Plan** quota, remaining, reset date, or per-seat usage, respond with "Agent Plan is not offered on BytePlus" and stop — do not silently answer with Coding Plan numbers and do not attempt any Agent Plan flag combination as a probe.
|
|
22
|
+
|
|
23
|
+
> **Voice model boundary**: TTS / ASR / dubbing / reading / podcast / voice / real-time voice interaction are currently unsupported in arkcli. Do not answer their usage with `usage stats --model` or plan/balance commands; state directly that arkcli does not support querying voice model pricing or usage.
|
|
24
|
+
|
|
25
|
+
> **Difference among stats / plan / balance:**
|
|
26
|
+
> - `stats`: token-billed inference usage (any identity, 5–30 minute delay).
|
|
27
|
+
> - `plan`: subscription quota snapshot (CodingPlan personal + team: percentage used / reset date).
|
|
28
|
+
> - `balance`: "how much X remains" from a balance perspective (`--type free-quota / media-asset / plan`).
|
|
29
|
+
> - `seats`: admin view of team-seat **usage** (per-seat usage / plan percentage; **usage only**). Seat listing/binding/assignment uses [`arkcli-plans`](../arkcli-plans/SKILL.md): `plans team seat-list / seat-assign`.
|
|
30
|
+
>
|
|
31
|
+
> "How much plan quota remains?" → `plan` or concise `balance --type plan`; "How many tokens did I use today?" → `stats`; "How much free quota/media capacity remains?" → `balance`; "**How much did each seat use / team-seat usage distribution?**" → `seats --with-usage`. Pure management ("who is bound / list seats / assign seats") → `arkcli-plans`.
|
|
32
|
+
|
|
33
|
+
## Step 0: choose the metric, then verify the identity
|
|
34
|
+
|
|
35
|
+
- Explicit Coding Plan quota questions use `usage plan --product coding-plan|coding-plan-team`. Subscription ownership belongs to the account/user, not the active profile type; a platform profile does not prove there is no subscription.
|
|
36
|
+
- Platform Token/request usage uses `usage stats --start <YYYY-MM-DD>`; personal scope must retain `--mine`, including when adding grouping. Only query both buckets when the user asks for both; label them separately and do not sum quota percentages and Tokens.
|
|
37
|
+
- Coding Plan has quota snapshots, not per-model/Harness or Endpoint/API Key attribution. State this boundary; do not append platform stats as a substitute. Agent Plan is not offered on BytePlus.
|
|
38
|
+
- If "my usage" is ambiguous, clarify the metric from the current context before querying. Do not switch Profile, Key, Project or account scope to fill gaps. Reuse known identity context; when a missing summary is needed, use `arkcli auth whoami --format json`. Ordinary admission does not run `profile show/list/keys list`, which can synchronize and write back keys.
|
|
39
|
+
- Stats require explicit `--start`; derive dates from the request and disclose a today-only default. Split long ranges according to the reference instead of silently shortening them.
|
|
40
|
+
- Distinguish failed queries, successful empty records and nonempty zero totals. Check time range, aggregation delay, metric, identity and filters before concluding no usage. Recent missing records do not prove no call occurred.
|
|
41
|
+
- Report metric, identity/scope, dates and freshness. Platform attribution uses actual `ModelEndpoint` / masked `AuthToken` evidence; do not retrieve plaintext keys merely to identify usage.
|
|
42
|
+
|
|
43
|
+
## Applicable scenarios
|
|
44
|
+
|
|
45
|
+
- View inference usage for today or a date range (**accepting 5–30 minute delay**).
|
|
46
|
+
- View subscription plan quota consumption / reset time.
|
|
47
|
+
- Group stats by model, endpoint, or API Key.
|
|
48
|
+
- Analyze token trends and produce reconciliation reports.
|
|
49
|
+
- **Not for voice model usage**: for TTS / ASR / voice-model usage, remaining quota, or calls, do not run this skill; state that it is unsupported.
|
|
50
|
+
|
|
51
|
+
## Business positioning
|
|
52
|
+
|
|
53
|
+
- This skill handles existing invocation results and consumption; it is an **offline / near-real-time** analysis entry.
|
|
54
|
+
- It normally follows:
|
|
55
|
+
- An existing Endpoint whose usage is queried.
|
|
56
|
+
- A model already being called, analyzed by model / API Key.
|
|
57
|
+
- A subscribed plan whose remaining quota is queried.
|
|
58
|
+
- It is not an Endpoint creation entry or a model trial entry.
|
|
59
|
+
- **It is not a data source for real-time budget/rate-limit/alert controls**; use per-request `.usage`.
|
|
60
|
+
|
|
61
|
+
## Quick decisions
|
|
62
|
+
|
|
63
|
+
- "How much plan quota remains / percentage used / reset date / how many plans":
|
|
64
|
+
- `arkcli usage plan` (probes all two SKUs; only subscribed buckets issue usage requests).
|
|
65
|
+
- `arkcli usage plan --all`: query both buckets without subscription probing (diagnostics/Excel).
|
|
66
|
+
- `arkcli usage plan --product=X`: skip probing and query one.
|
|
67
|
+
- **This is the same data as `balance --type plan`**. `usage plan` provides the complete output (`subscribed` / `updated_at`), while `balance --type plan` provides a concise projection without metadata. Prefer `usage plan`; use `balance --type plan` only when reconciling plan balances together with free quota or media-asset capacity.
|
|
68
|
+
- "My usage / tokens today / endpoint consumption":
|
|
69
|
+
- First choose the requested metric using Step 0. An explicit platform/Endpoint request does not need a plan query first.
|
|
70
|
+
- If the user names a voice model/TTS/ASR → **do not query usage**. Currently arkcli doesn't support querying the usage of audio models.
|
|
71
|
+
- **BytePlus:** first run `arkcli usage stats --start <YYYY-MM-DD> --mine` (endpoint dimension).
|
|
72
|
+
- `data_count > 0` → use `totals`.
|
|
73
|
+
- `data_count=0` (the user has no Endpoint or has not invoked models through an Endpoint recently) → immediately retry `arkcli usage stats --start <YYYY-MM-DD> --mine --mine-by=apikey`.
|
|
74
|
+
- **⛔ Never degrade to an account-wide query without `--mine`**. Whole-account data is not "my usage".
|
|
75
|
+
- "How much did each APIKey use?": `arkcli usage stats --start <YYYY-MM-DD> --mine --mine-by=apikey`; split by `records[].AuthToken`.
|
|
76
|
+
- "Remaining free tokens/model free quota/media capacity":
|
|
77
|
+
- `arkcli usage balance --type free-quota`.
|
|
78
|
+
- `arkcli usage balance --type media-asset`.
|
|
79
|
+
- "How much team seats used / per-seat consumption / plan percentage by seat" (admin usage view):
|
|
80
|
+
- `arkcli usage seats --product coding-plan-team --with-usage`.
|
|
81
|
+
- Without `--with-usage`, only metadata is returned.
|
|
82
|
+
- Routing: this command answers only usage. "**List seats / inspect seat bindings / assign seats to employees**" routes to [`arkcli-plans`](../arkcli-plans/SKILL.md) and its `plans team seat-list / seat-assign` commands. Verbs "used/consumed/how much" stay here; "bind/list/assign" goes to plans.
|
|
83
|
+
- If data looks wrong, check authentication/profile before questioning the data.
|
|
84
|
+
|
|
85
|
+
## Agent quick execution order
|
|
86
|
+
|
|
87
|
+
1. Confirm authentication; if uncertain, run `arkcli auth status`.
|
|
88
|
+
2. Start with the smallest query, then add date ranges and grouping.
|
|
89
|
+
3. For abnormal results, first check profile / region / API Key source.
|
|
90
|
+
4. For endpoint usage, preferably confirm endpoint-id first.
|
|
91
|
+
|
|
92
|
+
## Common fallbacks
|
|
93
|
+
|
|
94
|
+
- Authentication error: [`../arkcli-auth/SKILL.md`](../arkcli-auth/SKILL.md).
|
|
95
|
+
- Wrong query environment: [`../arkcli-config/SKILL.md`](../arkcli-config/SKILL.md).
|
|
96
|
+
- No Endpoint and preparing integration: [`../arkcli-deploy/SKILL.md`](../arkcli-deploy/SKILL.md).
|
|
97
|
+
- Plan **price**, not usage: [`../arkcli-pricing/SKILL.md`](../arkcli-pricing/SKILL.md). `pricing plans` returns catalog pricing, while `usage plan` returns quota snapshots; they are different views.
|
|
98
|
+
- **Settlement amount/bill/money spent**, not tokens: [`../arkcli-billing/SKILL.md`](../arkcli-billing/SKILL.md). Its data source is the BytePlus billing center and is posted at T+1; `usage stats` uses near-real-time BFF inference aggregation.
|
|
99
|
+
- Agent Plan quota, remaining balance, or per-seat usage: clearly state that Agent Plan is not supported, take no action, and do not use any Coding Plan commands as a substitute.
|
|
100
|
+
- Voice/TTS/ASR usage or quota: state that arkcli does not support it; do not route to pricing/billing.
|
|
101
|
+
|
|
102
|
+
## Command overview
|
|
103
|
+
|
|
104
|
+
| Command | Description |
|
|
105
|
+
|------|------|
|
|
106
|
+
| [`usage stats`](references/arkcli-usage-stats.md) | Inference usage (tokens/requests, daily/hourly aggregation; token-billed inference view) |
|
|
107
|
+
| [`usage plan`](references/arkcli-usage-plan.md) | Subscription quota snapshots (CodingPlan; usage, remaining quota, and reset time for 5h / weekly / monthly / session windows). Probes both SKUs by default |
|
|
108
|
+
| [`usage balance`](references/arkcli-usage-balance.md) | Unified balance entry through `--type free-quota / media-asset / plan` (model free inference quota / media-asset capacity / plan balance) |
|
|
109
|
+
| [`usage seats`](references/arkcli-usage-seats.md) | **Admin view** listing all enterprise plan seats (SeatID / bound sub-user / billing status). Sub-users normally receive `AccessDenied` |
|
|
110
|
+
|
|
111
|
+
## Natural-language triggers
|
|
112
|
+
|
|
113
|
+
| User says | Command |
|
|
114
|
+
|---|---|
|
|
115
|
+
| "remaining quota / balance / how much remains / percentage used / plan quota" | `arkcli usage plan` or `arkcli usage balance --type plan` |
|
|
116
|
+
| "remaining free quota / model free quota / free tokens" | `arkcli usage balance --type free-quota` |
|
|
117
|
+
| "my usage / tokens today / inference usage / token consumption" | `arkcli usage stats --start <YYYY-MM-DD> --mine` |
|
|
118
|
+
|
|
119
|
+
## References
|
|
120
|
+
|
|
121
|
+
- [arkcli-deploy](../arkcli-deploy/SKILL.md) -- Create Endpoint first, then inspect endpoint usage
|
|
122
|
+
- [arkcli-pricing](../arkcli-pricing/SKILL.md) -- Catalog pricing from `pricing plans` complements `usage plan` quota snapshots
|
|
123
|
+
- [arkcli-shared](../arkcli-shared/SKILL.md) -- Authentication and global parameters
|