Lightcone Session Control
Three tools for manual step-by-step control of a cloud computer. Use when you need precise multi-step interaction with a website or desktop application.
For simple "go do this" tasks, prefer lightcone-browse (the /lightcone-browse command) instead.
Tools
| Tool | Purpose |
|---|
| INLINECODE1 | Create a cloud computer (browser or desktop) |
| INLINECODE2 |
Send actions (click, type, scroll, screenshot, etc.) |
|
lightcone_session_close | Shut down the computer |
Workflow Pattern
CODEBLOCK0
lightconesessioncreate
| Parameter | Required | Description |
|---|
| INLINECODE4 | No | URL to navigate to immediately |
| INLINECODE5 |
No |
"browser" (default) or
"desktop" |
Returns: session ID (e.g., lc-a1b2c3d4) + screenshot of initial state.
lightconesessionaction
| Parameter | Required | Description |
|---|
| INLINECODE9 | Yes | Session ID from create |
| INLINECODE10 |
Yes | One of the actions below |
|
url | For navigate | Target URL |
|
x,
y | For click/scroll | Pixel coordinates |
|
text | For type | Text to enter |
|
keys | For hotkey | Comma-separated keys, e.g.
"Control,c" |
|
dx,
dy | For scroll | Scroll deltas |
|
seconds | For wait | Duration in seconds |
|
command | For debug | Shell command to run |
Actions
| Action | Returns | Use for |
|---|
| INLINECODE21 | Screenshot | See current state |
| INLINECODE22 |
Screenshot | Go to a URL |
|
click | Screenshot | Click at (x, y) |
|
doubleClick | Screenshot | Double-click at (x, y) |
|
rightClick | Screenshot | Right-click for context menu |
|
type | Screenshot | Enter text at cursor |
|
hotkey | Screenshot | Keyboard shortcut (e.g., Enter, Tab, Control+a) |
|
scroll | Screenshot | Scroll at position |
|
html | Page HTML | Extract page source |
|
wait | Screenshot | Pause before next action |
|
debug | Command output | Run shell command in the computer |
Example: Login and extract data
CODEBLOCK1
Tips
- - Always take a screenshot after navigation to see the current state before clicking
- Use coordinates from the screenshot to target clicks accurately
- Wait 2-3 seconds after navigation or form submission for pages to load
- Use
html action to extract structured data from the page - Always close sessions when done to free resources
Lightcone 会话控制
用于手动逐步控制云电脑的三个工具。当需要与网站或桌面应用进行精确的多步骤交互时使用。
对于简单的去执行这个任务,建议使用 lightcone-browse(/lightcone-browse 命令)。
工具
| 工具 | 用途 |
|---|
| lightconesessioncreate | 创建云电脑(浏览器或桌面) |
| lightconesessionaction |
发送操作(点击、输入、滚动、截图等) |
| lightcone
sessionclose | 关闭云电脑 |
工作流程模式
- 1. lightconesessioncreate → 获取会话 ID + 初始截图
- lightconesessionaction → 导航、点击、输入、截图(重复执行)
- lightconesessionclose → 关闭
lightconesessioncreate
| 参数 | 是否必需 | 描述 |
|---|
| url | 否 | 立即导航到的 URL |
| kind |
否 | browser(默认)或 desktop |
返回:会话 ID(例如 lc-a1b2c3d4)+ 初始状态截图。
lightconesessionaction
| 参数 | 是否必需 | 描述 |
|---|
| sessionId | 是 | 创建时返回的会话 ID |
| action |
是 | 下方列出的操作之一 |
| url | 用于导航 | 目标 URL |
| x, y | 用于点击/滚动 | 像素坐标 |
| text | 用于输入 | 要输入的文本 |
| keys | 用于快捷键 | 逗号分隔的按键,例如 Control,c |
| dx, dy | 用于滚动 | 滚动增量 |
| seconds | 用于等待 | 等待时长(秒) |
| command | 用于调试 | 要运行的 Shell 命令 |
操作
| 操作 | 返回内容 | 用途 |
|---|
| screenshot | 截图 | 查看当前状态 |
| navigate |
截图 | 导航到 URL |
| click | 截图 | 在 (x, y) 位置点击 |
| doubleClick | 截图 | 在 (x, y) 位置双击 |
| rightClick | 截图 | 右键点击以显示上下文菜单 |
| type | 截图 | 在光标位置输入文本 |
| hotkey | 截图 | 键盘快捷键(例如 Enter、Tab、Control+a) |
| scroll | 截图 | 在指定位置滚动 |
| html | 页面 HTML | 提取页面源码 |
| wait | 截图 | 在下一个操作前暂停 |
| debug | 命令输出 | 在云电脑中运行 Shell 命令 |
示例:登录并提取数据
步骤 1:在登录页面创建云电脑
lightconesessioncreate { url: https://app.example.com/login }
步骤 2:输入用户名(先点击邮箱输入框)
lightconesessionaction { sessionId: lc-..., action: click, x: 640, y: 300 }
lightconesessionaction { sessionId: lc-..., action: type, text: user@example.com }
步骤 3:输入密码
lightconesessionaction { sessionId: lc-..., action: hotkey, keys: Tab }
lightconesessionaction { sessionId: lc-..., action: type, text: password123 }
步骤 4:提交
lightconesessionaction { sessionId: lc-..., action: hotkey, keys: Return }
lightconesessionaction { sessionId: lc-..., action: wait, seconds: 3 }
步骤 5:截图确认登录成功
lightconesessionaction { sessionId: lc-..., action: screenshot }
步骤 6:提取页面内容
lightconesessionaction { sessionId: lc-..., action: html }
步骤 7:关闭
lightconesessionclose { sessionId: lc-... }
提示
- - 导航后务必截图,以便在点击前查看当前状态
- 使用截图中的坐标精确定位点击目标
- 导航或提交表单后等待 2-3 秒,确保页面加载完成
- 使用 html 操作从页面提取结构化数据
- 操作完成后务必关闭会话以释放资源