Chuyển đến nội dung
Skillpedia
Agent58k · #3185

cli-anything-browser

Skill này làm gì

Skill này cho phép agent di chuyển quanh một trang web đang mở trong Chrome bằng lệnh kiểu thư mục, như liệt kê mục, mở phần và bấm. Nó dành cho người muốn AI dùng website qua một giao diện lệnh đơn giản.

Khi nào nên dùng

  • ✓Khi bạn muốn agent tìm và bấm một thứ trên trang web đang mở trong Chrome.
  • ✓Khi bạn muốn đọc văn bản một phần của trang mà không cần chụp màn hình.
  • ✓Khi bạn muốn tìm một từ hoặc cụm từ cụ thể trên trang web.

Liên kết skill

https://github.com/HKUDS/CLI-Anything/blob/main/browser/agent-harness/cli_anything/browser/skills/SKILL.md

Sao chép rồi dán vào AI của bạn (Claude, ChatGPT hoặc Cursor) và nhờ nó làm theo hướng dẫn.

Cách dùng

Cách dễ nhất: sao chép tin nhắn và dán vào AI của bạn. AI sẽ đọc skill và làm theo hướng dẫn.

Tin nhắn có sẵn để dán

Hãy dùng skill này để giúp tôi: https://github.com/HKUDS/CLI-Anything/blob/main/browser/agent-harness/cli_anything/browser/skills/SKILL.md Đọc tệp SKILL.md tại liên kết đó và làm theo hướng dẫn cho việc của tôi.
Bạn muốn AI tự tìm những skill như thế này?Cài MCP Skillpedia miễn phí: chỉ một dòng, và AI sẽ tìm trong 15.000+ skill trước mỗi việc.Cài đặt trong 1 phút →

Ví dụ cách nhờ AI

“Mở trang giá trong Chrome và tìm xem nó liệt kê gói doanh nghiệp ở đâu.”

5 skill mới mỗi tuần. Đọc chỉ 1 phút.

Cách hoạt động

Skill kết nối với tiện ích DOMShell trong Chrome, biến cấu trúc trang thành một khung nhìn giống thư mục. Agent sau đó dùng các lệnh như ls, cd, cat và grep để khám phá, và bấm hoặc gõ khi cần.

Nội dung kỹ thuật (SKILL.md gốc)

Lấy nguyên văn từ GitHub, do tác giả viết bằng tiếng Anh.

cli-anything-browser

A command-line interface for browser automation using DOMShell's MCP server. Navigate web pages using filesystem commands: ls, cd, cat, grep, click.

Installation

Prerequisites

  1. Node.js and npx (for DOMShell MCP server):

    # Install Node.js from https://nodejs.org/
    npx --version
    
  2. Chrome/Chromium with DOMShell extension:

    • Install extension in Chrome
    • Ensure Chrome is running before using CLI
  3. Python 3.10+

Install CLI

cd browser/agent-harness
pip install -e .

Command Groups

page — Page Navigation

  • page open <url> — Navigate to URL
  • page reload — Reload current page
  • page back — Navigate back in history
  • page forward — Navigate forward in history
  • page info — Show current page info

fs — Filesystem Commands (Accessibility Tree)

  • fs ls [path] — List elements at path
  • fs cd <path> — Change directory
  • fs cat [path] — Read element content
  • fs grep <pattern> [path] — Search for text pattern
  • fs pwd — Print working directory

act — Action Commands

  • act click <path> — Click an element
  • act type <path> <text> — Type text into input

session — Session Management

  • session status — Show session state
  • session daemon-start — Start persistent daemon mode
  • session daemon-stop — Stop daemon mode

Usage Examples

Basic Navigation

# Open a page
cli-anything-browser page open https://example.com

# Explore structure
cli-anything-browser fs ls /
cli-anything-browser fs cd /main
cli-anything-browser fs ls

# Go back to root
cli-anything-browser fs cd /

Search and Click

cli-anything-browser fs grep "Login"
cli-anything-browser act click /main/button[0]

Form Fill

cli-anything-browser act type /main/input[0] "user@example.com"
cli-anything-browser act click /main/button[0]

JSON Output

cli-anything-browser --json fs ls /

Daemon Mode (Faster Interactive Use)

# Start persistent connection
cli-anything-browser session daemon-start

# Run commands (uses persistent connection)
cli-anything-browser fs ls /
cli-anything-browser fs cd /main

# Stop daemon when done
cli-anything-browser session daemon-stop

Interactive REPL

cli-anything-browser

Path Syntax

DOMShell uses a filesystem-like path for the Accessibility Tree:

/                           — Root (document)
/main                       — Main landmark
/main/div[0]                — First div in main
/main/div[0]/button[2]      — Third button in first div
  • Array indices are 0-based: button[0] is the first button
  • Use .. to go up one level
  • Use / for root

Agent-Specific Guidance

JSON Output for Parsing

All commands support --json flag for machine-readable output:

cli-anything-browser --json fs ls /

Returns:

{
  "path": "/",
  "entries": [
    {"name": "main", "role": "landmark", "path": "/main"}
  ]
}

Error Handling

The CLI provides clear error messages for common issues:

  • npx not found: Install Node.js from https://nodejs.org/
  • DOMShell not found: Run npx @apireno/domshell --version
  • MCP call failed: Install DOMShell Chrome extension

Check is_available() return value before running commands.

Daemon Mode for Efficiency

For agent workflows with multiple commands, use daemon mode:

  1. Start daemon: cli-anything-browser session daemon-start
  2. Run commands: Each command reuses the MCP connection
  3. Stop daemon: cli-anything-browser session daemon-stop

This avoids the 1-3 second cold start overhead for each command.

Links

Security Considerations

IMPORTANT: When using this CLI with AI agents, be aware of the following security considerations:

URL Restrictions

The browser harness validates all URLs before navigation:

  • Explicit scheme required: URLs must include http:// or https:// scheme (scheme-less URLs like example.com are rejected)
  • Blocked schemes: file://, javascript://, data://, vbscript://, about://, chrome://, and browser-internal schemes
  • **Al
Câu hỏi thường gặp

Tôi cần cài gì?

Bạn cần Node.js, Chrome với tiện ích DOMShell, và Python 3.10 trở lên.

Chrome có cần đang mở không?

Có, Chrome phải đang chạy trước khi dùng skill.

Nó có điền được biểu mẫu không?

Có, nó có thể gõ văn bản vào ô nhập cũng như bấm các phần tử.

Chi tiết

Mô tả gốc của tác giả

Browser automation CLI using DOMShell MCP server. Maps Chrome's Accessibility Tree to a virtual filesystem for agent-native navigation.

repo: HKUDS/CLI-Anything

Độ phổ biến

Sao GitHub
58k
Vị trí xếp hạng
#3185
Giấy phép
Apache-2.0
Cập nhật
21/9/2026

Skill này có hữu ích không?

0

Đăng nhập để bình chọn.

Bình luận

  • …

Thêm skill từ kho mã này

Skill tương tự