@byteplus/ark-cli-darwin-x64 0.0.0-stage → 1.0.46-prerelease.46bd0d6dcc58

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.
Files changed (148) hide show
  1. package/LICENSE +201 -0
  2. package/bin/arkcli-darwin-amd64 +4 -0
  3. package/manifest.json +43 -0
  4. package/package.json +20 -4
  5. package/skills/arkcli-agent/SKILL.md +152 -0
  6. package/skills/arkcli-agent/references/agent.md +398 -0
  7. package/skills/arkcli-agent/references/byok.md +65 -0
  8. package/skills/arkcli-agent/references/context-management.md +42 -0
  9. package/skills/arkcli-agent/references/debug-export.md +26 -0
  10. package/skills/arkcli-agent/references/evals.md +178 -0
  11. package/skills/arkcli-agent/references/events-chat.md +148 -0
  12. package/skills/arkcli-agent/references/interfaces-gaps.md +52 -0
  13. package/skills/arkcli-agent/references/mcp-vault.md +111 -0
  14. package/skills/arkcli-agent/references/model-config.md +46 -0
  15. package/skills/arkcli-agent/references/self-hosted.md +47 -0
  16. package/skills/arkcli-agent/references/session-files.md +149 -0
  17. package/skills/arkcli-agent/references/session-upgrade.md +61 -0
  18. package/skills/arkcli-agent/references/skills.md +87 -0
  19. package/skills/arkcli-agent/references/todo-write.md +31 -0
  20. package/skills/arkcli-api-explorer/SKILL.md +188 -0
  21. package/skills/arkcli-api-explorer/references/arkcli-api.md +180 -0
  22. package/skills/arkcli-api-explorer/references/evals.md +176 -0
  23. package/skills/arkcli-auth/SKILL.md +184 -0
  24. package/skills/arkcli-auth/references/arkcli-auth-login.md +92 -0
  25. package/skills/arkcli-auth/references/arkcli-auth-status.md +109 -0
  26. package/skills/arkcli-auth/references/arkcli-auth-whoami.md +56 -0
  27. package/skills/arkcli-auth/references/auth-modes.md +78 -0
  28. package/skills/arkcli-auth/references/evals.md +82 -0
  29. package/skills/arkcli-auth/references/identity-resolution.md +33 -0
  30. package/skills/arkcli-auth/references/realname-gate.md +69 -0
  31. package/skills/arkcli-billing/SKILL.md +122 -0
  32. package/skills/arkcli-billing/references/arkcli-billing-list.md +259 -0
  33. package/skills/arkcli-billing/references/evals.md +107 -0
  34. package/skills/arkcli-chat/SKILL.md +114 -0
  35. package/skills/arkcli-chat/references/arkcli-chat.md +283 -0
  36. package/skills/arkcli-chat/references/caching-thinking.md +124 -0
  37. package/skills/arkcli-chat/references/chat-meta.md +77 -0
  38. package/skills/arkcli-chat/references/evals.md +34 -0
  39. package/skills/arkcli-chat/references/stream-events.md +124 -0
  40. package/skills/arkcli-chat/references/text-format.md +167 -0
  41. package/skills/arkcli-chat/references/tools.md +119 -0
  42. package/skills/arkcli-config/SKILL.md +197 -0
  43. package/skills/arkcli-config/references/arkcli-config-init.md +89 -0
  44. package/skills/arkcli-config/references/arkcli-config-profile.md +106 -0
  45. package/skills/arkcli-config/references/evals.md +154 -0
  46. package/skills/arkcli-connect/SKILL.md +196 -0
  47. package/skills/arkcli-connect/references/arkcli-connect.md +165 -0
  48. package/skills/arkcli-connect/references/evals.md +231 -0
  49. package/skills/arkcli-custommodel/SKILL.md +167 -0
  50. package/skills/arkcli-custommodel/references/arkcli-custommodel-available-quantizations.md +29 -0
  51. package/skills/arkcli-custommodel/references/arkcli-custommodel-delete.md +37 -0
  52. package/skills/arkcli-custommodel/references/arkcli-custommodel-get.md +45 -0
  53. package/skills/arkcli-custommodel/references/arkcli-custommodel-list.md +65 -0
  54. package/skills/arkcli-custommodel/references/arkcli-custommodel-quantize.md +59 -0
  55. package/skills/arkcli-custommodel/references/arkcli-custommodel-update.md +47 -0
  56. package/skills/arkcli-custommodel/references/arkcli-custommodel-upload.md +64 -0
  57. package/skills/arkcli-custommodel/references/evals.md +59 -0
  58. package/skills/arkcli-datasets/SKILL.md +39 -0
  59. package/skills/arkcli-datasets/references/commands.md +83 -0
  60. package/skills/arkcli-datasets/references/evals.md +31 -0
  61. package/skills/arkcli-deploy/SKILL.md +89 -0
  62. package/skills/arkcli-deploy/references/arkcli-deploy.md +141 -0
  63. package/skills/arkcli-deploy/references/evals.md +80 -0
  64. package/skills/arkcli-docs/SKILL.md +453 -0
  65. package/skills/arkcli-docs/references/commands.md +283 -0
  66. package/skills/arkcli-docs/references/evals.md +201 -0
  67. package/skills/arkcli-docs/references/failure-modes.md +85 -0
  68. package/skills/arkcli-doctor/CONTRIBUTING.md +54 -0
  69. package/skills/arkcli-doctor/SKILL.md +367 -0
  70. package/skills/arkcli-doctor/references/error-codes.md +162 -0
  71. package/skills/arkcli-doctor/references/evals.md +385 -0
  72. package/skills/arkcli-doctor/references/scope-account.md +94 -0
  73. package/skills/arkcli-doctor/references/scope-cli.md +88 -0
  74. package/skills/arkcli-doctor/references/scope-infer-endpoint.md +132 -0
  75. package/skills/arkcli-doctor/references/scope-metrics.md +157 -0
  76. package/skills/arkcli-doctor/references/scope-model.md +130 -0
  77. package/skills/arkcli-doctor/references/verify-origin.md +102 -0
  78. package/skills/arkcli-gen/SKILL.md +188 -0
  79. package/skills/arkcli-gen/references/arkcli-gen.md +230 -0
  80. package/skills/arkcli-gen/references/gen-meta.md +154 -0
  81. package/skills/arkcli-gen/references/image-stream.md +105 -0
  82. package/skills/arkcli-helper/SKILL.md +200 -0
  83. package/skills/arkcli-helper/references/arkcli-helper.md +298 -0
  84. package/skills/arkcli-helper/references/evals.md +334 -0
  85. package/skills/arkcli-iam/SKILL.md +46 -0
  86. package/skills/arkcli-iam/references/arkcli-iam-userid.md +54 -0
  87. package/skills/arkcli-iam/references/evals.md +24 -0
  88. package/skills/arkcli-infer-endpoint/SKILL.md +82 -0
  89. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-capability-get.md +50 -0
  90. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-create.md +121 -0
  91. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-delete.md +71 -0
  92. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-get.md +43 -0
  93. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-list.md +82 -0
  94. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-start.md +36 -0
  95. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-stop.md +36 -0
  96. package/skills/arkcli-infer-endpoint/references/arkcli-infer-endpoint-update.md +78 -0
  97. package/skills/arkcli-infer-endpoint/references/evals.md +24 -0
  98. package/skills/arkcli-models/SKILL.md +305 -0
  99. package/skills/arkcli-models/references/arkcli-models-activate.md +103 -0
  100. package/skills/arkcli-models/references/arkcli-models-get.md +94 -0
  101. package/skills/arkcli-models/references/arkcli-models-list.md +71 -0
  102. package/skills/arkcli-models/references/arkcli-models-scenario-table.md +75 -0
  103. package/skills/arkcli-models/references/arkcli-models-search.md +170 -0
  104. package/skills/arkcli-models/references/evals.md +57 -0
  105. package/skills/arkcli-onboard/SKILL.md +169 -0
  106. package/skills/arkcli-onboard/references/evals.md +156 -0
  107. package/skills/arkcli-plans/SKILL.md +135 -0
  108. package/skills/arkcli-plans/references/arkcli-plans-buy.md +125 -0
  109. package/skills/arkcli-plans/references/arkcli-plans-get.md +84 -0
  110. package/skills/arkcli-plans/references/arkcli-plans-model-apply.md +58 -0
  111. package/skills/arkcli-plans/references/arkcli-plans-model-list.md +114 -0
  112. package/skills/arkcli-plans/references/arkcli-plans-renew.md +125 -0
  113. package/skills/arkcli-plans/references/arkcli-plans-team-rotate-apikey.md +61 -0
  114. package/skills/arkcli-plans/references/arkcli-plans-team-seat-assign.md +147 -0
  115. package/skills/arkcli-plans/references/arkcli-plans-team-seat-list.md +100 -0
  116. package/skills/arkcli-plans/references/evals.md +178 -0
  117. package/skills/arkcli-pricing/SKILL.md +120 -0
  118. package/skills/arkcli-pricing/references/arkcli-pricing-models.md +258 -0
  119. package/skills/arkcli-pricing/references/arkcli-pricing-plans.md +139 -0
  120. package/skills/arkcli-profile/SKILL.md +168 -0
  121. package/skills/arkcli-profile/references/arkcli-profile-create.md +92 -0
  122. package/skills/arkcli-profile/references/arkcli-profile-keys.md +135 -0
  123. package/skills/arkcli-profile/references/arkcli-profile-set-default.md +81 -0
  124. package/skills/arkcli-profile/references/evals.md +93 -0
  125. package/skills/arkcli-resources/SKILL.md +112 -0
  126. package/skills/arkcli-resources/references/arkcli-resources-list.md +105 -0
  127. package/skills/arkcli-shared/SKILL.md +209 -0
  128. package/skills/arkcli-shared/references/global-flags.md +77 -0
  129. package/skills/arkcli-shared/references/profile-defaults.md +35 -0
  130. package/skills/arkcli-shared/references/troubleshooting.md +49 -0
  131. package/skills/arkcli-shared/references/update.md +117 -0
  132. package/skills/arkcli-train-finetune/SKILL.md +109 -0
  133. package/skills/arkcli-train-finetune/references/create.md +274 -0
  134. package/skills/arkcli-train-finetune/references/download.md +50 -0
  135. package/skills/arkcli-train-finetune/references/evals.md +59 -0
  136. package/skills/arkcli-train-finetune/references/export-deploy.md +179 -0
  137. package/skills/arkcli-train-finetune/references/list.md +79 -0
  138. package/skills/arkcli-train-finetune/references/manage.md +140 -0
  139. package/skills/arkcli-understand/SKILL.md +105 -0
  140. package/skills/arkcli-understand/references/arkcli-understand.md +249 -0
  141. package/skills/arkcli-understand/references/evals.md +109 -0
  142. package/skills/arkcli-understand/references/sub-skills.md +137 -0
  143. package/skills/arkcli-usage/SKILL.md +123 -0
  144. package/skills/arkcli-usage/references/arkcli-usage-balance.md +196 -0
  145. package/skills/arkcli-usage/references/arkcli-usage-plan.md +153 -0
  146. package/skills/arkcli-usage/references/arkcli-usage-seats.md +199 -0
  147. package/skills/arkcli-usage/references/arkcli-usage-stats.md +160 -0
  148. package/README.md +0 -3
@@ -0,0 +1,125 @@
1
+ # plans renew
2
+
3
+ > **Prerequisite:** Read [`../../arkcli-shared/SKILL.md`](../../arkcli-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.
4
+
5
+ > **⚠️ BytePlus payment flow:** Like `plans buy`, `plans renew` on BytePlus does not perform in-CLI charging. Adding `--yes` **does not renew or charge**; it returns a `payment_via_web` payload with a `subscribe_url` pointing to the BytePlus console subscription page (the same page where new purchases happen — it also handles renewals). The user completes the renewal in the browser.
6
+
7
+ > **🔒 Review gate (mandatory process, identical to `plans buy`):** Without `--yes`, this command **does not renew** and returns price + `subscribe_url`. The Agent **must** display `total_amount_usd` / `original_amount_usd` to the user for transparency, then present `subscribe_url` for the browser step. **Do not rerun with `--yes`** expecting an in-CLI renewal — BytePlus does not support that path; both `--yes` and the gate resolve to the same subscribe URL. See the [`plans buy` review gate](arkcli-plans-buy.md). The CLI does **not** return an `agreements` array; the BytePlus subscription page handles agreement UI on the web.
8
+
9
+
10
+ ## Three invocation forms
11
+
12
+ Same as `plans buy`:
13
+
14
+ | Form | Behavior |
15
+ |---|---|
16
+ | Neither `--yes` nor `--estimate` | Review gate: returns **price** (USD) + `subscribe_url` + `next_step`; internally uses EstimatePrice (IsRenew=true / Scene=RENEW) and does not place an order |
17
+ | `--estimate` | Online quote (scripting path for "price only") |
18
+ | `--yes` | **Web redirect** (BytePlus): returns `payment_via_web` payload with `subscribe_url`; **no renewal API is called**, nothing is renewed |
19
+
20
+ > The gate response **resolves and fills the tier**: personal from `ListSubscribeTrade.InfoList[0].BizInfo`; team from `ListSeatInfos` using SeatIDs[0]. The `echo.tier` field lets the Agent confirm with the user, "Do you still want to renew this tier?"
21
+
22
+ ## Commands
23
+
24
+ ```bash
25
+ # Step 1: Guidance — obtain price + subscribe_url
26
+ arkcli plans renew --plan coding-plan
27
+ arkcli plans renew --plan coding-plan-team --duration 3 --seat-ids seat-001,seat-002
28
+
29
+ # Step 2: Price inquiry (optional)
30
+ arkcli plans renew --plan coding-plan --duration 6 --estimate
31
+
32
+ # Step 3: After showing the user the price, hand off to the web page via subscribe_url
33
+ arkcli plans renew --plan coding-plan --yes
34
+ arkcli plans renew --plan coding-plan --duration 6 --yes
35
+ arkcli plans renew --plan coding-plan-team --duration 3 --seat-ids seat-001,seat-002 --yes
36
+ arkcli plans renew --plan coding-plan-team --seat-ids seat-aaa --yes
37
+ ```
38
+
39
+ ## Parameters
40
+
41
+ | Parameter | Required | Type | Description |
42
+ |------|------|------|------|
43
+ | `--plan` | Yes | string | `coding-plan` / `coding-plan-team` |
44
+ | `--duration` | No | int | Renewal duration (months), 1–12, default 1 |
45
+ | `--seat-ids` | Required for team | string | Comma-separated seat IDs to renew (personal edition **does not allow** this argument) |
46
+ | `--yes` | No | bool | On BytePlus, returns the `payment_via_web` payload directly (no charge; equivalent to the gate for the subscribe_url purpose) |
47
+
48
+ > **Key difference**: Unlike `plans buy`, `renew` does not need `--type`; renewal keeps the original tier. It also does not need `--quantity`; the quantity is determined by the number of `--seat-ids`.
49
+
50
+ ## Return value (review gate, default form)
51
+
52
+ When neither `--yes` nor `--estimate` is passed:
53
+
54
+ ```json
55
+ {
56
+ "status": "agreement_required",
57
+ "plan": "coding-plan",
58
+ "tier": "lite",
59
+ "duration": 1,
60
+ "echo": {"plan": "coding-plan", "tier": "lite", "duration": 1},
61
+ "total_amount_usd": 10,
62
+ "original_amount_usd": 10,
63
+ "subscribe_url": "https://console.byteplus.com/ark/region:ark+ap-southeast-1/subscription/coding-plan",
64
+ "confirm_text": "BytePlus balance-based auto-pay is not supported by arkcli yet...",
65
+ "next_step": "Ask the user to open <subscribe_url> in the browser and finish the purchase on the BytePlus subscription page. Do not rerun this command with --yes."
66
+ }
67
+ ```
68
+
69
+ `tier` / `echo.tier`: the current tier resolved from the existing subscription / seat. The Agent uses it to confirm the renewal tier with the user.
70
+
71
+ For team edition, `echo.seat_ids` lists the seat IDs being renewed and the payload's top-level `seat_ids` mirrors them; the `subscribe_url` points to `/subscription/coding-plan-enterprise`.
72
+
73
+ Amount fields are always USD on BytePlus; `total_amount_cny` / `original_amount_cny` will never appear. There is intentionally **no `agreements` array**.
74
+
75
+ ## Return value (`--yes` / web redirect)
76
+
77
+ After adding `--yes`, the CLI does **not** invoke any renewal API. Instead:
78
+
79
+ ```json
80
+ {
81
+ "status": "payment_via_web",
82
+ "plan": "coding-plan-team",
83
+ "duration": 3,
84
+ "seat_ids": ["seat-001", "seat-002"],
85
+ "subscribe_url": "https://console.byteplus.com/ark/region:ark+ap-southeast-1/subscription/coding-plan-enterprise",
86
+ "message": "BytePlus balance-based auto-pay is not supported by arkcli yet. Open the subscribe_url above in the browser to complete the purchase on the BytePlus console.",
87
+ "next_step": "Ask the user to open <subscribe_url> in the browser and finish the purchase on the BytePlus subscription page. Do not rerun this command with --yes."
88
+ }
89
+ ```
90
+
91
+ `seat_ids` is populated only for team plans.
92
+
93
+ ## Failure semantics
94
+
95
+ BytePlus arkcli does not renew orders in-CLI, so the `payment_failed` envelope (which the Volc build emits when auto-renew fails) **does not exist here**. Failure modes are:
96
+
97
+ - **Validation error** (e.g. `--seat-ids is required for team plans`): normal error, exit code = 1. Fix the arguments and retry.
98
+ - **Auth / preflight error**: normal error, exit code = 1. Log in and retry. See [`../../arkcli-shared/SKILL.md`](../../arkcli-shared/SKILL.md).
99
+ - **Renewal failure on the web**: after the user opens `subscribe_url`, if the BytePlus web console rejects the renewal, the console will surface the failure. This is out of arkcli's control.
100
+
101
+ ## Common errors
102
+
103
+ | Error | Cause | Handling |
104
+ |---|---|---|
105
+ | `--plan must be one of ...` | Plan key is misspelled | Strictly use one of two choices |
106
+ | `--seat-ids is required for team plans` | Team seat IDs omitted | List the seat IDs to renew |
107
+ | `--seat-ids only applies to team plans` | Passed for personal edition | Remove `--seat-ids`; personal edition does not need it |
108
+ | `--seat-ids must contain at least one non-empty seat ID` | Empty string / commas only | Check the input |
109
+ | `--duration must be 1..12` | Out of range | Use 1–12 |
110
+
111
+ ## Notes
112
+
113
+ - **No in-CLI renewal**: BytePlus arkcli never invokes any Renew-trade API. The renewal always happens on the web console.
114
+ - Team `--seat-ids` are not deduplicated; duplicate IDs are resolved by the server using the final entry.
115
+ - Personal renewal **does not require querying InstanceID first**; the agreement-gate path automatically resolves it with `ListSubscribeTrade` for pricing/tier resolution. The user only needs `--plan`.
116
+ - Renewal duration is not constrained by existing expiration-time accumulation; `--duration` 1–12 is the per-call limit.
117
+ - Rerunning `plans renew --yes` is safe on BytePlus: each call is a pure web-redirect stub returning the same `subscribe_url`. It never charges the account.
118
+
119
+ ## References
120
+
121
+ - [arkcli-plans](../SKILL.md) -- Skill overview
122
+ - [`plans buy`](arkcli-plans-buy.md) -- Same web-redirect semantics
123
+ - [`plans get`](arkcli-plans-get.md) -- View expiration time after renewal
124
+ - [`plans team seat-list`](arkcli-plans-team-seat-list.md) -- List renewable team seats
125
+ - [arkcli-shared](../../arkcli-shared/SKILL.md)
@@ -0,0 +1,61 @@
1
+ # `plans team rotate-apikey`
2
+
3
+ Read [`../SKILL.md`](../SKILL.md) and
4
+ [`../../arkcli-shared/SKILL.md`](../../arkcli-shared/SKILL.md) first.
5
+
6
+ This is a destructive credential write. Every successfully rotated key becomes
7
+ invalid immediately, so confirm that all affected applications are ready to
8
+ receive their replacement keys before execution.
9
+
10
+ ## Syntax
11
+
12
+ ```bash
13
+ arkcli plans team rotate-apikey \
14
+ --seat-ids seat-001,seat-002 \
15
+ [--yes]
16
+ ```
17
+
18
+ BytePlus supports only the explicit administrator path:
19
+
20
+ - `--seat-ids` is required and accepts a comma-separated list.
21
+ - Omitting `--seat-ids` is a validation error; BytePlus does not perform an
22
+ implicit self-seat lookup.
23
+ - The backend resolves the Coding Plan Team subscription from each SeatID.
24
+
25
+ ## Safe workflow
26
+
27
+ 1. Identify every application using the affected keys.
28
+ 2. Prepare the approved secret destination and replacement rollout.
29
+ 3. Verify the exact scope with the read-only seat list:
30
+
31
+ ```bash
32
+ arkcli plans team seat-list --plan coding-plan-team
33
+ ```
34
+
35
+ `rotate-apikey` does not register `--dry-run` because the final workflow
36
+ depends on live subscription and credential state.
37
+ 4. Warn the user that old keys become invalid immediately and obtain explicit
38
+ confirmation.
39
+ 5. Execute the real rotation:
40
+
41
+ ```bash
42
+ arkcli plans team rotate-apikey \
43
+ --seat-ids seat-001,seat-002 \
44
+ --yes
45
+ ```
46
+
47
+ ## Output and partial failure
48
+
49
+ The structured result contains `success_count`, `failed_count`, `success`, and
50
+ `failed`. A batch may partially succeed. Inspect both arrays even when the
51
+ command exits nonzero.
52
+
53
+ `success[].api_key` is the new plaintext key. Never paste, log, or persist it
54
+ in chat. Move it directly to the approved secret destination, then refresh the
55
+ affected local profile if it still references the invalidated key:
56
+
57
+ ```bash
58
+ arkcli profile apikey refresh --profile <profile-name>
59
+ ```
60
+
61
+ Report only masked key suffixes, SeatIDs, counts, and failure reasons.
@@ -0,0 +1,147 @@
1
+ # plans team seat-assign
2
+
3
+ > **Prerequisite:** Read [`../../arkcli-shared/SKILL.md`](../../arkcli-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.
4
+
5
+ > **Write operation:** Modifies bindings between enterprise seats and sub-users. One `GrantSeats` call supports batches; the server returns per-item status (success and failure can coexist).
6
+
7
+ Bind Coding Plan enterprise-edition seats to IAM sub-users. The same Action supports the enterprise edition (`coding-plan-team`); the server infers the plan line from SeatID, so **Scene is not required**.
8
+
9
+ ## What if the employee's exact UserID is unknown
10
+
11
+ If you know only the employee username (or prefix), first resolve it with `arkcli iam userid`:
12
+
13
+ ```bash
14
+ # One prefix
15
+ arkcli iam userid --username ivan
16
+
17
+ # Query multiple employees at once
18
+ arkcli iam userid --username ivan,bob,carol
19
+ ```
20
+
21
+ Output format:
22
+ ```json
23
+ {
24
+ "queries": [
25
+ {
26
+ "query": "ivan",
27
+ "matches": [
28
+ {"user_id": "12345", "user_name": "ivan"},
29
+ {"user_id": "67890", "user_name": "ivanka"}
30
+ ]
31
+ }
32
+ ]
33
+ }
34
+ ```
35
+
36
+ - Strict **prefix matching**: `iv` does not match `kevin`; it matches only `ivan` / `ivanka`.
37
+ - All results are returned when one prefix has multiple matches, allowing you to choose.
38
+ - A query record is retained for zero matches, making script decisions easier.
39
+ - Omitting `--username` returns the current identity's UserID ("who am I").
40
+
41
+ Pass the resulting `user_id` to `seat-assign --bind`. This skips the IAM lookup below and saves one round trip.
42
+
43
+ ## Commands
44
+
45
+ ```bash
46
+ # Bind one seat (automatically calls IAM ListUsers to resolve UserName)
47
+ arkcli plans team seat-assign --plan coding-plan-team \
48
+ --bind seat-001=83144215
49
+
50
+ # Batch binding (repeat --bind)
51
+ arkcli plans team seat-assign --plan coding-plan-team \
52
+ --bind seat-001=83144215 \
53
+ --bind seat-002=83143634
54
+
55
+ # Explicitly specify UserName and skip IAM lookup (escape hatch when IAM permission is missing or to save a call)
56
+ arkcli plans team seat-assign --plan coding-plan-team \
57
+ --bind seat-001=83144215:ivan \
58
+ --bind seat-002=83143634:bob
59
+
60
+ # Custom project
61
+ arkcli plans team seat-assign --plan coding-plan-team \
62
+ --bind seat-001=83144215 \
63
+ --project-name my-project
64
+ ```
65
+
66
+ ## Parameters
67
+
68
+ | Parameter | Required | Type | Description |
69
+ |------|------|------|------|
70
+ | `--plan` | Yes | string | `coding-plan-team` |
71
+ | `--bind` | Yes | stringArray | Repeat for batch operations. Format: `seat-id=user-id` or `seat-id=user-id:user-name` |
72
+ | `--project-name` | No | string | Project name, default `default` |
73
+
74
+ > **`--bind`, not `--seat-id=...`:** The user's original spec used `--<seat-id>=<user-id>`, a dynamic flag name unsupported by cobra/pflag. It was changed to a repeatable fixed `--bind` flag with a value.
75
+
76
+ ### Three-part syntax / IAM lookup
77
+
78
+ `--bind` supports two forms:
79
+
80
+ | Form | Parsing | Behavior |
81
+ |---|---|---|
82
+ | `seat-001=83144215` | UserName left empty | The service layer automatically calls **BytePlus IAM `ListUsers`**, paginates through all sub-users in the account, and matches UserName by ID |
83
+ | `seat-001=83144215:ivan` | UserName explicit | Skips IAM lookup and passes the value directly to `GrantSeats` |
84
+
85
+ The server's `GrantSeats` strictly validates all three fields `{SeatID, UserID, UserName}` (**UserName must be non-empty**), so the CLI must first obtain UserName. IAM lookup is the default path. If STS credentials lack `iam:ListUsers` permission or you want to avoid the IAM round trip, use the `:user-name` escape hatch.
86
+
87
+ IAM lookup performs **one list-all + in-memory map cache**. Multiple bindings in the same seat-assign call reuse the same cache (not N round trips per binding).
88
+
89
+ ## Return value
90
+
91
+ > **Sensitive output:** `success[].api_key` is a one-time plaintext API key.
92
+ > Never quote, paste, persist, or echo its value in chat or logs. Tell the user
93
+ > only that the command returned a key and that they must save the local stdout
94
+ > securely. The `"sk-..."` value below is a redacted placeholder, not a real
95
+ > key.
96
+
97
+ ```json
98
+ {
99
+ "plan": "coding-plan-team",
100
+ "project_name": "default",
101
+ "success_count": 2,
102
+ "failed_count": 0,
103
+ "success": [
104
+ {
105
+ "seat_id": "seat-001",
106
+ "user_id": "83144215",
107
+ "api_key_sid": "apikey-...",
108
+ "api_key": "sk-..."
109
+ }
110
+ ],
111
+ "failed": []
112
+ }
113
+ ```
114
+
115
+ | Field | Description |
116
+ |------|------|
117
+ | `success[].api_key` | Plaintext APIKey after binding this seat; tell the user to save it immediately |
118
+ | `success[].api_key_sid` | Stable APIKey ID used to locate the resource for later rotation / deletion |
119
+ | `failed[].reason` | Server `FailedReason` passed through, typically `BindCountLimitExceeded` |
120
+
121
+ ## Failure semantics
122
+
123
+ **Partial failure** is a valid terminal state:
124
+ - stdout always contains the complete result (both success + failed arrays).
125
+ - When `failed_count > 0`, stderr adds a `grant_seats_partial` envelope and exit code = 5 (`ExitAPI`).
126
+ - When `failed_count == 0`, exit code = 0.
127
+
128
+ | Error | Cause | Handling |
129
+ |------|------|------|
130
+ | `--plan must be one of ...` | Misspelled or personal plan used | Use `coding-plan-team` |
131
+ | `--bind ... must be in the form seat-id=user-id` | Invalid format | Strictly use `seat-id=user-id` or `seat-id=user-id:user-name` |
132
+ | `--bind specifies SeatID %q more than once` | Same SeatID appears in multiple `--bind` flags | Server rejects it; client blocks first |
133
+ | `resolve UserName for UserID=...: IAM ListUsers ...: AccessDenied` | STS credentials lack IAM permission | Use the escape hatch: explicitly specify `--bind seat-id=user-id:user-name` |
134
+ | `failed_count > 0` + `BindCountLimitExceeded` | The sub-user already has N seats bound (limit reached) | Unbind first (unbind subcommand not yet implemented); frontend uses `RevokeSeats` |
135
+
136
+ ## Notes
137
+
138
+ - IAM lookup is a **full listing** (paginated retrieval of all IAM users in the account), triggered only by the first binding; subsequent lookups in the same call use memory.
139
+ - Defensive IAM lookup fallback: if the target ID is still not found after more than 10,000 entries, report an error (prevents endless pagination caused by a backend cursor loop).
140
+ - One seat **cannot simultaneously** bind multiple sub-users (server constraint). To change the user, unbind first, then assign (unbind = `RevokeSeats`, not yet exposed by the CLI).
141
+ - `success[].api_key` is the **newly generated plaintext APIKey**, effective immediately after binding. After the first response, neither console nor CLI can retrieve the original plaintext (only masked form), so save it immediately.
142
+
143
+ ## References
144
+
145
+ - [arkcli-plans](../SKILL.md) -- Skill overview
146
+ - [`plans team seat-list`](arkcli-plans-team-seat-list.md) -- List idle seats first
147
+ - [arkcli-shared](../../arkcli-shared/SKILL.md)
@@ -0,0 +1,100 @@
1
+ # plans team seat-list
2
+
3
+ > **Prerequisite:** Read [`../../arkcli-shared/SKILL.md`](../../arkcli-shared/SKILL.md) first to understand authentication, global parameters, and safety rules.
4
+
5
+ List Coding Plan **enterprise-edition** seats, supporting seven filtering dimensions + pagination. Read operation.
6
+
7
+ ## Commands
8
+
9
+ ```bash
10
+
11
+ # Coding Plan team edition
12
+ arkcli plans team seat-list --plan coding-plan-team
13
+
14
+ # Filter by seat tier
15
+ arkcli plans team seat-list --plan coding-plan-team --type lite
16
+
17
+ # Precisely query specified seats (up to 1,000 SeatIDs)
18
+ arkcli plans team seat-list --plan coding-plan-team --seat-ids seat-001,seat-002
19
+
20
+ # Filter by bound sub-user name
21
+ arkcli plans team seat-list --plan coding-plan-team --user-name yinfan.ivan
22
+
23
+ # View only idle seats (Idle=1)
24
+ arkcli plans team seat-list --plan coding-plan-team --seat-status 1
25
+
26
+ # View only Running billing status
27
+ arkcli plans team seat-list --plan coding-plan-team --billing-status 2
28
+
29
+ # Pagination
30
+ arkcli plans team seat-list --plan coding-plan-team --page-number 2 --page-size 50
31
+ ```
32
+
33
+ ## Parameters
34
+
35
+ | Parameter | Required | Type | Description |
36
+ |------|------|------|------|
37
+ | `--plan` | Yes | string | `coding-plan-team` (personal-edition plans are rejected) |
38
+ | `--type` | No | string | Tier filter: coding-plan-team accepts `lite/pro` |
39
+ | `--seat-ids` | No | string | Comma-separated exact filter; **maximum 1,000 per call** (client checks first) |
40
+ | `--user-name` | No | string | Filter by the bound sub-user name |
41
+ | `--seat-status` | No | int | 1=Idle (unbound) / 2=Active (bound). Other values are rejected |
42
+ | `--billing-status` | No | int | 1=Pending / 2=Running / 3=Expired / 4=Reclaimed |
43
+ | `--project-name` | No | string | Project name, default `default` |
44
+ | `--page-number` | No | int | Page number (≥1) |
45
+ | `--page-size` | No | int | Page size (≥1) |
46
+
47
+ Compatibility between `--plan` and `--type` is the same as `plans buy`.
48
+
49
+ ## Return value
50
+
51
+ ```json
52
+ {
53
+ "plan": "coding-plan-team",
54
+ "scene": "",
55
+ "total": 42,
56
+ "seats": [
57
+ {
58
+ "seat_id": "seat-20260608110804-gjrwr",
59
+ "tier": "medium",
60
+ "seat_status": "Active",
61
+ "billing_status": "Running",
62
+ "user_id": "83144215",
63
+ "user_name": "yinfan.ivan",
64
+ "project_name": "default",
65
+ "instance_id": "ins-...",
66
+ "order_time": 1700000000000,
67
+ "expired_time": 1800000000000,
68
+ "create_time": 1690000000000,
69
+ "update_time": 1700000000000
70
+ }
71
+ ]
72
+ }
73
+ ```
74
+
75
+ | Field | Description |
76
+ |------|------|
77
+ | `scene` | Empty string for coding-plan-team (the server defaults to coding_plan) |
78
+ | `total` | Total number matched by server-side filters (not necessarily the current page size) |
79
+ | `seat_status` | "Idle" / "Active" / "Unknown" (numeric enum translated into readable strings) |
80
+ | `billing_status` | "Pending" / "Running" / "Expired" / "Reclaimed" / "Unknown" |
81
+ | `user_id` / `user_name` | Bound sub-user identifiers (IAM `IdentityId` / `IdentityDetail`) |
82
+ | `*_time` | Epoch milliseconds |
83
+
84
+ For `coding-plan-team`, output `scene` is an empty string. This is expected; the server defaults an empty Scene to coding_plan.
85
+
86
+ ## Notes
87
+
88
+ - If the user asks "How many seats do I have?" without specifying a plan, first run `arkcli plans get` to see which team edition is held, then run `seat-list` for it.
89
+ - **This command lists only basic information** (SeatID / bound identity / billing status, and others). **To view usage for each seat** (5h/weekly/monthly percent + reset_at), use `arkcli usage seats --product <coding-plan-team> --with-usage`. It uses the same `ListSeatInfos` source and additionally joins `ListSeatAFPUsage` / `ListSeatInfoUsages`.
90
+ - Numeric enums (`--seat-status` / `--billing-status`) are explained in this reference. **Do not ask the user to consult documentation**; explain their meanings directly.
91
+ - `--seat-ids` is not deduplicated; duplicate IDs are resolved by the server using the final entry.
92
+ - `BillingStatus` is unfiltered by default (returns all states). The frontend BindSeatDrawer defaults to `[Running, Expired]`; the CLI is more "raw", so add `--billing-status` as needed.
93
+
94
+ ## References
95
+
96
+ - [arkcli-plans](../SKILL.md) -- Skill overview
97
+ - [`plans team seat-assign`](arkcli-plans-team-seat-assign.md) -- Bind sub-users to idle seats
98
+ - [`plans get`](arkcli-plans-get.md) -- First see which team plan is held
99
+ - [arkcli-usage](../../arkcli-usage/SKILL.md) -- Seat **usage** view (`usage seats --with-usage`), complementing this command's basic list
100
+ - [arkcli-shared](../../arkcli-shared/SKILL.md)
@@ -0,0 +1,178 @@
1
+ # Minimum arkcli-plans evaluation cases
2
+
3
+ Goal: verify stable behavior for triggers, write-operation guards, anti-triggers, and happy paths, while preventing common hallucinations (confusing personal/team, personal/enterprise APIKeys, and buy/renew).
4
+
5
+ ## 1) Trigger: view held plans
6
+
7
+ Input:
8
+
9
+ - "What plans am I currently subscribed to?"
10
+ - "Do I have Coding Plan?"
11
+ - "Show the plans under my account."
12
+
13
+ Expected behavior:
14
+
15
+ - Route to `arkcli-plans`.
16
+ - Recommend `arkcli plans get` (no parameters).
17
+ - **Do not** proactively call `plans buy` / `plans renew` unless the user explicitly asks to buy / renew.
18
+
19
+ ## 2) Write-operation guard: user urges immediate purchase
20
+
21
+ Input:
22
+
23
+ - "Buy me a Coding Plan lite immediately."
24
+
25
+ Expected behavior (BytePlus):
26
+
27
+ - Even when urged, first confirm `--plan` / `--type` / `--duration`, and `--quantity` for team edition.
28
+ - **The first call should omit `--yes`** to retrieve `total_amount_usd` + `subscribe_url` + `next_step` from the review gate.
29
+ - Display `total_amount_usd` and `original_amount_usd` to the user for transparency.
30
+ - Then present `subscribe_url` and instruct the user to open it in the browser to complete the purchase on the BytePlus console (the web page handles agreement UI + payment). Do **not** rerun with `--yes` expecting an in-CLI charge — BytePlus does not charge in-CLI; `--yes` also returns the same `payment_via_web` URL.
31
+
32
+ **Counterexample (failure):** The Agent fabricates a Volc-style agreement list or claims the CLI will charge the account (BytePlus arkcli never charges).
33
+
34
+ ## 2b) Review gate: user already said "agree"
35
+
36
+ Input:
37
+
38
+ - User says "just buy it directly, no need to show anything."
39
+
40
+ Expected behavior (BytePlus):
41
+
42
+ - Still show `total_amount_usd` + `subscribe_url`, briefly, before handing off. This is price transparency, not agreement acceptance.
43
+ - Clarify that the actual purchase happens on the BytePlus web page — the user will see full BytePlus legal terms and confirm there.
44
+
45
+ **Key counterexample:** The Agent claims to have "signed the agreement on behalf of the user" or claims to have "placed the order in the CLI" — neither ever happens on BytePlus.
46
+
47
+ ## 3) Anti-trigger: trying a model should not trigger buy
48
+
49
+ Input:
50
+
51
+ - "I want to try the performance of dola-seed-2.0-pro."
52
+
53
+ Expected behavior:
54
+
55
+ - Route to [`arkcli-chat`](../../arkcli-chat/SKILL.md) or [`arkcli-gen`](../../arkcli-gen/SKILL.md).
56
+ - **Do not** recommend `plans buy` (avoid creating billable resources for a trial user).
57
+ - **Do not** recommend `plans model-list` as the answer (that lists models belonging to a plan and does not match trial intent).
58
+
59
+ ## 4) Anti-trigger: token usage should not enter plans
60
+
61
+ Input:
62
+
63
+ - "How many tokens did I use today?"
64
+
65
+ Expected behavior:
66
+
67
+ - Route to [`arkcli-usage`](../../arkcli-usage/SKILL.md) → `usage stats --mine`.
68
+ - **Do not** use plans; plans concerns holdings / billing dimensions, not consumption.
69
+
70
+ ## 4) Happy path: bind team seats to sub-users
71
+
72
+ Prerequisites: logged in as an SSO sub-user, current account has purchased coding-plan-team, idle seats exist, and IAM sub-user IDs are available.
73
+
74
+ Input:
75
+
76
+ - "Bind seat-aaa to user ID 12345, and seat-bbb to user ID 67890."
77
+
78
+ Expected behavior:
79
+
80
+ - Recommend:
81
+ ```bash
82
+ arkcli plans team seat-assign --plan coding-plan-team \
83
+ --bind seat-aaa=12345 \
84
+ --bind seat-bbb=67890
85
+ ```
86
+ - Explain that the CLI automatically calls IAM `ListUsers` to resolve UserName. If STS lacks IAM permission, fall back to the three-part `seat-id=user-id:user-name`.
87
+ - Mention partial-failure semantics: stdout still contains `success` + `failed` arrays; a nonzero exit code does not mean complete failure.
88
+
89
+ ## 4b) Happy path: resolve UserID from username prefix, then bind
90
+
91
+ Input:
92
+
93
+ - "Bind seat seat-001 to ivan."
94
+ - "Our company has employees ivan and bob; assign one seat to each."
95
+
96
+ Expected behavior:
97
+
98
+ - **Do not fabricate user_id directly**.
99
+ - First recommend:
100
+ ```bash
101
+ arkcli iam userid --username ivan,bob
102
+ ```
103
+ Explain that matching is strict by prefix. When there are multiple matches, let the user select the exact UserID from the output.
104
+ - After obtaining user_id, use:
105
+ ```bash
106
+ arkcli plans team seat-assign --plan coding-plan-team \
107
+ --bind seat-001=<ivan-user-id> \
108
+ --bind seat-002=<bob-user-id>
109
+ ```
110
+ - If a prefix matches multiple users ("ivan" → "ivan" + "ivanka"), show candidates and ask the user to select. **Do not choose for the user.**
111
+
112
+ ## 5) Happy path: personal renewal
113
+
114
+ Input:
115
+
116
+ - "Renew Coding Plan for six months."
117
+
118
+ Expected behavior (BytePlus):
119
+
120
+ - First use `arkcli plans get` to verify that coding-plan (personal edition) is held.
121
+ - **Step 1**: Run `arkcli plans renew --plan coding-plan --duration 6` without `--yes` to retrieve `total_amount_usd` + `subscribe_url`.
122
+ - **Step 2**: Display the USD price to the user for transparency.
123
+ - **Step 3**: Present `subscribe_url` and ask the user to open it in the browser to complete the renewal on the BytePlus console.
124
+ - Do **not** claim the CLI has renewed the plan — BytePlus arkcli never renews in-CLI.
125
+
126
+ ## 6) Routing accuracy: distinguish personal vs team
127
+
128
+ Input:
129
+
130
+ - "Our company subscribed to Coding Plan; show me the seats."
131
+
132
+ Expected behavior:
133
+
134
+ - Use [`plans team seat-list`](arkcli-plans-team-seat-list.md), **not** `plans get`.
135
+ - Use `--plan coding-plan-team` (not `coding-plan`).
136
+
137
+ ## 7) Error diagnosis: insufficient IAM permission
138
+
139
+ Scenario: `seat-assign` reports `resolve UserName for UserID=...: IAM ListUsers ...: AccessDenied`.
140
+
141
+ Expected behavior:
142
+
143
+ - Explain accurately: the current STS credentials lack `iam:ListUsers` permission.
144
+ - Recommend the escape hatch: `--bind seat-id=user-id:user-name` (manually specify UserName and skip IAM lookup).
145
+ - **Do not** ask the user to switch accounts or log in to SSO again (that does not necessarily change IAM permissions).
146
+
147
+ ## 8) Happy path: query plan model specifications
148
+
149
+ Input:
150
+
151
+ - "What are the context windows and maximum input/output lengths of the Coding Plan models?"
152
+ - "Which Coding Plan models accept image or video input?"
153
+
154
+ Expected behavior:
155
+
156
+ - Use `arkcli plans model-list --plan <plan>` rather than switching to the global model catalog.
157
+ - Explain first that `models[]` contains `ark-code-latest` route targets and `direct_models[].model_name` contains directly invocable ModelNames.
158
+ - Read `context_window`, `max_input_tokens`, `max_completion_tokens`, `input_modalities`, and `load` from the relevant `models[]` or `direct_models[]` item.
159
+ - Explain accurately that `max_completion_tokens` is the maximum output-token length.
160
+ - When the interface omits a field, report that the specification is unavailable; do not infer it from the model name or overwrite it with another catalog.
161
+
162
+ Input:
163
+
164
+ - "Which Coding Plan names can I put directly in the model parameter?"
165
+
166
+ Expected behavior:
167
+
168
+ - Run `arkcli plans model-list --plan coding-plan --mode direct` so the unrelated LatestModel route-target interface is not queried.
169
+ - Return or cite only `direct_models[].model_name`; do not treat `models[].output_name` as a directly invocable ModelName.
170
+
171
+ Input:
172
+
173
+ - "Which models can ark-code-latest route to in my Coding Plan?"
174
+
175
+ Expected behavior:
176
+
177
+ - Run `arkcli plans model-list --plan coding-plan --mode routing` so the unrelated VirtualModelID interface is not queried.
178
+ - Read route candidates and current `selected` state only from `models[]`.