Token导航 LogoToken导航

Agent Skill · 研究检索

cli-anything-safari(CLI anything safari 搜索)

cli-anything-safari 用于查找、检索和筛选相关信息,适合在 Codex、Claude、Cursor、Gemini CLI 中需要根据关键词、任务场景或来源线索快速定位候选结果时使用。可结合来源仓库、安装命令和原始 README 继续核验具体用法。安装前建议确认权限范围、维护状态,以及是否会触发联网、命令执行或文件读写。

cli-anything-safari 是研究检索类 Agent Skill,可用宿主为 Codex、Claude、Cursor、Gemini CLI,通过GitHub 仓库获取,权限为操作浏览器;许可证信息还不明确,第三方扫描有未通过项,按安装量在研究检索类的 73,675 个 Skill 里排第 35,776。

总安装 2,025周安装 87GitHub Stars 33,035下载 710核验 2026-05-01

安装说明

本站只整理中文说明,不托管安装包,也不代用户安装。
GitHub
许可证
unknown

安装方式

通过对话安装

复制提示词发给支持本地命令或 Skills 的 AI 助手,先确认命令和权限,再让它执行。

请帮我安装这个 Agent Skill:cli-anything-safari(CLI anything safari 搜索)
来源仓库:https://github.com/hkuds/cli-anything
仓库路径:skills/cli-anything-safari
安装命令:
npx skills add https://github.com/hkuds/cli-anything --skill cli-anything-safari
安装前请先检查当前环境是否支持对应 CLI,并向我确认将要执行的命令、安装目录、联网范围和文件读写权限;确认后再执行。

命令行安装

复制命令到本机终端执行。该命令会通过 npx skills 从第三方来源获取 Skill;本站只展示命令,不托管安装包,也不自动执行。

skills.shnpx skills
npx skills add https://github.com/hkuds/cli-anything --skill cli-anything-safari

这个 Skill 是做什么的

研究检索类 Skill 主要解决「找资料、核对事实、把来源整理清楚」的问题,通常会让助手先检索再总结。

cli-anything-safari 用于在 macOS 上通过命令行自动化 Safari 浏览器,支持调用 84 个工具实现网页交互、元素操作和状态管理。适合需要浏览器自动化的开发测试、数据整理或界面操作等场景,可在 Codex、Claude、Cursor、Gemini CLI 中集成使用。

通过 npx 安装后可直接调用命令,建议确认系统环境、权限范围和是否需配合 MCP 服务器运行。使用前应检查 safari-mcp 服务状态,注意每调用一次会启动新进程带来的性能开销。涉及敏感网站或账号操作时,请确保遵守目标网站的 robots.txt 和使用条款。

来源仓库内路径:skills/cli-anything-safari

上手步骤

4 步
  1. 1

    确认自己的宿主工具

    公开资料标注支持 Codex、Claude、Cursor、Gemini CLI;先确认自己用的是其中之一,再按对应工具的 Skills 目录放置。

  2. 2

    拿到安装命令

    可以直接复制的命令是 npx skills add https://github.com/hkuds/cli-anything --skill cli-anything-safari;命令里的占位符换成自己的路径或密钥再执行。

  3. 3

    安装后重启宿主

    命令执行完要完全退出宿主工具再打开,让新装的 Skill 被重新扫描到,否则列表里可能看不到。

  4. 4

    按最小权限试用

    它需要操作浏览器,先在测试目录或测试账号里跑,确认没问题再放到正式项目。

常见问题

6 条

cli-anything-safari 怎么安装?

在终端执行 npx skills add https://github.com/hkuds/cli-anything --skill cli-anything-safari。装完完全退出宿主工具再打开,让它重新扫描本地 Skill。

cli-anything-safari 支持哪些 AI 工具?

公开资料标注支持 Codex、Claude、Cursor、Gemini CLI。其他工具只要能读取本地 Skill 目录,一般也能手动放进去,但要自己确认触发方式是否一致。

cli-anything-safari 需要什么权限?

权限级别是操作浏览器。该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

cli-anything-safari 是免费的吗?

公开资料没有标注明确许可证,收费和商用限制都无法确认。正式使用前请到来源仓库核对授权说明。

cli-anything-safari 用的人多吗?

公开数据是累计安装 2,025 次,近一周安装 87 次,下载 710 次,GitHub 33,035 星。这些数字来自第三方目录统计,只能当作热度参考,不代表质量或安全性。

cli-anything-safari 安全吗?

第三方扫描有未通过项,风险较高。除非你确认过源码,否则不建议直接安装到常用环境。

值得选的地方和要先想清楚的地方

值得选的地方

  • 同时适配 4 种工具,换客户端不用重新找替代品。
  • 来源仓库有 33,035 星,维护活跃度相对可查。

先想清楚的地方

  • 许可证没有明确标注,能不能商用、能不能再分发都不确定。
  • 第三方扫描存在提醒项或未通过项,需要人工逐条确认。
  • 第三方目录整理,版本更新和行为细节以来源仓库为准。

适不适合你

更适合

  • 已经在用 Codex,想直接扩展它能力的人。
  • 需要处理研究检索类任务、又不想每次都手写提示词的人。

不太适合

  • 需要明确授权才能用到公司项目里的场景。
  • 需要厂商级技术支持和 SLA 的生产系统。

研究检索类 Skill 对比

6 个同类
Skill总安装GitHub 星权限许可证扫描
find-skills

寻找技能 · Codex、Claude

31,199,81316,486操作浏览器MIT有提醒
self-improving-agent

自我改进 Agent · OpenClaw

16,464,0023,396接触敏感数据MIT-0通过
soultrace

灵魂追踪 · Codex、Claude

7,588,94412需要联网未明确有提醒
self-improving

自我完善 · OpenClaw

6,829,2841,046需要联网MIT-0通过
microsoft-foundry

微软代工厂 · Codex、Claude

6,614,144764调用外部服务未明确有提醒
cli-anything-safari

CLI anything safari 搜索 · 本页

2,02533,035操作浏览器未明确未通过

按安装量取同分类前几名;数字来自第三方目录统计,只作热度参考,不代表质量结论。

SKILL.md 原文

cli-anything-safari

A command-line interface for Safari browser automation on macOS. Wraps the safari-mcp Node.js MCP server in a Python Click CLI.

Feature parity is guaranteed. Every Click command is generated automatically from safari-mcp's tool schema (bundled as resources/tools.json). All 84 tools are reachable with the exact argument names and types the MCP server expects.

When to use this CLI

Each CLI invocation spawns a fresh subprocess, so there is per-call overhead. If your agent speaks MCP natively (Claude Code, Cursor, Cline, etc.), using safari-mcp directly over MCP stdio will be faster.

Use this CLI when:

  • Your agent framework does not speak MCP (Codex CLI, GitHub Copilot CLI, custom scripts, older agent frameworks).
  • You need to script browser automation from bash — cli-anything-safari --json tool snapshot | jq '...'.
  • You run in CI/CD and want cron-able, subprocess-friendly output.
  • You're debugging interactively from Terminal.

Installation

Prerequisites

  1. macOS — Safari MCP is macOS-only.
  2. Safari — already installed on macOS.
  3. Node.js 18+ — brew install node or from https://nodejs.org/
  4. Python 3.10+
  5. Enable Apple Events for Safari: Safari → Develop → Allow JavaScript from Apple Events

Install the CLI

cd safari/agent-harness
pip install -e .

The first tool call will download the safari-mcp npm package (one-time, a few MB).

Command Structure

The CLI has 5 top-level commands:

CommandPurpose
toolCall any of safari-mcp's 84 tools (dynamic, schema-driven)
toolsInspect the bundled tool registry (list, describe, count)
rawEscape hatch — call a tool by full name with raw JSON args
sessionIn-memory session state (last URL, current tab)
replInteractive REPL (default when no subcommand given)

Usage Examples

Discover the tool surface

# Count of tools (sanity check — must match safari-mcp's registered tools)
cli-anything-safari tools count
# → 84

# List every tool
cli-anything-safari tools list
cli-anything-safari tools list --filter click   # filter by substring

# Full schema for one tool (JSON or human format)
cli-anything-safari tools describe safari_scroll
cli-anything-safari --json tools describe safari_click

Call a tool (schema-driven)

# Navigate
cli-anything-safari tool navigate --url https://example.com

# Take a snapshot (preferred over screenshot — structured text with ref IDs)
cli-anything-safari --json tool snapshot

# Click by ref (refs come from snapshot; they expire on the next snapshot!)
cli-anything-safari tool click --ref 0_5

# Click by selector or visible text
cli-anything-safari tool click --selector "#submit"
cli-anything-safari tool click --text "Log in"

# Fill a field
cli-anything-safari tool fill --selector "#email" --value "user@example.com"

# Scroll by direction/amount (NOT x/y — note the schema!)
cli-anything-safari tool scroll --direction down --amount 500

# Drag one element onto another
cli-anything-safari tool drag \
    --source-selector ".card" \
    --target-selector ".trash"

# Screenshot — returns base64 JPEG in stdout. Decode with:
cli-anything-safari --json tool screenshot --full-page \
    | python3 -c "import sys,json,base64; \
        d=json.load(sys.stdin); \
        open('/tmp/shot.jpg','wb').write(base64.b64decode(d['data']))"

# Save as PDF (this one writes to disk directly)
cli-anything-safari tool save-pdf --path /tmp/page.pdf

# Evaluate JavaScript (note: parameter is --script, not --code)
cli-anything-safari tool evaluate --script "document.title"

Navigate and read in one round-trip

cli-anything-safari --json tool navigate-and-read --url https://example.com

Form fill (bulk)

safari_fill_form takes an array of {selector, value} objects. Pass it as a JSON string:

cli-anything-safari tool fill-form --fields '[
  {"selector": "#email",    "value": "user@example.com"},
  {"selector": "#password", "value": "hunter2"}
]'

Run cli-anything-safari tools describe safari_fill_form to see the exact schema, including any new fields safari-mcp adds upstream.

Network monitoring

cli-anything-safari tool start-network-capture
cli-anything-safari tool navigate --url https://example.com
cli-anything-safari --json tool network
cli-anything-safari tool performance-metrics

Storage

cli-anything-safari tool get-cookies
cli-anything-safari tool set-cookie --name session --value abc123 --domain example.com
cli-anything-safari tool local-storage --key theme
# export-storage returns JSON to stdout — no --path arg. Pipe to a file:
cli-anything-safari --json tool export-storage > /tmp/storage.json

Raw JSON escape hatch

When you need to pass a complex nested object or want to drive the CLI from a pre-built JSON blob:

cli-anything-safari raw safari_evaluate \
    --json-args '{"code":"[...document.querySelectorAll(\"a\")].map(a => a.href)"}'

Interactive REPL

cli-anything-safari

The REPL banner prints the absolute path to this SKILL.md so agents can self-discover capabilities.

JSON Output

All commands support --json as a global flag:

cli-anything-safari --json tool snapshot
cli-anything-safari --json tool list-tabs
cli-anything-safari --json tools list

State Management

The CLI maintains a small amount of in-memory state for REPL display only:

  • last_url — last URL the CLI navigated to (updated after every successful tool navigate, tool navigate-and-read, or tool new-tab)
  • current_tab_index — last known active tab index

There is no persistent session, no undo/redo, no document model. Every CLI invocation starts with fresh state. Safari MCP itself is stateless per-call: each tool command spawns a fresh npx safari-mcp subprocess, performs the action, and exits. This is a deliberate design choice; see HARNESS.md and TEST.md for the reasoning behind the deviation from the standard undo/redo pattern.

Output Formats

All commands support dual output modes:

  • Human-readable (default): indented key-value text for dict results, bullet lists for arrays, plain text otherwise
  • Machine-readable (--json flag): structured JSON for agent consumption
# Human output
cli-anything-safari tool snapshot

# JSON output for agents
cli-anything-safari --json tool snapshot
cli-anything-safari --json tools list
cli-anything-safari --json tools describe safari_click

For AI Agents

When using this CLI programmatically:

  1. Always use --json flag for parseable output.
  2. Check return codes — 0 for success, non-zero for errors (URL validation failures, MCP call failures, invalid JSON args).
  3. Parse stderr for error messages; use stdout for data.
  4. File-handling tools have inconsistent path arg names — always check tools describe <name> first:

- tool save-pdf --path /tmp/x.pdf - tool upload-file --selector... --file-path /tmp/x.txt (note: --file-path, not --path) - tool export-storage — no path arg; pipe JSON output to a file - tool import-storage --path /tmp/x.json - tool screenshot / screenshot-element — return base64 in the JSON response, no path arg (decode it yourself)

  1. Snapshot before click — refs from tool snapshot expire on the next snapshot. Always snapshot → find ref → click in close succession.
  2. Discover tools via tools list — the bundled registry is the source of truth for what's available. Do not hard-code tool names that may change upstream.
  3. Use tools describe <name> to learn the exact schema (required args, enum choices, JSON-typed args) before constructing a call. Never assume parameter names from the description — for example, safari_evaluate takes --script (not --code) even though the description says "JavaScript code to execute".

Agent-Specific Guidance

Finding the right tool

Use the introspection commands. The CLI is guaranteed to reflect the MCP server 1:1:

# Find all click-related tools
cli-anything-safari tools list --filter click

# Get the full schema (including every argument with type, description,
# required/optional, enum choices, defaults)
cli-anything-safari --json tools describe safari_click

Tool selection strategy

  1. tool snapshot over tool screenshot — structured text with ref IDs is orders of magnitude cheaper and carries the refs needed for clicks.
  2. tool click --ref over tool click --selector — refs are stable within a single snapshot, selectors may be brittle.
  3. tool navigate-and-read over navigate + read-page — saves one round-trip.
  4. tool click-and-read over click + read-page — saves one round-trip.
  5. tool native-click only when regular click fails with 405/403 (WAF blocks, G2, Cloudflare) — it physically moves the cursor.

Refs Expire

Refs from tool snapshot expire when you take a new snapshot:

  • First snapshot: refs 0_1, 0_2, 0_3...
  • Second snapshot: refs 1_1, 1_2, 1_3...

Always snapshot → click in close succession. If in doubt, snapshot again.

Tab Ownership Safety

Safari MCP tracks tab ownership per session. Tools that modify a tab (navigate, click, fill) are blocked on tabs the session did not open. To operate on a specific page, always start with tool new-tab --url....

Error Handling

Common errors:

  • npx not found → install Node.js 18+
  • safari-mcp package not found on npm registry → check network
  • Not macOS → harness is macOS-only
  • AppleScript denied → enable "Allow JavaScript from Apple Events" in Safari → Develop
  • Blocked URL scheme: file → URL validation rejected the input (by design)

URL Validation

The CLI validates URLs before passing them to safari_navigate, safari_navigate_and_read, and safari_new_tab. Blocked schemes: file, javascript, data, vbscript, about, chrome, safari, webkit, x-apple, and other browser-internal schemes. The raw command also enforces this for navigation tools.

Multi-Session Warning

Safari MCP enforces a single active session by killing stale Node.js processes older than 10 seconds. If you run two CLI instances at once, one will kill the other's backend. There is currently no daemon mode — for latency-sensitive workflows, drive the CLI from a long-lived Python script that imports cli_anything.safari.utils.safari_backend.call() directly to avoid re-spawning the subprocess on every invocation.

Links

Security Considerations

URL Validation

All navigation tools (tool navigate, tool navigate-and-read, tool new-tab, and raw safari_navigate*) pass the url argument through utils/security.py which blocks dangerous schemes and optionally blocks private networks (set CLI_ANYTHING_SAFARI_BLOCK_PRIVATE=1).

Tab Isolation

Safari MCP enforces per-session tab ownership upstream — tools cannot operate on tabs the session did not open.

Profile Isolation

Set SAFARI_PROFILE env var to use a separate Safari profile for automation:

export SAFARI_PROFILE="Automation"
cli-anything-safari tool navigate --url https://example.com

This keeps cookies/logins/history separate from the user's main browsing.

JavaScript Execution

tool evaluate and tool run-script run arbitrary JavaScript in the page context. Treat untrusted input with the same care as any dynamic code execution path.

Clipboard

tool clipboard-read and tool clipboard-write touch the system clipboard. Be careful when running inside a user's active session — overwriting the clipboard mid-task is disruptive.

Regenerating the tool registry

If you upgrade safari-mcp, regenerate the bundled schema:

python scripts/extract_tools.py \
    "$(npm root -g)/safari-mcp/index.js" \
    cli_anything/safari/resources/tools.json

The parity test (test_parity.py) pins the expected tool count; update it when the upstream tool list changes.

More Information

  • Full documentation: cli_anything/safari/README.md in the package
  • Test coverage: cli_anything/safari/tests/TEST.md in the package
  • Architecture analysis: safari/agent-harness/SAFARI.md
  • Methodology: cli-anything-plugin/HARNESS.md
  • MCP backend pattern: cli-anything-plugin/guides/mcp-backend.md

Version

1.0.0 — targets safari-mcp 2.7.8 (84 tools). Bundled tool registry is regenerated via scripts/extract_tools.py when safari-mcp upgrades.

平台分布

Codex

35.56%
按下载量换算252

Claude

32%
按下载量换算227

Cursor

16.81%
按下载量换算119

Gemini CLI

8.43%
按下载量换算60

安全审计

Gen Agent Trust Hub

可疑

Socket

通过

Snyk

未通过

权限和风险

操作浏览器

该 Skill 可能涉及浏览器控制能力,使用时可能读取或操作网页内容,需要在受控环境中确认权限边界。

安装前确认

本站仅展示第三方公开信息,不托管安装包,不提供自动安装或运行环境。安装前应自行审查源码、依赖和命令行为。来源安全扫描存在提醒或未通过项,安装前请自行复核。目前只有一个公开来源,建议同时核对源仓库。

继续浏览同类 Skills