vm0-cli

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

VM0 CLI

VM0 CLI

Build and run AI agents in secure sandboxed environments using the VM0 command-line interface.
Official docs: https://docs.vm0.ai

使用VM0命令行界面在安全沙箱环境中构建和运行AI Agent。
官方文档:https://docs.vm0.ai

When to Use

适用场景

Use this skill when you need to:
  • Install and set up the VM0 CLI
  • Create and configure AI agent projects
  • Deploy agents to the VM0 platform
  • Run agents with prompts and inputs
  • Manage input files (volumes) and output files (artifacts)
  • View logs and usage statistics

当你需要以下操作时,可使用该工具:
  • 安装和配置VM0 CLI
  • 创建和配置AI Agent项目
  • 将Agent部署到VM0平台
  • 通过提示词和输入运行Agent
  • 管理输入文件(卷)和输出文件(制品)
  • 查看日志和使用统计数据

Prerequisites

前置条件

Installation

安装步骤

Install the VM0 CLI globally via npm:
bash
npm install -g @vm0/cli
Verify installation:
bash
vm0 --version
通过npm全局安装VM0 CLI:
bash
npm install -g @vm0/cli
验证安装:
bash
vm0 --version

Authentication

身份验证

Log in to your VM0 account:
bash
vm0 auth login
This opens a browser for authentication. After login, verify status:
bash
vm0 auth status
For CI/CD environments, get your API token:
bash
vm0 auth setup-token
Then set the environment variable:
bash
export VM0_TOKEN=vm0_live_your-api-key

登录你的VM0账户:
bash
vm0 auth login
这会打开浏览器进行身份验证。登录后,验证状态:
bash
vm0 auth status
对于CI/CD环境,获取你的API令牌:
bash
vm0 auth setup-token
然后设置环境变量:
bash
export VM0_TOKEN=vm0_live_your-api-key

Quick Start

快速开始

1. Initialize a Project

1. 初始化项目

Create a new VM0 project in the current directory:
bash
vm0 init
This creates a
vm0.yaml
configuration file interactively. For non-interactive mode:
bash
vm0 init --name my-agent
在当前目录创建一个新的VM0项目:
bash
vm0 init
这会以交互方式创建一个
vm0.yaml
配置文件。非交互模式:
bash
vm0 init --name my-agent

2. Configure the Agent

2. 配置Agent

Edit
vm0.yaml
to define your agent:
yaml
version: "1.0"

agents:
  my-agent:
    framework: claude-code
    instructions: AGENTS.md
    skills:
      - https://github.com/vm0-ai/vm0-skills/tree/main/github
    environment:
      DEBUG: "${{ vars.DEBUG }}"
      API_KEY: "${{ secrets.API_KEY }}"
编辑
vm0.yaml
来定义你的Agent:
yaml
version: "1.0"

agents:
  my-agent:
    framework: claude-code
    instructions: AGENTS.md
    skills:
      - https://github.com/vm0-ai/vm0-skills/tree/main/github
    environment:
      DEBUG: "${{ vars.DEBUG }}"
      API_KEY: "${{ secrets.API_KEY }}"

3. Deploy the Agent

3. 部署Agent

Deploy your agent configuration:
bash
vm0 compose vm0.yaml
Skip confirmation prompts with
-y
:
bash
vm0 compose vm0.yaml -y
部署你的Agent配置:
bash
vm0 compose vm0.yaml
使用
-y
跳过确认提示:
bash
vm0 compose vm0.yaml -y

4. Run the Agent

4. 运行Agent

Execute the agent with a prompt:
bash
vm0 run my-agent "Please analyze the codebase and suggest improvements"
Or use
cook
for one-click execution from
vm0.yaml
:
bash
vm0 cook "Analyze the code"

通过提示词执行Agent:
bash
vm0 run my-agent "Please analyze the codebase and suggest improvements"
或者使用
cook
命令从
vm0.yaml
一键执行:
bash
vm0 cook "Analyze the code"

Core Operations

核心操作

Running Agents

运行Agent

Basic run:
bash
vm0 run my-agent "Your prompt here"
Run with variables and secrets:
bash
vm0 run my-agent "Process data" --vars DEBUG=true --secrets API_KEY=xxx
Run with environment file:
bash
vm0 run my-agent "Process data" --env-file=.env.local
Load environment variables from a file. The file should contain
KEY=value
pairs (one per line). This is useful for local development when you don't want to use the
${{ secrets.* }}
syntax in
vm0.yaml
.
Example
.env.local
file:
bash
GH_TOKEN=github_pat_xxx
API_KEY=sk-xxx
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx
Run with artifact storage:
bash
vm0 run my-agent "Generate report" --artifact-name my-output
Run with input volumes:
bash
vm0 run my-agent "Process files" --volume-version input-data=latest
Enable verbose output:
bash
vm0 run my-agent "Hello" -v
Resume from checkpoint:
bash
vm0 run resume <checkpoint-id> "Continue the task"
Continue from session:
bash
vm0 run continue <session-id> "Next step"
基础运行:
bash
vm0 run my-agent "Your prompt here"
带变量和密钥运行:
bash
vm0 run my-agent "Process data" --vars DEBUG=true --secrets API_KEY=xxx
带环境文件运行:
bash
vm0 run my-agent "Process data" --env-file=.env.local
从文件加载环境变量。文件应包含
KEY=value
格式的键值对(每行一个)。这在本地开发中很有用,你无需在
vm0.yaml
中使用
${{ secrets.* }}
语法。
示例
.env.local
文件:
bash
GH_TOKEN=github_pat_xxx
API_KEY=sk-xxx
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/xxx
带制品存储运行:
bash
vm0 run my-agent "Generate report" --artifact-name my-output
带输入卷运行:
bash
vm0 run my-agent "Process files" --volume-version input-data=latest
启用详细输出:
bash
vm0 run my-agent "Hello" -v
从检查点恢复:
bash
vm0 run resume <checkpoint-id> "Continue the task"
从会话继续:
bash
vm0 run continue <session-id> "Next step"

One-Click Execution (cook)

一键执行(cook)

Run directly from
vm0.yaml
in current directory:
bash
vm0 cook "Your prompt"
Skip confirmation:
bash
vm0 cook -y "Your prompt"
Run with environment file:
bash
vm0 cook --env-file=.env.local "Your prompt"
Load environment variables from a file for the agent run. Combine with
-y
to skip confirmation:
bash
vm0 cook -y --env-file=.env.local "Your prompt"
Continue last session:
bash
vm0 cook continue "Follow up"
Resume from last checkpoint:
bash
vm0 cook resume "Continue"
View logs from last cook run:
bash
vm0 cook logs
直接从当前目录的
vm0.yaml
运行:
bash
vm0 cook "Your prompt"
跳过确认:
bash
vm0 cook -y "Your prompt"
带环境文件运行:
bash
vm0 cook --env-file=.env.local "Your prompt"
从文件加载环境变量用于Agent运行。结合
-y
跳过确认:
bash
vm0 cook -y --env-file=.env.local "Your prompt"
继续上一个会话:
bash
vm0 cook continue "Follow up"
从最后一个检查点恢复:
bash
vm0 cook resume "Continue"
查看上一次cook运行的日志:
bash
vm0 cook logs

Viewing Logs

查看日志

View agent events (default):
bash
vm0 logs <run-id>
View system logs:
bash
vm0 logs <run-id> --system
View metrics:
bash
vm0 logs <run-id> --metrics
View network logs:
bash
vm0 logs <run-id> --network
Filter by time:
bash
vm0 logs <run-id> --since 5m
vm0 logs <run-id> --since 2h
vm0 logs <run-id> --since 2024-01-15T10:30:00Z
Show last N entries:
bash
vm0 logs <run-id> --tail 20

查看Agent事件(默认):
bash
vm0 logs <run-id>
查看系统日志:
bash
vm0 logs <run-id> --system
查看指标:
bash
vm0 logs <run-id> --metrics
查看网络日志:
bash
vm0 logs <run-id> --network
按时间过滤:
bash
vm0 logs <run-id> --since 5m
vm0 logs <run-id> --since 2h
vm0 logs <run-id> --since 2024-01-15T10:30:00Z
显示最后N条记录:
bash
vm0 logs <run-id> --tail 20

Storage Management

存储管理

Volumes (Input Files)

卷(输入文件)

Volumes store input files that agents can read.
Initialize a volume (interactive):
bash
cd my-data-directory
vm0 volume init
Initialize a volume (non-interactive):
bash
cd my-data-directory
vm0 volume init --name my-data
Push local files to cloud:
bash
vm0 volume push
Pull cloud files to local:
bash
vm0 volume pull
Pull specific version:
bash
vm0 volume pull abc123de
Check volume status:
bash
vm0 volume status
List all volumes:
bash
vm0 volume list
Clone a remote volume:
bash
vm0 volume clone my-volume ./local-dir
卷用于存储Agent可以读取的输入文件。
初始化卷(交互模式):
bash
cd my-data-directory
vm0 volume init
初始化卷(非交互模式):
bash
cd my-data-directory
vm0 volume init --name my-data
将本地文件推送到云端:
bash
vm0 volume push
将云端文件拉取到本地:
bash
vm0 volume pull
拉取特定版本:
bash
vm0 volume pull abc123de
检查卷状态:
bash
vm0 volume status
列出所有卷:
bash
vm0 volume list
克隆远程卷:
bash
vm0 volume clone my-volume ./local-dir

Artifacts (Output Files)

制品(输出文件)

Artifacts store output files created by agents.
Initialize an artifact (interactive):
bash
cd my-output-directory
vm0 artifact init
Initialize an artifact (non-interactive):
bash
cd my-output-directory
vm0 artifact init --name my-output
Push local files to cloud:
bash
vm0 artifact push
Pull cloud files to local:
bash
vm0 artifact pull
Pull specific version:
bash
vm0 artifact pull abc123de
Check artifact status:
bash
vm0 artifact status
List all artifacts:
bash
vm0 artifact list
Clone a remote artifact:
bash
vm0 artifact clone my-artifact ./local-dir

制品用于存储Agent生成的输出文件。
初始化制品(交互模式):
bash
cd my-output-directory
vm0 artifact init
初始化制品(非交互模式):
bash
cd my-output-directory
vm0 artifact init --name my-output
将本地文件推送到云端:
bash
vm0 artifact push
将云端文件拉取到本地:
bash
vm0 artifact pull
拉取特定版本:
bash
vm0 artifact pull abc123de
检查制品状态:
bash
vm0 artifact status
列出所有制品:
bash
vm0 artifact list
克隆远程制品:
bash
vm0 artifact clone my-artifact ./local-dir

Agent Management

Agent管理

List Agents

列出Agent

bash
vm0 agent list
With details:
bash
vm0 agent list --verbose
bash
vm0 agent list
查看详细信息:
bash
vm0 agent list --verbose

Inspect Agent

检查Agent

View agent configuration:
bash
vm0 agent inspect my-agent
View specific version:
bash
vm0 agent inspect my-agent:abc123
查看Agent配置:
bash
vm0 agent inspect my-agent
查看特定版本:
bash
vm0 agent inspect my-agent:abc123

Clone Agent

克隆Agent

Download an agent's compose configuration to local directory:
bash
vm0 agent clone my-agent
Clone to a specific directory:
bash
vm0 agent clone my-agent ./my-project
This command:
  • Downloads compose configuration and saves as
    vm0.yaml
  • Downloads instructions file (e.g.,
    AGENTS.md
    ) if exists
  • Preserves environment variables with
    ${{ secrets.X }}
    syntax
  • Fails if destination directory already exists

将Agent的compose配置下载到本地目录:
bash
vm0 agent clone my-agent
克隆到指定目录:
bash
vm0 agent clone my-agent ./my-project
该命令会:
  • 下载compose配置并保存为
    vm0.yaml
  • 如果存在说明文件(如
    AGENTS.md
    )则一并下载
  • 保留使用
    ${{ secrets.X }}
    语法的环境变量
  • 如果目标目录已存在则执行失败

Usage Statistics

使用统计

View your usage statistics:
bash
vm0 usage
Filter by date range:
bash
vm0 usage --since 7d
vm0 usage --since 30d
vm0 usage --since 2024-01-01 --until 2024-01-31

查看你的使用统计数据:
bash
vm0 usage
按日期范围过滤:
bash
vm0 usage --since 7d
vm0 usage --since 30d
vm0 usage --since 2024-01-01 --until 2024-01-31

Model Provider Configuration

模型提供商配置

Manage LLM model providers for agent runs.
管理用于Agent运行的LLM模型提供商。

Supported Provider Types

支持的提供商类型

TypeDescription
anthropic-api-key
Anthropic API key (Claude models)
openrouter-api-key
OpenRouter API with auto model routing
moonshot-api-key
Moonshot AI (Kimi) API key
minimax-api-key
MiniMax API key
List providers:
bash
vm0 model-provider list
Setup a provider (interactive):
bash
vm0 model-provider setup
Setup a provider (non-interactive):
bash
vm0 model-provider setup --type anthropic-api-key --credential "sk-ant-xxx"
Set default provider:
bash
vm0 model-provider set-default anthropic-api-key
Delete a provider:
bash
vm0 model-provider delete anthropic-api-key
类型描述
anthropic-api-key
Anthropic API密钥(Claude模型)
openrouter-api-key
OpenRouter API,支持自动模型路由
moonshot-api-key
月之暗面AI(Kimi)API密钥
minimax-api-key
MiniMax API密钥
列出提供商:
bash
vm0 model-provider list
设置提供商(交互模式):
bash
vm0 model-provider setup
设置提供商(非交互模式):
bash
vm0 model-provider setup --type anthropic-api-key --credential "sk-ant-xxx"
设置默认提供商:
bash
vm0 model-provider set-default anthropic-api-key
删除提供商:
bash
vm0 model-provider delete anthropic-api-key

OpenRouter Provider

OpenRouter提供商

OpenRouter supports multiple model providers through a single API. Two modes available:
Auto mode (default): OpenRouter automatically routes to the best available model.
bash
vm0 model-provider setup --type openrouter-api-key --credential "sk-or-xxx"
Explicit model selection: Specify a model from supported list.
bash
vm0 model-provider setup --type openrouter-api-key --credential "sk-or-xxx" --model anthropic/claude-sonnet-4.5
Supported models include Claude (anthropic/claude-), Kimi (moonshotai/kimi-), DeepSeek (deepseek/), GLM (z-ai/glm-), MiniMax (minimax/), and Qwen (qwen/) series.

OpenRouter通过单一API支持多个模型提供商,提供两种模式:
自动模式(默认): OpenRouter自动路由到最佳可用模型。
bash
vm0 model-provider setup --type openrouter-api-key --credential "sk-or-xxx"
显式模型选择: 从支持的列表中指定模型。
bash
vm0 model-provider setup --type openrouter-api-key --credential "sk-or-xxx" --model anthropic/claude-sonnet-4.5
支持的模型包括Claude(anthropic/claude-)、Kimi(moonshotai/kimi-)、DeepSeek(deepseek/)、GLM(z-ai/glm-)、MiniMax(minimax/)和Qwen(qwen/)系列。

Secret Management

密钥管理

Store secrets remotely for agent runs. Secrets are for sensitive values (API keys, tokens) and are referenced in vm0.yaml as
${{ secrets.NAME }}
.
List secrets:
bash
vm0 secret list
Set a secret (interactive — prompts for value):
bash
vm0 secret set MY_API_KEY
Set a secret (non-interactive):
bash
vm0 secret set MY_API_KEY --body "sk-xxx-secret-value"
Set a secret with description:
bash
vm0 secret set MY_API_KEY --body "sk-xxx" --description "OpenAI API key for summarization"
Delete a secret:
bash
vm0 secret delete MY_API_KEY
Delete without confirmation:
bash
vm0 secret delete MY_API_KEY -y

为Agent运行远程存储密钥。密钥用于存储敏感值(API密钥、令牌),在vm0.yaml中通过
${{ secrets.NAME }}
引用。
列出密钥:
bash
vm0 secret list
设置密钥(交互模式 — 提示输入值):
bash
vm0 secret set MY_API_KEY
设置密钥(非交互模式):
bash
vm0 secret set MY_API_KEY --body "sk-xxx-secret-value"
设置带描述的密钥:
bash
vm0 secret set MY_API_KEY --body "sk-xxx" --description "OpenAI API key for summarization"
删除密钥:
bash
vm0 secret delete MY_API_KEY
无需确认直接删除:
bash
vm0 secret delete MY_API_KEY -y

Variable Management

变量管理

Store variables remotely for agent runs. Variables are for non-sensitive configuration and are referenced in vm0.yaml as
${{ vars.NAME }}
.
List variables:
bash
vm0 variable list
Set a variable:
bash
vm0 variable set DEBUG true
Set a variable with description:
bash
vm0 variable set ENV_NAME production --description "Target environment"
Delete a variable:
bash
vm0 variable delete DEBUG
Delete without confirmation:
bash
vm0 variable delete ENV_NAME -y

为Agent运行远程存储变量。变量用于非敏感配置,在vm0.yaml中通过
${{ vars.NAME }}
引用。
列出变量:
bash
vm0 variable list
设置变量:
bash
vm0 variable set DEBUG true
设置带描述的变量:
bash
vm0 variable set ENV_NAME production --description "Target environment"
删除变量:
bash
vm0 variable delete DEBUG
无需确认直接删除:
bash
vm0 variable delete ENV_NAME -y

vm0.yaml Reference

vm0.yaml 参考文档

Basic Structure

基本结构

yaml
version: "1.0"

agents:
  agent-name:
    framework: claude-code
    instructions: AGENTS.md
    skills:
      - https://github.com/vm0-ai/vm0-skills/tree/main/github
      - https://github.com/vm0-ai/vm0-skills/tree/main/slack
    environment:
      VAR_NAME: "value"
      SECRET_VAR: "${{ secrets.SECRET_NAME }}"
      CONFIG_VAR: "${{ vars.CONFIG_NAME }}"
yaml
version: "1.0"

agents:
  agent-name:
    framework: claude-code
    instructions: AGENTS.md
    skills:
      - https://github.com/vm0-ai/vm0-skills/tree/main/github
      - https://github.com/vm0-ai/vm0-skills/tree/main/slack
    environment:
      VAR_NAME: "value"
      SECRET_VAR: "${{ secrets.SECRET_NAME }}"
      CONFIG_VAR: "${{ vars.CONFIG_NAME }}"

Fields

字段说明

FieldDescription
version
Configuration version (currently "1.0")
agents
Map of agent definitions
framework
Agent framework (e.g.,
claude-code
)
instructions
Path to instructions file
skills
List of skill URLs to include
environment
Environment variables for the agent
字段描述
version
配置版本(当前为"1.0")
agents
Agent定义的映射
framework
Agent框架(例如
claude-code
instructions
说明文件的路径
skills
要包含的技能URL列表
environment
Agent的环境变量

Variable Syntax

变量语法

  • ${{ secrets.NAME }}
    - Sensitive values stored securely
  • ${{ vars.NAME }}
    - Non-sensitive configuration values
  • Direct values - Plain text values

  • ${{ secrets.NAME }}
    - 安全存储的敏感值
  • ${{ vars.NAME }}
    - 非敏感配置值
  • 直接值 - 纯文本值

Environment Information

环境信息

View system and environment details:
bash
vm0 info

查看系统和环境详情:
bash
vm0 info

Non-Interactive Mode (CI/CD)

非交互模式(CI/CD)

All commands support non-interactive mode for use in CI/CD pipelines, scripts, and automated environments. The CLI detects non-TTY environments (
process.stdout.isTTY === false
) and requires explicit flags for all inputs.
所有命令都支持非交互模式,适用于CI/CD流水线、脚本和自动化环境。CLI会检测非TTY环境(
process.stdout.isTTY === false
),并要求所有输入使用显式标志。

Authentication

身份验证

Set the
VM0_TOKEN
environment variable instead of interactive login:
bash
export VM0_TOKEN=vm0_live_your-api-key
设置
VM0_TOKEN
环境变量以替代交互式登录:
bash
export VM0_TOKEN=vm0_live_your-api-key

Command Reference

命令参考

CommandNon-Interactive FlagsNotes
vm0 init
--name <name>
Required in non-TTY
vm0 compose
-y, --yes
Skip new secrets confirmation
vm0 run
--env-file <file>
Load environment variables from file
vm0 cook
-y, --yes
,
--env-file <file>
Skip prompts; load env vars from file
vm0 volume init
--name <name>
Required in non-TTY
vm0 artifact init
--name <name>
Required in non-TTY
vm0 schedule init
--name
,
--frequency
,
--time
,
--prompt
All required;
--day
for weekly/monthly
vm0 schedule delete
-f, --force
Skip deletion confirmation
vm0 secret set
-b, --body <value>
Required in non-TTY
vm0 secret delete
-y, --yes
Skip confirmation
vm0 variable delete
-y, --yes
Skip confirmation
vm0 model-provider setup
--type <type> --credential <value>
Both required together
命令非交互标志说明
vm0 init
--name <name>
非TTY环境下必填
vm0 compose
-y, --yes
跳过新密钥确认
vm0 run
--env-file <file>
从文件加载环境变量
vm0 cook
-y, --yes
,
--env-file <file>
跳过提示;从文件加载环境变量
vm0 volume init
--name <name>
非TTY环境下必填
vm0 artifact init
--name <name>
非TTY环境下必填
vm0 schedule init
--name
,
--frequency
,
--time
,
--prompt
全部必填;每周/每月计划需加
--day
vm0 schedule delete
-f, --force
跳过删除确认
vm0 secret set
-b, --body <value>
非TTY环境下必填
vm0 secret delete
-y, --yes
跳过确认
vm0 variable delete
-y, --yes
跳过确认
vm0 model-provider setup
--type <type> --credential <value>
两者需同时提供

CI/CD Example

CI/CD示例

bash
undefined
bash
undefined

Set authentication

设置身份验证

export VM0_TOKEN=${{ secrets.VM0_TOKEN }}
export VM0_TOKEN=${{ secrets.VM0_TOKEN }}

Initialize project (non-interactive)

初始化项目(非交互模式)

vm0 init --name my-agent --force
vm0 init --name my-agent --force

Initialize storage (non-interactive)

初始化存储(非交互模式)

cd input-data && vm0 volume init --name input-data && cd .. cd artifact && vm0 artifact init --name artifact && cd ..
cd input-data && vm0 volume init --name input-data && cd .. cd artifact && vm0 artifact init --name artifact && cd ..

Deploy agent (skip confirmation)

部署Agent(跳过确认)

vm0 compose vm0.yaml -y
vm0 compose vm0.yaml -y

Run agent with environment file

带环境文件运行Agent

vm0 run my-agent --artifact-name artifact --env-file=.env.local "Execute the task"
undefined
vm0 run my-agent --artifact-name artifact --env-file=.env.local "Execute the task"
undefined

GitHub Actions Example

GitHub Actions示例

yaml
jobs:
  run-agent:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"

      - name: Install VM0 CLI
        run: npm install -g @vm0/cli

      - name: Run Agent
        env:
          VM0_TOKEN: ${{ secrets.VM0_TOKEN }}
        run: |
          vm0 compose vm0.yaml -y
          vm0 run my-agent --artifact-name output --env-file=.env "Generate daily report"
yaml
jobs:
  run-agent:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4

      - name: Setup Node.js
        uses: actions/setup-node@v4
        with:
          node-version: "20"

      - name: Install VM0 CLI
        run: npm install -g @vm0/cli

      - name: Run Agent
        env:
          VM0_TOKEN: ${{ secrets.VM0_TOKEN }}
        run: |
          vm0 compose vm0.yaml -y
          vm0 run my-agent --artifact-name output --env-file=.env "Generate daily report"

Model Provider Setup (Non-Interactive)

模型提供商设置(非交互模式)

bash
vm0 model-provider setup --type anthropic-api-key --credential "sk-ant-xxx"

bash
vm0 model-provider setup --type anthropic-api-key --credential "sk-ant-xxx"

Guidelines

使用指南

  1. Always authenticate first - Run
    vm0 auth login
    before using other commands
  2. Use
    vm0 init
    for new projects
    - Creates proper project structure
  3. Deploy before running - Run
    vm0 compose
    after modifying
    vm0.yaml
  4. Use volumes for input data - Push data files as volumes before running agents
  5. Check logs for debugging - Use
    vm0 logs
    to troubleshoot failed runs
  6. Use scopes for organization - Set appropriate scope for team collaboration

  1. 始终先进行身份验证 - 使用其他命令前先运行
    vm0 auth login
  2. 使用
    vm0 init
    创建新项目
    - 生成正确的项目结构
  3. 运行前先部署 - 修改
    vm0.yaml
    后运行
    vm0 compose
  4. 使用卷存储输入数据 - 运行Agent前将数据文件推送到卷中
  5. 查看日志进行调试 - 使用
    vm0 logs
    排查运行失败问题
  6. 使用作用域进行组织 - 为团队协作设置合适的作用域

Common Workflows

常见工作流

Deploy and Run Agent

部署并运行Agent

bash
undefined
bash
undefined

1. Initialize project

1. 初始化项目

vm0 init --name my-agent
vm0 init --name my-agent

2. Edit vm0.yaml and AGENTS.md

2. 编辑vm0.yaml和AGENTS.md

3. Deploy configuration

3. 部署配置

vm0 compose vm0.yaml
vm0 compose vm0.yaml

4. Run the agent

4. 运行Agent

vm0 run my-agent "Execute the task"
vm0 run my-agent "Execute the task"

5. Check logs if needed

5. 必要时查看日志

vm0 logs <run-id>
undefined
vm0 logs <run-id>
undefined

Provide Input Files to Agent

为Agent提供输入文件

bash
undefined
bash
undefined

1. Create and navigate to data directory

1. 创建并进入数据目录

mkdir input-data && cd input-data
mkdir input-data && cd input-data

2. Add your files

2. 添加你的文件

cp ~/documents/*.pdf .
cp ~/documents/*.pdf .

3. Initialize and push volume (use --name for non-interactive)

3. 初始化并推送卷(非交互模式使用--name)

vm0 volume init --name input-data vm0 volume push
vm0 volume init --name input-data vm0 volume push

4. Run agent with volume

4. 带卷运行Agent

cd .. vm0 run my-agent "Process the documents" --volume-version input-data=latest
undefined
cd .. vm0 run my-agent "Process the documents" --volume-version input-data=latest
undefined

Download Agent Output

下载Agent输出

bash
undefined
bash
undefined

1. List artifacts

1. 列出制品

vm0 artifact list
vm0 artifact list

2. Clone the artifact locally

2. 将制品克隆到本地

vm0 artifact clone my-output ./results
vm0 artifact clone my-output ./results

3. Or pull to existing directory

3. 或者拉取到现有目录

cd my-output-dir vm0 artifact pull

---
cd my-output-dir vm0 artifact pull

---

Troubleshooting

故障排查

Authentication Issues

身份验证问题

bash
undefined
bash
undefined

Check auth status

检查身份验证状态

vm0 auth status
vm0 auth status

Re-login if needed

必要时重新登录

vm0 auth logout vm0 auth login
undefined
vm0 auth logout vm0 auth login
undefined

Agent Not Found

Agent未找到

bash
undefined
bash
undefined

List available agents

列出可用Agent

vm0 agent list
vm0 agent list

Check if deployed

检查是否已部署

vm0 compose vm0.yaml
undefined
vm0 compose vm0.yaml
undefined

View Detailed Errors

查看详细错误

bash
undefined
bash
undefined

Use verbose mode

使用详细模式

vm0 run my-agent "prompt" -v
vm0 run my-agent "prompt" -v

Check system logs

检查系统日志

vm0 logs <run-id> --system
undefined
vm0 logs <run-id> --system
undefined