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

# OpenCode

> 在 OpenCode 中安装 Glasser Skill，登录并完成首次请求。

将 OpenCode 连接到 Glasser，为工作获取公司、人员、网页和市场数据。需要能够访问终端和网络的本地会话。

**1. 打开 Agent**

在本地项目目录运行 `opencode`，或在 OpenCode 桌面应用中打开本地会话。使用默认的 Build Agent，以便 OpenCode 执行命令。

**2. 请 Agent 安装 Skill**

在对话中粘贴：

```text wrap theme={null}
set up https://glasser.ai/SKILL.md
```

Agent 应保存 Skill，并安装或更新 Glasser CLI。客户端提示时，批准所需的文件和安装操作。如果尚未安装 Node.js 22 或更高版本，请先让 Agent 协助安装，再继续。

**3. 登录 Glasser**

Agent 会启动 `glasser login`，并显示浏览器链接和八位验证码。打开链接，登录或创建账号，确认验证码一致后，授权访问 Glasser 工作空间。如有提示，请先创建工作空间。

返回对话，让 Agent 完成余额检查。CLI 将 API Key 保存在本机，无需复制到对话中。已有有效登录状态时，可以跳过此步骤。

**4. 在新对话中检查**

新建会话，让客户端发现已保存的 Skill，然后粘贴：

```text wrap theme={null}
Use the installed Glasser Skill to check my available balance. Do not make any paid Runs.
```

检查成功会返回余额。如果 Agent 找不到 Skill，请让它检查 `~/.config/opencode/skills/glasser/SKILL.md`，然后重启客户端。余额为零也表示登录成功；付费 Run 前，请在 [Glasser 控制台](https://app.glasser.ai?locale=zh-CN)充值。

## 尝试首次请求

```text wrap theme={null}
Use Glasser to find recent news about Stripe. Show me the data you can retrieve and the price, then wait for my approval before any paid Run.
```

批准后，Agent 即可获取数据，并报告结果和费用。

Skill 保存位置和权限见 [OpenCode Skills 文档](https://opencode.ai/docs/skills/)。


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.