vibe-check

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

Vibium Browser Automation — CLI Reference

Vibium Browser Automation — CLI 参考文档

The
vibe-check
CLI automates Chrome via the command line. The browser auto-launches on first use (daemon mode keeps it running between commands).
vibe-check navigate <url> → vibe-check text → vibe-check screenshot -o shot.png
vibe-check
CLI 工具可通过命令行自动化控制Chrome浏览器。首次使用时浏览器会自动启动(daemon模式可让浏览器在命令之间保持运行状态)。
vibe-check navigate <url> → vibe-check text → vibe-check screenshot -o shot.png

Commands

命令列表

Navigation

导航相关

  • vibe-check navigate <url>
    — go to a page
  • vibe-check url
    — print current URL
  • vibe-check title
    — print page title
  • vibe-check navigate <url>
    — 跳转到指定页面
  • vibe-check url
    — 打印当前页面URL
  • vibe-check title
    — 打印当前页面标题

Reading Content

内容读取

  • vibe-check text
    — get all page text
  • vibe-check text "<selector>"
    — get text of a specific element
  • vibe-check html
    — get page HTML (use
    --outer
    for outerHTML)
  • vibe-check find "<selector>"
    — element info (tag, text, bounding box)
  • vibe-check find-all "<selector>"
    — all matching elements (
    --limit N
    )
  • vibe-check eval "<js>"
    — run JavaScript and print result
  • vibe-check screenshot -o file.png
    — capture screenshot
  • vibe-check text
    — 获取页面全部文本内容
  • vibe-check text "<selector>"
    — 获取指定元素的文本内容
  • vibe-check html
    — 获取页面HTML代码(使用
    --outer
    参数可获取outerHTML)
  • vibe-check find "<selector>"
    — 获取元素信息(标签、文本、边界框)
  • vibe-check find-all "<selector>"
    — 获取所有匹配元素(可使用
    --limit N
    限制数量)
  • vibe-check eval "<js>"
    — 运行JavaScript代码并打印结果
  • vibe-check screenshot -o file.png
    — 截取屏幕并保存

Interaction

交互操作

  • vibe-check click "<selector>"
    — click an element
  • vibe-check type "<selector>" "<text>"
    — type into an input
  • vibe-check hover "<selector>"
    — hover over an element
  • vibe-check scroll [direction]
    — scroll page (
    --amount N
    ,
    --selector
    )
  • vibe-check keys "<combo>"
    — press keys (Enter, Control+a, Shift+Tab)
  • vibe-check select "<selector>" "<value>"
    — pick a dropdown option
  • vibe-check click "<selector>"
    — 点击指定元素
  • vibe-check type "<selector>" "<text>"
    — 在指定输入框中输入文本
  • vibe-check hover "<selector>"
    — 悬浮在指定元素上
  • vibe-check scroll [direction]
    — 滚动页面(可使用
    --amount N
    设置滚动量,
    --selector
    指定滚动元素)
  • vibe-check keys "<combo>"
    — 按下指定按键组合(如Enter、Control+a、Shift+Tab)
  • vibe-check select "<selector>" "<value>"
    — 选择下拉菜单中的指定选项

Waiting

等待操作

  • vibe-check wait "<selector>"
    — wait for element (
    --state visible|hidden|attached
    ,
    --timeout ms
    )
  • vibe-check wait "<selector>"
    — 等待指定元素加载完成(可使用
    --state visible|hidden|attached
    设置等待状态,
    --timeout ms
    设置超时时间)

Tabs

标签页管理

  • vibe-check tabs
    — list open tabs
  • vibe-check tab-new [url]
    — open new tab
  • vibe-check tab-switch <index|url>
    — switch tab
  • vibe-check tab-close [index]
    — close tab
  • vibe-check tabs
    — 列出所有打开的标签页
  • vibe-check tab-new [url]
    — 打开新标签页
  • vibe-check tab-switch <index|url>
    — 切换到指定标签页
  • vibe-check tab-close [index]
    — 关闭指定标签页

Daemon

守护进程管理

  • vibe-check daemon start
    — start background browser
  • vibe-check daemon status
    — check if running
  • vibe-check daemon stop
    — stop daemon
  • vibe-check daemon start
    — 启动后台浏览器进程
  • vibe-check daemon status
    — 检查后台进程运行状态
  • vibe-check daemon stop
    — 停止后台进程

Global Flags

全局参数

FlagDescription
--headless
Hide browser window
--json
Output as JSON
--oneshot
One-shot mode (no daemon)
-v, --verbose
Debug logging
--wait-open N
Wait N seconds after navigation
--wait-close N
Keep browser open N seconds before closing
参数说明
--headless
隐藏浏览器窗口
--json
以JSON格式输出结果
--oneshot
单次运行模式(不启用守护进程)
-v, --verbose
开启调试日志
--wait-open N
页面导航完成后等待N秒
--wait-close N
关闭浏览器前保持运行N秒

Daemon vs Oneshot

守护进程模式 vs 单次运行模式

By default, commands connect to a daemon — a background process that keeps the browser alive between commands. This is fast and lets you chain commands against the same page.
Use
--oneshot
(or
VIBIUM_ONESHOT=1
) to launch a fresh browser for each command, then tear it down. Useful for CI or one-off scripts.
默认情况下,命令会连接到守护进程 — 一个在后台运行的进程,可让浏览器在多个命令之间保持活跃状态。这种模式速度更快,且允许针对同一页面连续执行多个命令。
使用
--oneshot
参数(或设置环境变量
VIBIUM_ONESHOT=1
)可为每个命令启动一个全新的浏览器实例,执行完成后立即关闭。该模式适用于CI环境或一次性脚本。

Common Patterns

常用操作示例

Read a page:
sh
vibe-check navigate https://example.com
vibe-check text
Fill a form:
sh
vibe-check navigate https://example.com/login
vibe-check type "input[name=email]" "user@example.com"
vibe-check type "input[name=password]" "secret"
vibe-check click "button[type=submit]"
Extract structured data:
sh
vibe-check navigate https://example.com
vibe-check eval "JSON.stringify([...document.querySelectorAll('a')].map(a => a.href))"
Multi-tab workflow:
sh
vibe-check tab-new https://docs.example.com
vibe-check text "h1"
vibe-check tab-switch 0
读取页面内容:
sh
vibe-check navigate https://example.com
vibe-check text
填写表单:
sh
vibe-check navigate https://example.com/login
vibe-check type "input[name=email]" "user@example.com"
vibe-check type "input[name=password]" "secret"
vibe-check click "button[type=submit]"
提取结构化数据:
sh
vibe-check navigate https://example.com
vibe-check eval "JSON.stringify([...document.querySelectorAll('a')].map(a => a.href))"
多标签页工作流:
sh
vibe-check tab-new https://docs.example.com
vibe-check text "h1"
vibe-check tab-switch 0

Tips

使用技巧

  • All click/type/hover actions auto-wait for the element to be actionable
  • Use
    vibe-check find
    to inspect an element before interacting
  • Use
    vibe-check text "<selector>"
    to read specific sections
  • vibe-check eval
    is the escape hatch for complex DOM queries
  • Screenshots save to the current directory by default (
    -o
    to change)
  • 所有点击/输入/悬浮操作会自动等待元素变为可交互状态
  • 交互前可使用
    vibe-check find
    命令检查元素信息
  • 使用
    vibe-check text "<selector>"
    命令读取页面特定区域的内容
  • vibe-check eval
    命令可用于处理复杂的DOM查询场景
  • 截图默认保存到当前目录(可使用
    -o
    参数修改保存路径)