cli-anything-safari
ما الذي تفعله
تتيح هذه المهارة لوكيل الذكاء الاصطناعي تشغيل Safari على حاسوب Mac، باستخدام المتصفح الذي تستخدمه بالفعل وتسجيلات دخولك. وهي مناسبة لمن يريد إنجاز المهام الروتينية على الويب تلقائيًا.
متى تستخدمها
- ✓عندما تريد من وكيلك فتح موقع وقراءة ما في الصفحة.
- ✓عندما تحتاج إلى أتمتة مهمة تصفح متكررة في Safari من سكربت.
- ✓عندما تريد من الوكيل استخدام موقع سجلت دخولك إليه بالفعل.
رابط المهارة
https://github.com/HKUDS/CLI-Anything/blob/main/safari/agent-harness/cli_anything/safari/skills/SKILL.mdانسخه والصقه في الذكاء الاصطناعي الذي تستخدمه (Claude أو ChatGPT أو Cursor) واطلب منه اتباع التعليمات.
طريقة الاستخدام
أسهل طريقة: انسخ الرسالة والصقها في الذكاء الاصطناعي الذي تستخدمه. سيقرأ المهارة وينفّذ تعليماتها.
رسالة جاهزة للصق
لـ Claude Code أو Codex أو Cursor: شغّله داخل مجلد مشروعك وستُثبَّت المهارة.
نزّل ملف SKILL.md وضعه في مجلد مهارات وكيلك.
مثال على ما تطلبه من الذكاء الاصطناعي
“أريد من الوكيل فتح لوحة تحكم شركتنا في Safari وعرض أحدث ثلاثة تقارير.”
5 مهارات جديدة كل أسبوع. قراءة في دقيقة واحدة.
كيف تعمل
يرسل الوكيل أوامر إلى خادم safari-mcp على جهاز Mac، الذي يتحكم في Safari عبر إعدادات الأتمتة في Apple. ينفذ كل أمر إجراءً واحدًا في المتصفح ويعيد النتيجة.
المحتوى التقني (ملف SKILL.md الأصلي)
النص الأصلي من المؤلف، مباشرة من GitHub.
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
- macOS — Safari MCP is macOS-only.
- Safari — already installed on macOS.
- Node.js 18+ —
brew install nodeor from https://nodejs.org/ - Python 3.10+
- 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:
| Command | Purpose |
|---|---|
tool |
Call any of safari-mcp's 84 tools (dynamic, schema-driven) |
tools |
Inspect the bundled tool registry (list, describe, count) |
raw |
Escape hatch — call a tool by full name with raw JSON args |
session |
In-memory session state (last URL, current tab) |
repl |
Interactive 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.
Net
الأسئلة الشائعة
ما الذي يجب إعداده أولًا؟
تحتاج إلى Node.js 18 أو أحدث، وتفعيل خيار السماح بتشغيل JavaScript من Apple Events في قائمة Develop في Safari.
هل تعمل على Windows؟
لا. المهارة لنظام macOS فقط، لأن Safari وأدوات الأتمتة فيه تعمل على Mac فقط.
هل ستحتفظ بتسجيلات دخولي؟
نعم. تتحكم في Safari الحقيقي الذي تستخدمه، فتبقى المواقع التي سجلت دخولك إليها على حالها.
التفاصيل
الوصف الأصلي من المؤلف
Safari browser automation CLI on macOS via safari-mcp. Controls real Safari (native, keeps logins) by wrapping the safari-mcp MCP server. Every one of the 84 MCP tools is exposed 1:1 with schema-accurate arguments — guaranteed parity, no manual drift.
repo: HKUDS/CLI-Anything
الشعبية
- نجوم GitHub
- 58k
- الترتيب
- #3243
- الترخيص
- Apache-2.0
- آخر تحديث
- 21/9/2026
التعليقات
- …
المزيد من المهارات من هذا المستودع
cli-anything-3mf
58kيتيح لوكيلك فحص ملفات الطباعة ثلاثية الأبعاد وإصلاحها، بما في ذلك إيجاد الثقوب الدائرية وتغيير حجمها وإصلاح الشبكات ومقارنة ملفين.
cli-anything-qgis
58kيتيح لوكيلك فتح مشاريع الخرائط في QGIS وتحريرها وتصديرها من الطرفية، بما في ذلك الطبقات والمعالم والتخطيطات المطبوعة وأدوات المعالجة.
cli-anything-adguardhome
58kيتيح لوكيلك إدارة AdGuard Home، وهو حاجب إعلانات على مستوى الشبكة، بما في ذلك الفلاتر وإعادة كتابة DNS والأجهزة وسجلات الاستعلامات.
cli-anything-anygen
58kيتيح لوكيلك إنشاء شرائح ومستندات ومواقع ورسوم بيانية من وصف مكتوب، باستخدام خدمة AnyGen.
مهارات مشابهة
test-driven-development
311kيعلّم وكيلك كتابة اختبار فاشل أولًا، ثم رؤيته يفشل، ثم كتابة أصغر شيفرة تنجحه، قبل بناء أي ميزة أو إصلاح.
verification-before-completion
311kيعلّم وكيلك تشغيل فحوصات حقيقية وقراءة نتائجها قبل أن يقول إن المهمة أو الإصلاح أو البناء مكتمل أو ناجح.
migrate-to-shoehorn
310kيستبدل تأكيدات النوع الخطرة في ملفات الاختبار بمكتبة shoehorn، حتى تتمكن الاختبارات من استخدام بيانات جزئية وتجتاز فحوص الأنواع.