> ## Documentation Index
> Fetch the complete documentation index at: https://docs.venice.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Venice CLI

> 官方 Venice 命令行界面将聊天、web 搜索、图像生成、TTS、转录、视频和 embeddings 带到您的终端，并可选启用端到端加密。

[Venice CLI](https://github.com/veniceai/venice-cli) 是 Venice 的官方命令行界面。在您的终端中与 AI 模型聊天、生成图像、将文本转换为语音、转录音频、生成视频等等——全部可选启用端到端加密。

<Card title="GitHub: veniceai/venice-cli" icon="github" href="https://github.com/veniceai/venice-cli">
  以 [`veniceai-cli`](https://www.npmjs.com/package/veniceai-cli) 发布到 npm。MIT 许可。
</Card>

<CardGroup cols={3}>
  <Card title="隐私优先" icon="lock">
    可选的 E2EE 和 TEE 证明。无遥测，无浏览器跟踪。
  </Card>

  <Card title="全模态" icon="layer-group">
    聊天、搜索、图像、放大、TTS、转录、视频和 embeddings
  </Card>

  <Card title="可脚本化" icon="terminal">
    JSON 与原始输出、stdin 管道、以及 bash、zsh、fish 的 shell 补全
  </Card>
</CardGroup>

## 快速入门

<Steps>
  <Step title="安装 CLI">
    使用 npm 全局安装：

    ```bash theme={"system"}
    npm install -g veniceai-cli
    ```

    或者无需安装即可运行：

    ```bash theme={"system"}
    npx veniceai-cli chat 'Hello, world!'
    ```
  </Step>

  <Step title="获取 Venice API 密钥">
    从 [venice.ai/settings/api](https://venice.ai/settings/api) 生成。逐步说明请参阅 [API 密钥指南](/guides/getting-started/generating-api-key)。
  </Step>

  <Step title="配置您的密钥">
    运行交互式设置，并在提示时粘贴您的密钥，这样它就不会出现在您的 shell 历史或进程列表中：

    ```bash theme={"system"}
    venice config init
    ```

    或者改用环境变量：

    ```bash theme={"system"}
    export VENICE_API_KEY=YOUR_API_KEY
    ```
  </Step>

  <Step title="开始聊天">
    ```bash theme={"system"}
    venice chat "What is the meaning of life?"
    ```
  </Step>
</Steps>

<Note>
  需要 Node.js 18.0.0 或更高版本。`VENICE_API_KEY` 会覆盖存储在配置文件中的任何值。
</Note>

## 命令

| 命令                                    | 作用                                      |
| ------------------------------------- | --------------------------------------- |
| `venice chat <prompt>`                | 与任何 Venice 文本模型聊天，支持工具、characters 和流式输出 |
| `venice search <query>`               | 带 AI 综合和可选引用的 web 搜索                    |
| `venice image <prompt>`               | 从文本 prompt 生成图像                         |
| `venice upscale <file>`               | 将现有图像放大至 4×                             |
| `venice tts <text>`                   | 文本转语音，支持 35+ 种 voice                    |
| `venice transcribe <file>`            | 语音转文本，支持可选时间戳                           |
| `venice video <subcommand>`           | 排队、轮询并下载 AI 生成的视频                       |
| `venice embeddings <text>`            | 生成 embedding 向量                         |
| `venice models`                       | 列出并筛选实时模型目录                             |
| `venice tee <subcommand>`             | 获取并验证 TEE 证明                            |
| `venice config <subcommand>`          | 管理 API 密钥和默认值                           |
| `venice history <subcommand>`         | 列出、显示、导出或清除对话                           |
| `venice usage`                        | 显示一段时间内的 token 用量                       |
| `venice characters` / `venice voices` | 列出内置人设和 TTS voice                       |
| `venice completions <shell>`          | 生成 shell 补全                             |

### 聊天

```bash theme={"system"}
# Basic chat
venice chat "Explain quantum computing in simple terms"

# Use a specific model and system prompt
venice chat -m deepseek-v3.2 -s "You are a helpful coding assistant" "Write fizzbuzz in Python"

# Continue the previous conversation
venice chat --continue "What about the next step?"

# Function calling with built-in tools
venice chat -t calculator,datetime "What's 25 * 4.5, and what day is it?"

# JSON output for scripting
venice chat -f json "List 3 colors" | jq '.content'
```

常用聊天选项：

| 选项                       | 说明                                     |
| ------------------------ | -------------------------------------- |
| `-m, --model <model>`    | 要使用的模型（默认：`kimi-k2-5`）                 |
| `-s, --system <prompt>`  | 系统 prompt                              |
| `-c, --character <name>` | Character 人设                           |
| `-t, --tools <tools>`    | 逗号分隔的内置工具列表                            |
| `--continue`             | 继续上一次对话                                |
| `--web-search`           | 启用 web 搜索以获取最新信息                       |
| `--no-stream`            | 禁用流式输出                                 |
| `-f, --format <format>`  | 输出格式（`pretty`、`json`、`markdown`、`raw`） |
| `--e2ee` / `--no-e2ee`   | 强制启用或禁用端到端加密                           |
| `--tee-verify`           | 显示 TEE 证明详情                            |
| `-q, --quiet`            | 隐藏 E2EE/TEE 状态消息                       |

### Web 搜索

```bash theme={"system"}
venice search "Latest developments in fusion energy"
venice search -n 10 --citations "Best practices for TypeScript"
venice search --scrape "Company research on Anthropic"
```

### 图像生成与放大

```bash theme={"system"}
# Generate and save an image
venice image -o sunset.png "A serene mountain lake at sunset"

# Custom dimensions and model
venice image -w 1024 -h 768 -m flux-1-dev "Landscape photograph"

# Upscale an existing image 4×
venice upscale photo.jpg -s 4 -o photo_4x.jpg
```

### 文本转语音与转录

```bash theme={"system"}
# Speak with a specific voice
venice tts -v bf_emma -o greeting.mp3 "Good morning, everyone!"

# Pipe text in from stdin
echo "Text to speak" | venice tts -o output.mp3

# Transcribe audio with timestamps
venice transcribe -t recording.mp3

# Choose a model and language hint
venice transcribe -m openai/whisper-large-v3 -l es spanish_audio.mp3
```

### 视频生成

视频生成是异步的（基于队列）。

```bash theme={"system"}
# Queue a text-to-video generation
venice video generate -m veo3-fast-text-to-video "Cinematic sunset over mountains"

# Image-to-video with a reference image
venice video generate -m wan-2.6-image-to-video -i photo.jpg "The scene comes alive"

# Poll until done, then download
venice video status -w <queue_id>
venice video retrieve <queue_id> -o my_video.mp4

# List available video models
venice video models
```

### 模型与 embeddings

```bash theme={"system"}
# List and filter the catalog
venice models -t image
venice models --privacy
venice models --e2ee

# Generate embeddings
venice embeddings -o vectors.json "Text to embed"
```

### 配置

```bash theme={"system"}
# Interactive setup
venice config init

# Set and inspect values
venice config set default_model kimi-k2-5
venice config get default_model
venice config show
venice config path
```

| 键                     | 说明               |
| --------------------- | ---------------- |
| `api_key`             | 您的 Venice API 密钥 |
| `default_model`       | 默认聊天模型           |
| `default_image_model` | 默认图像生成模型         |
| `default_voice`       | 默认 TTS voice     |
| `output_format`       | 默认输出格式           |
| `show_usage`          | 请求后显示 token 用量   |

## 隐私：E2EE 与 TEE

Venice CLI 为隐私而构建。它不发送任何遥测数据，将您的 API 密钥以受限权限存储在本地，并支持 Venice 的机密计算模型。

* **端到端加密（E2EE）**：消息在客户端加密，仅在 TEE 内部解密，因此 Venice 无法读取您的数据。当模型声明具备该能力时，CLI 会自动启用 E2EE，为每个会话生成临时密钥对（ECDH + AES-GCM）。
* **TEE 证明**：在发送数据之前，以密码学方式验证模型运行在安全飞地中。

```bash theme={"system"}
# Discover confidential-compute models
venice models --e2ee
venice models --tee

# Chat with E2EE (auto-enabled for capable models)
venice chat -m <e2ee-capable-model> "Your private message here"

# TEE-only mode: verify attestation without encryption
venice chat -m <e2ee-capable-model> --no-e2ee "TEE verified, not encrypted"

# Fetch and verify attestation directly
venice tee attestation <model>
venice tee verify <model>
```

<Note>
  E2EE 模式会禁用工具和 web 搜索，以保持端到端加密。
</Note>

## 输出格式

| 格式         | 使用场景                |
| ---------- | ------------------- |
| `pretty`   | 用于交互使用的彩色格式化输出（默认）  |
| `json`     | 用于脚本和管道的机器可读 JSON   |
| `markdown` | 用于文档的 Markdown 格式输出 |
| `raw`      | 无修饰的纯文本，用于管道        |

CLI 会自动检测输出何时被管道传输，并切换到 `raw`。

```bash theme={"system"}
venice chat -f json "List items" | jq '.'
venice chat "Generate code" | pbcopy
```

## 资源

<CardGroup cols={2}>
  <Card title="GitHub" icon="github" href="https://github.com/veniceai/venice-cli">
    源代码、issues 和发布
  </Card>

  <Card title="npm" icon="npm" href="https://www.npmjs.com/package/veniceai-cli">
    `veniceai-cli`
  </Card>

  <Card title="Venice MCP Server" icon="plug" href="/guides/integrations/venice-mcp">
    将相同的 Venice 工具暴露给任何 MCP 宿主
  </Card>

  <Card title="Venice API 参考" icon="book" href="/api-reference/api-spec">
    完整的端点和参数文档
  </Card>
</CardGroup>
