vefaas
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
Chinesevefaas
vefaas
本 skill 指导您使用 操作火山引擎 veFaaS,包括应用部署、函数管理、沙箱管理、环境变量、配置、诊断等在火山引擎函数服务控制台能执行的操作以及 OpenAPI 调用。
@volcengine/vefaas-cliThis skill guides you to use to operate Volcano Engine veFaaS, including operations available on the Volcano Engine Function Compute console such as application deployment, function management, sandbox management, environment variables, configuration, diagnosis, as well as OpenAPI calls.
@volcengine/vefaas-cli前置要求
Prerequisites
CRITICAL — 执行任何 veFaaS 操作前,MUST 先确认本机 CLI 版本 >= 0.2.7。
vefaasbash
vefaas --version
vefaas update --check如果命令不存在,或版本低于 ,必须先升级;如果 发现可更新版本,应提示用户升级后再继续:
0.2.7vefaas update --checkbash
npm i -g @volcengine/vefaas-cli@latest
vefaas --version文档检索能力(免登录)—— 可在终端检索 veFaaS 官方文档,无需登录、只读、不计费。这是本 skill 回答 veFaaS 概念/能力/选型/计费/SDK 用法等问题、以及写 SDK/OpenAPI 代码时的权威知识来源,详见下文「文档优先(doc-first)协议」。运行 确认可用;若不可用,先 升级 CLI。
vefaas docvefaas doc --helpvefaas updateCRITICAL — Before performing any veFaaS operations, MUST confirm that the local CLI version >= 0.2.7.
vefaasbash
vefaas --version
vefaas update --checkIf the command does not exist, or the version is lower than , you must upgrade first; if finds an available update, prompt the user to upgrade before continuing:
0.2.7vefaas update --checkbash
npm i -g @volcengine/vefaas-cli@latest
vefaas --versionDocument Retrieval Capability (No Login Required) — allows you to search Volcano Engine veFaaS official documents in the terminal, no login required, read-only, no charges. This is the authoritative knowledge source for this skill to answer questions about veFaaS concepts/capabilities/selection/billing/SDK usage, and to write SDK/OpenAPI code. See the "doc-first Protocol" below for details. Run to confirm availability; if unavailable, upgrade the CLI via first.
vefaas docvefaas doc --helpvefaas update适用场景
Applicable Scenarios
使用本 skill:
- 用户要把本地项目、网站、API 服务、Node.js 服务、Python 服务或静态站点部署到火山引擎 veFaaS。
- 用户要基于模板创建 serverless 应用,或把已有项目接入 veFaaS。
- 用户要查看控制台概览、线上访问地址、发布记录、日志或资源用量。
- 用户要配置环境变量、调整构建命令、启动命令、端口或资源配置,或删除已有应用。
- 用户要管理线上函数:创建、查看、发布、回滚、调用、日志、实例、任务、扩缩容策略、触发器、依赖、WebShell。
- 用户要拉取云端函数代码、本地修改后推送或重新部署。
- 用户要管理沙箱应用、沙箱实例、沙箱镜像、沙箱日志、沙箱 WebShell。
- 用户要排查部署失败、鉴权失败、框架检测错误、网关缺失、配置不一致或 OpenAPI 调用失败。
- 用户明确要调用 veFaaS OpenAPI action,或高阶命令无法覆盖目标操作。
- 用户第一次接触 veFaaS、不清楚它是什么或如何上手,需要 landing 引导(无需先登录即可开始)。
- 用户询问 veFaaS 的概念、能力边界、资源选型、计费、限额、触发器等问题,需要基于官方文档准确回答。
- 用户要在自己的代码里接入 veFaaS SDK(Go/Python/Node)或调用 OpenAPI,需要参照官方示例辅助开发。
Use this skill when:
- You want to deploy local projects, websites, API services, Node.js services, Python services or static sites to Volcano Engine veFaaS.
- You want to create serverless applications based on templates, or connect existing projects to veFaaS.
- You want to view console overview, online access addresses, release records, logs or resource usage.
- You want to configure environment variables, adjust build commands, startup commands, ports or resource configurations, or delete existing applications.
- You want to manage online functions: create, view, publish, rollback, call, logs, instances, tasks, scaling policies, triggers, dependencies, WebShell.
- You want to pull cloud function code, push local modifications or redeploy.
- You want to manage sandbox applications, sandbox instances, sandbox images, sandbox logs, sandbox WebShell.
- You want to troubleshoot issues such as deployment failures, authentication failures, framework detection errors, missing gateways, configuration inconsistencies or OpenAPI call failures.
- You explicitly need to call veFaaS OpenAPI actions, or high-level commands cannot cover the target operation.
- You are exposed to veFaaS for the first time, don't know what it is or how to get started, and need landing guidance (can start without logging in first).
- You ask questions about veFaaS concepts, capability boundaries, resource selection, billing, quotas, triggers, etc., and need accurate answers based on official documents.
- You want to access veFaaS SDK (Go/Python/Node) or call OpenAPI in your own code, and need to refer to official examples for assisted development.
资源心智模型
Resource Mental Model
- 函数是 veFaaS(函数服务)的核心资源,承载代码/镜像、版本、实例、日志、资源规格和扩缩容策略;函数实例通常由平台按流量和策略动态扩缩容。
- 应用是在函数基础上编排应用级逻辑后的产品形态,包含整体版本管理、APIG 触发器关联、Git 仓库自动触发部署等,用于让用户更方便地发布并访问应用。
- 沙箱是一种特殊/定制的函数,Function、Revision、Instance 模型与函数类似,但必须基于已预热镜像创建,适合代码沙箱、模型评测等秒级拉起隔离环境的场景;沙箱实例需要主动创建,并支持暂停、恢复、关闭和调整过期时间。
- 需要更细的资源关系、ID 使用规则或 CLI target 映射时,读取 CLI 与版本。
- Functions are the core resources of veFaaS (Function Compute), carrying code/images, versions, instances, logs, resource specifications and scaling policies; function instances are usually dynamically scaled by the platform according to traffic and policies.
- Applications are product forms after orchestrating application-level logic based on functions, including overall version management, APIG trigger association, Git repository automatic trigger deployment, etc., to help users publish and access applications more conveniently.
- Sandboxes are special/customized functions, with Function, Revision, Instance models similar to functions, but must be created based on pre-warmed images, suitable for scenarios such as code sandboxes, model evaluation that require second-level startup of isolated environments; sandbox instances need to be actively created, and support pause, resume, shutdown and adjustment of expiration time.
- For more detailed resource relationships, ID usage rules or CLI target mappings, read CLI and Version.
CRITICAL 工作流分流
CRITICAL Workflow Diversion
CRITICAL — 先判断用户意图是「知识类」还是「执行类」,再分流:
- 知识类(问概念/能力/选型/计费/限额;第一次用、要 landing 上手引导;要写 SDK/OpenAPI 集成代码)→ 走「文档优先(doc-first)工作流」:先用 检索官方文档,基于文档回答或写代码,通常无需登录。继续前 MUST 读取 文档检索与 doc-first。
vefaas doc - 执行类(部署、发布、回滚、调用、管理函数/应用/沙箱/网关等真实资源操作)→ 走下面对应的执行工作流。
- 混合类(如“帮我部署这个项目,顺便讲下计费”)→ 先用 doc-first 答疑,再走执行工作流。
下面是执行类工作流的分流规则:
CRITICAL — 用户说“部署项目 / 网站上线 / API 上线 / serverless 应用 / 查看访问地址”时,默认走应用工作流,不要直接创建函数。
应用工作流使用 、、、、、、、、、。继续前 MUST 读取 应用工作流。
vefaas initvefaas inspectvefaas linkvefaas deployvefaas domainsvefaas envvefaas configvefaas appvefaas overviewvefaas resourceCRITICAL — 只有用户给出已有函数 ID/name,或明确说“函数 / function / fn / 拉取函数代码 / 发布函数 / 回滚函数 / 函数日志”时,才走函数工作流。
函数工作流使用 、、、。继续前 MUST 读取 函数管理。
vefaas fn ...vefaas pullvefaas pushvefaas deploy --funcIdCRITICAL — 用户说“沙箱 / sandbox / 沙箱实例 / 临时实例 / 实例暂停恢复 kill / 沙箱镜像”时,走沙箱工作流。
沙箱工作流必须区分 sandbox application 与 sandbox instance;application ID 和 instance name 不能混用。继续前 MUST 读取 沙箱管理。
CRITICAL — 高阶命令能完成任务时,不要直接使用 。
vefaas api只有在高阶命令缺失、用户明确要求 OpenAPI、或需要底层 action 字段时,才使用 OpenAPI 工作流。继续前 MUST 读取 OpenAPI 调用,并先执行 查看参数结构。
vefaas api <Action> --helpCRITICAL — First determine whether the user's intention is "knowledge-based" or "execution-based", then divert:
- Knowledge-based (asking about concepts/capabilities/selection/billing/quotas; first-time use, need landing guidance; need to write SDK/OpenAPI integration code) → Follow the "doc-first Workflow": First use to search official documents, answer or write code based on documents, usually no login required. MUST read Document Retrieval and doc-first before proceeding.
vefaas doc - Execution-based (real resource operations such as deployment, release, rollback, call, management of functions/applications/sandboxes/gateways, etc.) → Follow the corresponding execution workflow below.
- Hybrid (e.g., "Help me deploy this project, and explain the billing by the way") → First use doc-first to answer questions, then follow the execution workflow.
The diversion rules for execution-based workflows are as follows:
CRITICAL — When the user says "deploy project / website launch / API launch / serverless application / view access address", default to the application workflow, do not directly create functions.
The application workflow uses , , , , , , , , , . MUST read Application Workflow before proceeding.
vefaas initvefaas inspectvefaas linkvefaas deployvefaas domainsvefaas envvefaas configvefaas appvefaas overviewvefaas resourceCRITICAL — Only follow the function workflow when the user provides an existing function ID/name, or explicitly says "function / fn / pull function code / release function / rollback function / function logs".
The function workflow uses , , , . MUST read Function Management before proceeding.
vefaas fn ...vefaas pullvefaas pushvefaas deploy --funcIdCRITICAL — Follow the sandbox workflow when the user says "sandbox / sandbox instance / temporary instance / instance pause resume kill / sandbox image".
The sandbox workflow must distinguish between sandbox application and sandbox instance; application ID and instance name cannot be used interchangeably. MUST read Sandbox Management before proceeding.
CRITICAL — Do not directly use when high-level commands can complete the task.
vefaas apiOnly use the OpenAPI workflow when high-level commands are missing, the user explicitly requests OpenAPI, or underlying action fields are required. MUST read OpenAPI Calls before proceeding, and first execute to view the parameter structure.
vefaas api <Action> --help必读 Reference 协议
Required Reference Protocol
执行对应任务前,MUST 读取对应 reference;不要只凭本文件的速查命令执行复杂操作。
| 场景 | 必读文件 |
|---|---|
| 答疑、landing 引导、查官方文档、写 SDK/OpenAPI 集成代码 | 文档检索与 doc-first |
| 安装、升级、确认 CLI 版本 | CLI 与版本 |
| 登录、检查凭据、恢复鉴权 | 认证与凭据 |
| 初始化模板、部署应用、link、inspect、domains、应用 env/config | 应用工作流 |
| 管理函数、代码、发布、回滚、日志、调用、配置、扩缩容 | 函数管理 |
| 函数 APIG 触发器、沙箱网关路由配置、APIG route 绑定与编辑 | 触发器与 APIG Route |
| 管理 sandbox application / instance | 沙箱管理 |
| 直接调用 veFaaS OpenAPI | OpenAPI 调用 |
| 排查失败、诊断环境 | 故障排查 |
Before performing corresponding tasks, MUST read the corresponding reference; do not execute complex operations only based on the quick reference commands in this document.
| Scenario | Required Document |
|---|---|
| Q&A, landing guidance, checking official documents, writing SDK/OpenAPI integration code | Document Retrieval and doc-first |
| Installation, upgrade, confirming CLI version | CLI and Version |
| Login, checking credentials, restoring authentication | Authentication and Credentials |
| Initializing templates, deploying applications, link, inspect, domains, application env/config | Application Workflow |
| Managing functions, code, release, rollback, logs, calls, configuration, scaling | Function Management |
| Function APIG triggers, sandbox gateway route configuration, APIG route binding and editing | Triggers and APIG Route |
| Managing sandbox application / instance | Sandbox Management |
| Directly calling veFaaS OpenAPI | OpenAPI Calls |
| Troubleshooting failures, diagnosing environment | Troubleshooting |
全局执行规则
Global Execution Rules
- 非交互式 AI/CI 场景中,目标明确时优先加 。
--yes - 需要解析输出时,优先使用 ,再配合
--output json、--jq、--fields。--limit - 不确定命令或 flag 时,先运行 ,不要猜参数。
vefaas <command> --help - 遇到凭据、项目配置、本地环境或 OpenAPI 连通性问题时,优先执行 。
vefaas doctor - 仅用于诊断;debug 输出和
--debug可能包含敏感请求/响应信息。~/.vefaas/logs/ - 不要把 Access Key ID、Secret Access Key、session token、OAuth/OIDC token、数据库连接串、value 明文回显给用户。
.env - 系列只读、免登录、不计费,可自由多次调用,不受下文「高风险操作协议」约束。agent 自用文档时一律加
vefaas doc,读-o json(正文)或data.markdown(搜索结果);仅当要把文档渲染给人看时才用默认 text 模式。data.results[]
- In non-interactive AI/CI scenarios, prioritize adding when the target is clear.
--yes - When parsing output is needed, prioritize using , then cooperate with
--output json,--jq,--fields.--limit - When unsure about commands or flags, first run , do not guess parameters.
vefaas <command> --help - When encountering issues with credentials, project configuration, local environment or OpenAPI connectivity, prioritize executing .
vefaas doctor - is only used for diagnosis; debug output and
--debugmay contain sensitive request/response information.~/.vefaas/logs/ - Do not echo Access Key ID, Secret Access Key, session token, OAuth/OIDC token, database connection strings, values in plaintext to users.
.env - The series is read-only, no login required, no charges, can be called freely multiple times, and is not restricted by the "High-Risk Operation Protocol" below. When the agent uses documents internally, always add
vefaas docand read-o json(body) ordata.markdown(search results); only use the default text mode when rendering documents for human viewing.data.results[]
文档优先(doc-first)协议
doc-first Protocol
涉及 veFaaS 的概念、能力、选型、计费、限额、SDK 用法、OpenAPI 参数时,MUST 先用 检索官方文档,再作答或写代码;禁止凭记忆直接回答这些具体事实。
vefaas doc- 高频主题用内置别名直达:(产品介绍)、
intro(快速入门)、quickstart、cli(SDK 概览)、sdk。SDK 各语言用子命令api。vefaas doc sdk go|python|node -o json - 长尾问题(计费、限额、触发器、网关、某具体功能)先 ,从
vefaas doc search <关键词> -o json按data.results[]+title(面包屑)挑最匹配的叶子文档,取其path,再documentId读vefaas doc --id <id> -o json。data.markdown - 答疑:答案不得超出 ;计费/限额/配额必须引用文档原文数值;回答末尾附出处
data.markdown与更新时间data.url。data.updatedTime - 写 SDK/OpenAPI 代码:先取官方示例()作骨架;用
vefaas doc sdk go|python|node -o json查该 Action 的请求字段(type + 说明 + 嵌套),可加vefaas doc sdk methods <Action> -o json拿请求示例。禁止凭记忆生成 SDK 调用。--lang - 命中目录节点会报 not-found(目录节点无正文)→ 回到 search 结果换一条更深的叶子文档。
vefaas doc --id - search 无结果时用 浏览目录;仍找不到则如实说明官方文档未覆盖,不要编造。
vefaas doc tree -o json
完整的三类场景工作流(landing / 答疑 / SDK 接入)见 文档检索与 doc-first。
When involving veFaaS concepts, capabilities, selection, billing, quotas, SDK usage, OpenAPI parameters, MUST first use to search official documents, then answer or write code; it is forbidden to directly answer these specific facts from memory.
vefaas doc- Use built-in aliases to directly access high-frequency topics: (product introduction),
intro(quick start),quickstart,cli(SDK overview),sdk. For SDKs in various languages, use the subcommandapi.vefaas doc sdk go|python|node -o json - For long-tail questions (billing, quotas, triggers, gateways, a specific function), first run , select the most matching leaf document from
vefaas doc search <keywords> -o jsonbydata.results[]+title(breadcrumbs), get itspath, then rundocumentIdto readvefaas doc --id <id> -o json.data.markdown - Q&A: The answer must not exceed ; billing/quotas/quotas must quote the original values from the document; attach the source
data.markdownand update timedata.urlat the end of the answer.data.updatedTime - Writing SDK/OpenAPI code: First take the official example () as the skeleton; use
vefaas doc sdk go|python|node -o jsonto check the request fields (type + description + nesting) of the Action, and addvefaas doc sdk methods <Action> -o jsonto get the request example. It is forbidden to generate SDK calls from memory.--lang - If hits a directory node, it will report not-found (directory nodes have no body) → Go back to the search results and choose a deeper leaf document.
vefaas doc --id - If no results are found in search, use to browse the directory; if still not found, truthfully state that the official document does not cover it, do not fabricate.
vefaas doc tree -o json
Complete workflows for three types of scenarios (landing / Q&A / SDK access) can be found in Document Retrieval and doc-first.
高风险操作协议
High-Risk Operation Protocol
以下操作会影响线上行为或销毁资源,执行前必须确认目标资源和用户意图:
- 删除应用、删除函数、删除沙箱应用、删除沙箱镜像。
- kill / pause / resume sandbox instance。
- 函数或沙箱 rollback。
- 修改生产环境触发器等。
处理规则:
- 先展示将要操作的资源标识(app/function/sandbox ID 或名称)和动作。
- 如果目标不唯一或来源只是用户口述名称,先 list/info 消歧。
- 用户明确确认后再执行;不要静默添加 绕过确认。
--yes - 用户拒绝或目标不清楚时停止,不要自行猜测替代目标。
应用删除特殊规则: 删除 veFaaS Application 前先执行 做前置检查。若检查发现 APIG/NAT/EIP 等共享或可能持续计费资源,非交互场景必须显式传 ;不要用全局 代替这类风险确认。只有用户明确接受跳过前置阻塞时,才使用 ,并说明关联资源可能不会被自动清理。
vefaas app delete --id <app-id> --check -o json--ack-shared-resources--yes--force --yesThe following operations will affect online behavior or destroy resources, and must confirm the target resources and user intentions before execution:
- Delete applications, delete functions, delete sandbox applications, delete sandbox images.
- kill / pause / resume sandbox instance.
- Rollback functions or sandboxes.
- Modify production environment triggers, etc.
Processing Rules:
- First display the resource identifier (app/function/sandbox ID or name) and action to be operated.
- If the target is not unique or only comes from the user's oral name, first use list/info to disambiguate.
- Execute only after the user explicitly confirms; do not silently add to bypass confirmation.
--yes - Stop if the user refuses or the target is unclear, do not guess alternative targets on your own.
Special Rules for Application Deletion: Before deleting a veFaaS Application, first execute for pre-check. If the check finds shared or potentially continuously billed resources such as APIG/NAT/EIP, in non-interactive scenarios, you must explicitly pass ; do not use the global instead of such risk confirmation. Only when the user explicitly accepts skipping the pre-block, use , and explain that associated resources may not be automatically cleaned up.
vefaas app delete --id <app-id> --check -o json--ack-shared-resources--yes--force --yes目标消歧规则
Target Disambiguation Rules
- App name、function name、sandbox name 可能不唯一;涉及写操作时,优先使用 ID。
- 只有名称没有 ID 时,先用 /
list/info/config list获取真实资源信息。config pull - 新应用部署需要 gateway name;先执行 。如果没有返回,停止并询问用户提供已有网关或先创建网关。
vefaas gateway list --first - 当前目录存在 时,不代表一定是用户想操作的目标;涉及线上写操作前先
.vefaas/config.json确认。vefaas config list - sandbox application ID 与 sandbox instance name 不可互换;实例操作前先 。
vefaas sandbox instance list --id <sandbox-application-id>
- App name, function name, sandbox name may not be unique; prioritize using ID for write operations.
- If only the name is available without ID, first use /
list/info/config listto obtain real resource information.config pull - Gateway name is required for new application deployment; first execute . If no result is returned, stop and ask the user to provide an existing gateway or create one first.
vefaas gateway list --first - The existence of in the current directory does not necessarily mean it is the target the user wants to operate; confirm via
.vefaas/config.jsonbefore performing online write operations.vefaas config list - Sandbox application ID and sandbox instance name cannot be interchanged; before instance operations, first execute .
vefaas sandbox instance list --id <sandbox-application-id>