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

# 技能安裝

> 在 Cursor、Claude Code、ClawHub 等平臺上安裝 ChainStream Agent 技能

## 安裝方式

ChainStream 技能可以透過多種渠道安裝，取決於你的 Agent 平臺。其中 `npx skills add` 是最快的方式——一條命令，跨 Cursor、Claude Code、Codex、OpenCode、OpenClaw 通用。

| 方式                                      | 功能                                      | 安裝時間   |
| --------------------------------------- | --------------------------------------- | ------ |
| [`npx skills add`（推薦）](#npx-skills-add) | 跨平臺安裝器：一次性把三個 ChainStream 技能新增到目標 Agent | 約 20 秒 |
| [ClawHub](#clawhub)                     | 透過 `openclaw skills install` 從市場安裝      | 約 30 秒 |
| [Cursor](#cursor)                       | 克隆倉庫 + `.cursor-plugin/` 自動發現           | 約 1 分鐘 |
| [Claude Code](#claude-code)             | `/plugin install chainstream`           | 約 30 秒 |
| [Codex](#codex)                         | Git 克隆 + 軟鏈到 `~/.agents/skills/`        | 約 1 分鐘 |
| [OpenCode](#opencode)                   | Git 克隆 + 軟鏈到 `~/.agents/skills/`        | 約 1 分鐘 |
| [Gemini CLI](#gemini-cli)               | `gemini extensions install`             | 約 30 秒 |

***

## `npx skills add`（推薦）

一條命令把三個 ChainStream 技能（`chainstream-data`、`chainstream-graphql`、`chainstream-defi`）全部裝進目標 Agent。用 `-a <agent>` 指定 Agent。

<Tabs>
  <Tab title="Cursor">
    ```bash theme={null}
    npx skills add chainstream-io/skills -a cursor
    ```
  </Tab>

  <Tab title="Claude Code">
    ```bash theme={null}
    npx skills add chainstream-io/skills -a claude-code
    ```
  </Tab>

  <Tab title="OpenClaw">
    ```bash theme={null}
    npx skills add chainstream-io/skills -a openclaw
    ```
  </Tab>

  <Tab title="Codex">
    ```bash theme={null}
    npx skills add chainstream-io/skills -a codex
    ```
  </Tab>

  <Tab title="OpenCode">
    ```bash theme={null}
    npx skills add chainstream-io/skills -a opencode
    ```
  </Tab>
</Tabs>

安裝後配置 API Key，讓 CLI 和 MCP 工具可用：

```bash theme={null}
npx @chainstream-io/cli login                               # 创建钱包 + 获取 nano 试用（50K CU）
# 或者，如果已有 API Key：
npx @chainstream-io/cli config set --key apiKey --value <your-api-key>
```

<Note>
  `npx skills add` 每次都會拉取最新版本，所以重跑它也就等於升級。完整的 OpenClaw 安裝流程（技能校驗、多 Agent 目標）見[生態 → OpenClaw → 技能安裝](/zh-Hant/docs/ecosystem/openclaw/skills-install)。
</Note>

***

## ClawHub

ChainStream 技能已釋出在 [ClawHub](https://clawhub.ai)（OpenClaw 技能市場）。

| 技能                  | ClawHub 地址                                                               | 版本 |
| ------------------- | ------------------------------------------------------------------------ | -- |
| chainstream-data    | [clawhub.ai/chainstream-data](https://clawhub.ai/chainstream-data)       | 最新 |
| chainstream-graphql | [clawhub.ai/chainstream-graphql](https://clawhub.ai/chainstream-graphql) | 最新 |
| chainstream-defi    | [clawhub.ai/chainstream-defi](https://clawhub.ai/chainstream-defi)       | 最新 |

```bash theme={null}
# 通过 ClawHub CLI 安装
openclaw skills install chainstream-data
openclaw skills install chainstream-graphql
openclaw skills install chainstream-defi
```

或在 ClawHub 網頁上點選 **Install** 並按照指引操作。

***

## Cursor

技能透過 skills 倉庫中的 `.cursor-plugin/plugin.json` 配置自動發現。

<Steps>
  <Step title="克隆 skills 倉庫">
    ```bash theme={null}
    git clone https://github.com/chainstream-io/skills.git
    ```
  </Step>

  <Step title="在 Cursor 中開啟">
    在 Cursor 中開啟克隆的 `skills/` 目錄。`.cursor-plugin/plugin.json` 會讓 Cursor 自動載入技能。
  </Step>

  <Step title="配置 API Key">
    設定 API Key 用於 CLI 和 MCP 訪問：

    ```bash theme={null}
    npx @chainstream-io/cli config set --key apiKey --value <your-api-key>
    ```
  </Step>

  <Step title="開始使用">
    向 AI 助手提問：

    ```
    搜索 Solana 上的 meme 代币
    <token_address> 安全吗？
    用 0.1 SOL 兑换 <token_address>
    ```
  </Step>
</Steps>

<Note>
  Cursor 市場外掛即將釋出。屆時可直接從 Cursor 設定 > 擴充套件中安裝。
</Note>

***

## Claude Code

```bash theme={null}
/plugin install chainstream
```

skills 倉庫中的 `.claude-plugin/plugin.json` 提供了 Claude Code 的外掛後設資料。

<Note>
  Claude Code 市場外掛即將釋出。屆時可直接從 Claude Code 外掛商店安裝。
</Note>

***

## Codex

<Steps>
  <Step title="克隆倉庫">
    ```bash theme={null}
    git clone https://github.com/chainstream-io/skills.git ~/.agents/skills/chainstream
    ```
  </Step>

  <Step title="按照說明配置">
    參見克隆倉庫中 `.codex/INSTALL.md` 的說明。
  </Step>
</Steps>

***

## OpenCode

<Steps>
  <Step title="克隆倉庫">
    ```bash theme={null}
    git clone https://github.com/chainstream-io/skills.git ~/.agents/skills/chainstream
    ```
  </Step>

  <Step title="按照說明配置">
    參見克隆倉庫中 `.opencode/INSTALL.md` 的說明。
  </Step>
</Steps>

***

## Gemini CLI

```bash theme={null}
gemini extensions install https://github.com/chainstream-io/skills
```

倉庫根目錄的 `gemini-extension.json` 配置 Gemini CLI 載入上下文檔案。

***

## MCP Server 配置

技能與 ChainStream MCP Server 配合使用效果最佳。將以下配置新增到你的 MCP 客戶端：

<Tabs>
  <Tab title="Cursor / VS Code">
    ```json theme={null}
    {
      "mcpServers": {
        "chainstream": {
          "url": "https://mcp.chainstream.io/mcp",
          "headers": { "X-API-KEY": "<your-api-key>" }
        }
      }
    }
    ```
  </Tab>

  <Tab title="Claude Desktop">
    新增到 `~/Library/Application Support/Claude/claude_desktop_config.json`（macOS）或 `%APPDATA%\Claude\claude_desktop_config.json`（Windows）：

    ```json theme={null}
    {
      "mcpServers": {
        "chainstream": {
          "url": "https://mcp.chainstream.io/mcp",
          "headers": { "X-API-KEY": "<your-api-key>" }
        }
      }
    }
    ```
  </Tab>
</Tabs>

<Note>
  在 [ChainStream Dashboard](https://app.chainstream.io) 獲取 API Key，或透過 [x402 / MPP 支付](/zh-Hant/docs/platform/billing-payments/x402-payments) 購買。
</Note>

***

## 驗證安裝

安裝後，用簡單查詢測試：

```bash theme={null}
# 通过 CLI
npx @chainstream-io/cli token search --keyword PUMP --chain sol

# 通过 AI 助手（如果技能已加载）
# 提问："搜索 Solana 上的 PUMP 代币"
```

## 下一步

<CardGroup cols={2}>
  <Card title="chainstream-data" icon="magnifying-glass" href="/zh-Hant/docs/ai-agents/agent-skills/chainstream-data">
    資料查詢能力：代幣、市場、錢包
  </Card>

  <Card title="chainstream-graphql" icon="diagram-project" href="/zh-Hant/docs/ai-agents/agent-skills/chainstream-graphql">
    自定義 GraphQL 分析與 JOIN
  </Card>

  <Card title="chainstream-defi" icon="right-left" href="/zh-Hant/docs/ai-agents/agent-skills/chainstream-defi">
    DeFi 執行：兌換、發射臺、交易
  </Card>

  <Card title="OpenClaw 技能安裝" icon="cube" href="/zh-Hant/docs/ecosystem/openclaw/skills-install">
    `npx skills` 完整引數與多 Agent 目標
  </Card>
</CardGroup>
