cli-anything-safari
Qué hace
Esta skill permite que un agente de IA maneje Safari en un Mac, usando el navegador que ya utilizas con tus propias sesiones. Está pensada para personas que quieren que las tareas web rutinarias se hagan de forma automática.
Cuándo usarla
- ✓Cuando quieres que un agente abra una web y lea lo que aparece en la página.
- ✓Cuando necesitas automatizar una tarea de navegación repetida en Safari desde un script.
- ✓Cuando quieres que el agente use un sitio en el que ya tienes sesión iniciada.
Link de la skill
https://github.com/HKUDS/CLI-Anything/blob/main/safari/agent-harness/cli_anything/safari/skills/SKILL.mdCópialo y pégalo en tu IA (Claude, ChatGPT o Cursor) pidiéndole que siga las instrucciones.
Cómo usar
La forma más fácil: copia el mensaje y pégalo en tu IA. Ella lee la skill y sigue las instrucciones.
Mensaje listo para pegar
Para Claude Code, Codex o Cursor: ejecútalo en la carpeta del proyecto y la skill queda instalada.
Descarga el SKILL.md y ponlo en la carpeta de skills de tu agente.
Ejemplo de qué pedirle a la IA
“Quiero que el agente abra nuestro panel de la empresa en Safari y liste los tres informes más recientes.”
5 skills nuevas por semana. 1 minuto de lectura.
Cómo funciona
El agente envía comandos al servidor safari-mcp de tu Mac, que controla Safari a través de los ajustes de automatización de Apple. Cada comando ejecuta una acción del navegador y devuelve el resultado.
Contenido técnico (SKILL.md original)
Texto original del autor, en inglés, directo de 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
Preguntas frecuentes
¿Qué hay que configurar primero?
Necesitas Node.js 18 o posterior y activar el ajuste Permitir JavaScript desde Apple Events en el menú Desarrollo de Safari.
¿Funciona en Windows?
No. La skill es solo para macOS, ya que Safari y sus herramientas de automatización solo funcionan en Mac.
¿Mantendrá mis sesiones iniciadas?
Sí. Controla tu Safari real, así que los sitios en los que ya tienes sesión iniciada seguirán así.
Detalles
Descripción original del autor
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
Popularidad
- Estrellas en GitHub
- 58 mil
- Posición en el ranking
- #3243
- Licencia
- Apache-2.0
- Actualizada
- 21/9/2026
Comentarios
- …
Más skills de este repositorio
cli-anything-3mf
58 milPermite que tu agente inspeccione y corrija archivos de impresión 3D, incluidas la búsqueda de agujeros redondos, su redimensionado, la reparación de mallas y la comparación de dos archivos.
cli-anything-qgis
58 milPermite que tu agente abra, edite y exporte proyectos de mapas de QGIS desde la terminal, incluidas las capas, los elementos, los diseños de impresión y las herramientas de procesamiento.
cli-anything-adguardhome
58 milPermite que tu agente gestione AdGuard Home, un bloqueador de anuncios para toda la red, incluidos los filtros, las reescrituras de DNS, los clientes y los registros de consultas.
cli-anything-anygen
58 milPermite que tu agente genere diapositivas, documentos, sitios web y diagramas a partir de un texto escrito, usando el servicio AnyGen.
Skills parecidas
test-driven-development
311 milEnseña a tu agente a escribir primero una prueba que falle, verla fallar y después escribir el código más pequeño que la hace pasar, antes de construir cualquier función o corrección.
verification-before-completion
311 milEnseña a tu agente a ejecutar comprobaciones reales y leer su resultado antes de afirmar que una tarea, una corrección o una compilación está completa o en buen estado.
migrate-to-shoehorn
310 milSustituye los casts de tipo arriesgados de tus archivos de prueba por la librería shoehorn, para que las pruebas usen datos parciales y sigan pasando las comprobaciones de tipos.