velocli-cloud
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseVeloCLI Cloud Operations
VeloCLI 云运维操作
Operational workflows for VeloDB Cloud using .
velocli使用的VeloDB Cloud运维工作流。
velocliSafety Policy
安全策略
- Read-only Cloud discovery (warehouse ls, cluster ls, ctx, auth status, billing, audit) may run proactively
- Mutating operations (pause, resume, resize, create, delete, reboot, upgrade, password set, public-access changes, PrivateLink register/unregister) require explicit user confirmation before execution
- Before asking for confirmation, show the target resource, current state if known, requested change, and user impact (billing, downtime, connectivity, or credential rotation)
- The confirmation must be a clear question such as "Proceed with ?" Do not treat the user's initial request as confirmation
<command> - Secret values (API keys, passwords) must stay in environment variables or user terminal — never output raw secrets
- 只读类云资源发现操作(warehouse ls、cluster ls、ctx、auth status、billing、audit)可主动执行
- 变更类操作(pause、resume、resize、create、delete、reboot、upgrade、password set、public-access changes、PrivateLink register/unregister)执行前需要用户明确确认
- 请求确认前,需展示目标资源、当前已知状态、请求的变更内容以及对用户的影响(计费、停机、连接性或凭证轮换)
- 确认必须是清晰的问题,例如「是否执行?」,不得将用户的初始请求视为确认
<command> - 敏感值(API密钥、密码)必须保留在环境变量或用户终端中——绝对不能输出原始敏感信息
Binary Detection
二进制文件检测
- env var → use that binary
VELOCLI_PATH - → use from PATH
command -v velocli - → only for explicit SelectDB environments
command -v sdbcli - If unavailable: do not stop at installation advice. Say commands cannot be executed in this environment, then still provide the full operational workflow, exact commands, confirmation gates, expected verification command, and install note. The user may have elsewhere or may need the workflow as the deliverable.
velocli
- 优先使用环境变量指定的二进制文件
VELOCLI_PATH - 通过从系统PATH中查找并使用
command -v velocli - 通过查找——仅用于明确的SelectDB环境
command -v sdbcli - 若无法找到:不要仅提供安装建议就停止。说明当前环境无法执行命令,同时仍需提供完整的运维工作流、准确命令、确认环节、预期的验证命令以及安装提示。用户可能在其他位置拥有,或者需要将工作流作为交付物。
velocli
Canonical Command Names
标准命令名称
Use only these command forms. Do not invent aliases.
| Correct | Never use |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
API host: | |
API host: | |
API host: | |
仅使用以下命令形式,不得自行创建别名。
| 正确命令 | 禁止使用 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
API主机: | |
API主机: | |
API主机: | |
Canonical Environment Variables
标准环境变量
Use these exact names. Do not invent alternatives.
| Correct | Never use |
|---|---|
| |
| |
| |
| |
| |
| |
| |
Config dir: | |
Note: is fine as a user-chosen shell variable name when storing the key for . The table above is about the stateless-mode env vars that velocli reads internally.
$VELO_CLOUD_API_KEY--api-key仅使用以下准确名称,不得自行创建替代名称。
| 正确名称 | 禁止使用 |
|---|---|
| |
| |
| |
| |
| |
| |
| |
配置目录: | |
注意:作为用户自定义的Shell变量名存储对应的密钥是允许的。上表仅针对velocli内部读取的无状态模式环境变量名。
$VELO_CLOUD_API_KEY--api-keyMutation Response Template
变更操作响应模板
Every mutating Cloud operation must follow this pattern:
- Read current state: run discovery command (e.g., ,
cluster get,public-access get)cluster ls - Show impact: target resource name/id, current state, requested change, user impact (billing, downtime, connectivity, credential rotation)
- Ask confirmation: "Proceed with ?" — a clear yes/no question. Do not treat the user's initial request as confirmation
<exact command> - Execute after confirmation: run the command
- Verify: run a read-only command to confirm the result (e.g., ,
cluster get,sql "SELECT 1")public-access get
所有云资源变更操作必须遵循以下流程:
- 读取当前状态:执行资源发现命令(例如、
cluster get、public-access get)cluster ls - 展示影响:目标资源名称/ID、当前状态、请求的变更内容、对用户的影响(计费、停机、连接性、凭证轮换)
- 请求确认:「是否执行?」——明确的是/否问题。不得将用户的初始请求视为确认
<exact command> - 确认后执行:运行命令
- 验证结果:执行只读命令确认操作结果(例如、
cluster get、sql "SELECT 1")public-access get
Core Workflows
核心工作流
Onboarding (New Cloud Environment)
新云环境入门
Read for the complete flow:
references/onboarding.md- Select API host (sandbox / international / China)
velocli auth add <name> --api-key $KEY --api-host <host> --mysql-password $PW- — verify API connectivity
velocli auth status --format json - Resolve warehouse/cluster context (may auto-pick or require )
cloud use - — verify data-plane connectivity
velocli sql "SELECT 1" --format json
完整流程请查阅:
references/onboarding.md- 选择API主机(sandbox / 国际版 / 中国版)
velocli auth add <name> --api-key $KEY --api-host <host> --mysql-password $PW- —— 验证API连通性
velocli auth status --format json - 解析数据仓库/集群上下文(可能自动选择或需要执行)
cloud use - —— 验证数据平面连通性
velocli sql "SELECT 1" --format json
Context Management
上下文管理
Read for warehouse→cluster hierarchy and resolution rules.
references/context.md- Always show current context before changing:
velocli cloud ctx --format json - Use explicit ,
--env,--warehousewhen ambiguity exists--cluster - Switching warehouse clears cluster (old cluster may not belong to new warehouse)
数据仓库→集群的层级关系和解析规则请查阅。
references/context.md- 修改上下文前务必先展示当前上下文:
velocli cloud ctx --format json - 存在歧义时,使用明确的、
--env、--warehouse参数--cluster - 切换数据仓库会清除集群上下文(旧集群可能不属于新数据仓库)
Cluster Lifecycle
集群生命周期
Read for pause/resume/resize/create/delete flows.
references/cluster-lifecycle.md- Use for user-facing workflows where completion feedback matters
--wait - All writes are idempotent (auto-generated RequestId)
- Read-only: ,
cluster getcluster ls - Mutating (confirm first): ,
pause,resume,reboot,resize,createdelete - If the binary is unavailable, still show: discovery command → confirmation question → mutation command → verification command. Do not bail out after "install velocli"
暂停/恢复/扩容/创建/删除流程请查阅。
references/cluster-lifecycle.md- 在面向用户的工作流中,若需要反馈完成状态,使用参数
--wait - 所有写入操作均具有幂等性(自动生成RequestId)
- 只读操作:、
cluster getcluster ls - 变更操作(需先确认):、
pause、resume、reboot、resize、createdelete - 若无法找到二进制文件,仍需展示:资源发现命令 → 确认问题 → 变更命令 → 验证命令。不得仅提示「安装velocli」就终止流程
Networking
网络配置
Read for public access and PrivateLink.
references/networking.md- Read current state first:
velocli cloud public-access get - Confirm before any policy change
公网访问和PrivateLink相关内容请查阅。
references/networking.md- 先读取当前状态:
velocli cloud public-access get - 任何策略变更前需确认
Billing & Audit
计费与审计
Read for cost queries and operational history.
references/billing-and-audit.md- Billing summary for cost questions (supports hour/day/month granularity)
- Audit ls for incident timelines, "who changed it" questions, and infrastructure change tracking
成本查询和操作历史相关内容请查阅。
references/billing-and-audit.md- 针对成本问题提供计费汇总(支持小时/天/月粒度)
- 使用audit ls查询事件时间线、「谁修改了配置」类问题以及基础设施变更追踪
Troubleshooting
故障排查
Read for common Cloud connection and configuration issues.
references/troubleshooting.md- For permission errors, distinguish read-only success from mutation failure and tell the user which operation likely needs elevated scope
- For API business-rule failures, do not retry the mutation blindly. Surface the API ,
code, andmessage, then inspect current state with read-only commandsrequest_id
常见云连接和配置问题请查阅。
references/troubleshooting.md- 针对权限错误,区分只读操作成功与变更操作失败的情况,并告知用户哪些操作可能需要更高权限
- 针对API业务规则失败,不得盲目重试变更操作。需展示API的、
code和message,然后通过只读命令检查当前状态request_id
Environment Switching
环境切换
Multiple ways to select environment (highest → lowest precedence):
- flag (per-command)
--env <name> - environment variable (per-session)
VELO_ENV - (persistent)
velocli use <name> - fallback:
default
选择环境的多种方式(优先级从高到低):
- 命令级别的参数
--env <name> - 会话级别的环境变量
VELO_ENV - 持久化的命令
velocli use <name> - fallback:环境
default