> ## 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 skill 一次装到目标 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 skill（`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 trial（50K CU）
# 或者，如果已经有 key：
npx @chainstream-io/cli config set --key apiKey --value <your-api-key>
```

<Note>
  `npx skills add` 每次运行都会拉取最新版本，所以再次执行也就是更新。完整的 OpenClaw 安装流程（skill 校验、多 Agent 目标）见 [生态 → OpenClaw → Skills 安装](/cn/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 支付](/cn/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="/cn/docs/ai-agents/agent-skills/chainstream-data">
    数据查询：代币、市场、钱包
  </Card>

  <Card title="chainstream-graphql" icon="diagram-project" href="/cn/docs/ai-agents/agent-skills/chainstream-graphql">
    自定义 GraphQL 分析与 JOIN
  </Card>

  <Card title="chainstream-defi" icon="right-left" href="/cn/docs/ai-agents/agent-skills/chainstream-defi">
    DeFi 执行：兑换、发射台、交易
  </Card>

  <Card title="OpenClaw Skills 安装" icon="cube" href="/cn/docs/ecosystem/openclaw/skills-install">
    完整的 `npx skills` 参数与多 Agent 目标
  </Card>
</CardGroup>
