jpskill.com
🛠️ 開発・MCP コミュニティ

macpilot-automation

MacPilot CLIを活用し、Claude CodeがmacOS上でアプリ操作、テキスト入力、要素クリック、シェルコマンド実行などを自動化し、業務効率を向上させるSkill。

📜 元の英語説明(参考)

Core macOS automation skill using MacPilot CLI. Enables Claude Code to control apps, type text, click elements, run shell commands, and automate workflows on macOS via the `macpilot` command.

🇯🇵 日本人クリエイター向け解説

一言でいうと

MacPilot CLIを活用し、Claude CodeがmacOS上でアプリ操作、テキスト入力、要素クリック、シェルコマンド実行などを自動化し、業務効率を向上させるSkill。

※ jpskill.com 編集部が日本のビジネス現場向けに補足した解説です。Skill本体の挙動とは独立した参考情報です。

⚡ おすすめ: コマンド1行でインストール(60秒)

下記のコマンドをコピーしてターミナル(Mac/Linux)または PowerShell(Windows)に貼り付けてください。 ダウンロード → 解凍 → 配置まで全自動。

🍎 Mac / 🐧 Linux
mkdir -p ~/.claude/skills && cd ~/.claude/skills && curl -L -o macpilot-automation.zip https://jpskill.com/download/9637.zip && unzip -o macpilot-automation.zip && rm macpilot-automation.zip
🪟 Windows (PowerShell)
$d = "$env:USERPROFILE\.claude\skills"; ni -Force -ItemType Directory $d | Out-Null; iwr https://jpskill.com/download/9637.zip -OutFile "$d\macpilot-automation.zip"; Expand-Archive "$d\macpilot-automation.zip" -DestinationPath $d -Force; ri "$d\macpilot-automation.zip"

完了後、Claude Code を再起動 → 普通に「動画プロンプト作って」のように話しかけるだけで自動発動します。

💾 手動でダウンロードしたい(コマンドが難しい人向け)
  1. 1. 下の青いボタンを押して macpilot-automation.zip をダウンロード
  2. 2. ZIPファイルをダブルクリックで解凍 → macpilot-automation フォルダができる
  3. 3. そのフォルダを C:\Users\あなたの名前\.claude\skills\(Win)または ~/.claude/skills/(Mac)へ移動
  4. 4. Claude Code を再起動

⚠️ ダウンロード・利用は自己責任でお願いします。当サイトは内容・動作・安全性について責任を負いません。

🎯 このSkillでできること

下記の説明文を読むと、このSkillがあなたに何をしてくれるかが分かります。Claudeにこの分野の依頼をすると、自動で発動します。

📦 インストール方法 (3ステップ)

  1. 1. 上の「ダウンロード」ボタンを押して .skill ファイルを取得
  2. 2. ファイル名の拡張子を .skill から .zip に変えて展開(macは自動展開可)
  3. 3. 展開してできたフォルダを、ホームフォルダの .claude/skills/ に置く
    • · macOS / Linux: ~/.claude/skills/
    • · Windows: %USERPROFILE%\.claude\skills\

Claude Code を再起動すれば完了。「このSkillを使って…」と話しかけなくても、関連する依頼で自動的に呼び出されます。

詳しい使い方ガイドを見る →
最終更新
2026-05-18
取得日時
2026-05-18
同梱ファイル
1

📖 Skill本文(日本語訳)

※ 原文(英語/中国語)を Gemini で日本語化したものです。Claude 自身は原文を読みます。誤訳がある場合は原文をご確認ください。

MacPilotの自動化

macpilot CLIツールを使用してmacOSを自動化します。MacPilotは、マウス、キーボード、アプリ、ウィンドウ、UI、クリップボード、ダイアログ、シェル、およびシステム制御のための100以上のコマンドを提供します。すべてのコマンドは、構造化された出力のために--jsonをサポートしています。

使用する場面

このスキルは、ユーザーが以下を要求する場合に使用します。

  • macOSタスクの自動化(アプリを開く、ボタンをクリックする、テキストを入力する、メニューをナビゲートする)
  • マウスとキーボードをプログラムで制御する
  • アクセシビリティAPIを介して実行中のアプリケーションと対話する
  • 複数の自動化ステップをワークフローに連鎖させる
  • シェルコマンドを実行するか、Terminalと対話する
  • クリップボード、通知、オーディオ、表示設定を管理する

前提条件

MacPilotは、/Applications/MacPilot.appにインストールされ、/usr/local/bin/macpilotまたは~/bin/macpilotにシンボリックリンクが作成されている必要があります。このアプリは、システム設定 > プライバシーとセキュリティ > アクセシビリティでアクセシビリティの許可が必要です。

コアコマンドのリファレンス

マウス制御

macpilot click <x> <y>              # 座標で左クリック
macpilot doubleclick <x> <y>        # ダブルクリック
macpilot rightclick <x> <y>         # 右クリック
macpilot move <x> <y>               # カーソルを移動
macpilot drag <x1> <y1> <x2> <y2>  # ある点から別の点へドラッグ
macpilot scroll <up|down|left|right> [amount]  # スクロール (デフォルト: 3)
macpilot mouse-position --json      # 現在のカーソル位置を取得

キーボード制御

macpilot keyboard type "Hello World"           # テキストを入力
macpilot keyboard key cmd+c                    # ショートカットを押す
macpilot keyboard key enter                    # 単一のキーを押す
macpilot chain "type:hello" "key:tab" "type:world"  # アクションを連鎖させる

修飾キー: cmd, shift, alt, ctrl, fn 特殊キー: enter, tab, space, escape, delete, f1-f12, up, down, left, right

アプリ管理

macpilot app open "Safari"          # アプリを開く/起動する
macpilot app focus "Safari"         # アプリを前面に表示する
macpilot app frontmost --json       # 最前面のアプリを取得
macpilot app list --json            # 実行中のアプリをリスト表示
macpilot app quit "Safari"          # アプリを終了する
macpilot app quit "Safari" --force  # 強制終了
macpilot app hide "Safari"          # アプリを隠す

メニュー操作

macpilot menu click File Open --app Safari      # メニュー項目をクリック
macpilot menu list --app Safari --json           # すべてのメニューをリスト表示
macpilot menu list --app Safari --menu File      # 特定のメニューをリスト表示

クリップボード

macpilot clipboard get --json              # クリップボードのテキストを読み取る
macpilot clipboard set "text"              # クリップボードのテキストを設定
macpilot clipboard image photo.png         # 画像をクリップボードにコピー
macpilot clipboard info --json             # コンテンツタイプ、サイズ、プレビュー
macpilot clipboard types --json            # すべてのUTIタイプをリスト表示
macpilot clipboard clear --json            # クリップボードをクリア
macpilot clipboard paste --json            # Cmd+Vをシミュレート
macpilot clipboard copy file.txt --json    # ファイルをクリップボードにコピー
macpilot clipboard save /tmp/out.png       # クリップボードの内容をファイルに保存

# クリップボード履歴 (バックグラウンドデーモン、最大50項目)
macpilot clipboard history start --json    # トラッキングを開始
macpilot clipboard history stop --json     # トラッキングを停止
macpilot clipboard history list --json     # 履歴を表示
macpilot clipboard history search "text"   # 履歴を検索
macpilot clipboard history clear --json    # 履歴を削除

シェルコマンド

macpilot shell run "ls -la"                # コマンドを実行し、出力を取得
macpilot shell interactive "top"           # Terminalで開く
macpilot shell type "git status"           # アクティブなターミナルに入力
macpilot shell paste "long command here"   # クリップボード経由で貼り付け

システム制御

macpilot audio volume get --json           # 音量を取得 (0-100)
macpilot audio volume set 50               # 音量を設定
macpilot audio volume mute                 # ミュート
macpilot display brightness set 75         # 明るさを設定
macpilot appearance dark                   # ダークモード
macpilot appearance light                  # ライトモード
macpilot notification send "Title" "Body"  # システム通知
macpilot notification list --json          # 表示されている通知をリスト表示
macpilot notification click --title "match" # タイトルで通知をクリック
macpilot notification dismiss --json       # 最上位の通知を消去
macpilot notification dismiss --all        # すべての通知を消去
macpilot system info --json                # システム情報
macpilot network wifi-name --json          # Wi-Fi名
macpilot network ip --json                 # IPアドレス

待機と同期

macpilot wait seconds 2                          # 2秒間スリープ
macpilot wait element "Save" --app TextEdit       # UI要素を待機
macpilot wait window "Untitled" --timeout 10      # ウィンドウを待機
macpilot watch events --duration 5 --json         # イベントを監視

スペースとDock

macpilot space list --json                  # スペースをリスト表示
macpilot space switch right                 # スペースを切り替え
macpilot dock hide                          # Dockを自動的に隠す
macpilot dock show                          # Dockを常に表示

重要なパターン

  1. 操作の前に必ずアプリにフォーカスする: macpilot app focus "AppName"は、クリック、入力、またはメニュー操作の前に実行する必要があります。フォーカス後の最初のクリックは、ウィンドウのアクティブ化によって消費される可能性があるため、最初にアプリのコンテンツ領域をクリックしてから、ターゲットをクリックしてください。

  2. 解析には--jsonを使用する: プログラムで出力を解析する必要がある場合は、常に--jsonを追加してください。

  3. 座標にはui find-textを使用する: 特定の要素をクリックする必要がある場合は、まずmacpilot ui find-text "label" --app AppName --jsonで座標を見つけ、返された位置をクリックします。

  4. 複雑なシーケンスにはチェーンを使用する: 複数の個別のコマンドの代わりに、複数ステップのキーボードワークフローにはmacpilot chainを使用します。

  5. AX値をキーボードで設定: macpilot ui set-valuを介してテキストフィールドの値を設定します。

📜 原文 SKILL.md(Claudeが読む英語/中国語)を展開

MacPilot Automation

Use the macpilot CLI tool to automate macOS. MacPilot provides 100+ commands for mouse, keyboard, app, window, UI, clipboard, dialog, shell, and system control. All commands support --json for structured output.

When to Use

Use this skill when the user asks to:

  • Automate macOS tasks (open apps, click buttons, type text, navigate menus)
  • Control mouse and keyboard programmatically
  • Interact with running applications via accessibility APIs
  • Chain multiple automation steps into workflows
  • Run shell commands or interact with Terminal
  • Manage clipboard, notifications, audio, display settings

Prerequisites

MacPilot must be installed at /Applications/MacPilot.app with a symlink at /usr/local/bin/macpilot or ~/bin/macpilot. The app requires Accessibility permission in System Settings > Privacy & Security > Accessibility.

Core Commands Reference

Mouse Control

macpilot click <x> <y>              # Left click at coordinates
macpilot doubleclick <x> <y>        # Double click
macpilot rightclick <x> <y>         # Right click
macpilot move <x> <y>               # Move cursor
macpilot drag <x1> <y1> <x2> <y2>  # Drag from point to point
macpilot scroll <up|down|left|right> [amount]  # Scroll (default: 3)
macpilot mouse-position --json      # Get current cursor position

Keyboard Control

macpilot keyboard type "Hello World"           # Type text
macpilot keyboard key cmd+c                    # Press shortcut
macpilot keyboard key enter                    # Press single key
macpilot chain "type:hello" "key:tab" "type:world"  # Chain actions

Modifier keys: cmd, shift, alt, ctrl, fn Special keys: enter, tab, space, escape, delete, f1-f12, up, down, left, right

App Management

macpilot app open "Safari"          # Open/launch app
macpilot app focus "Safari"         # Bring app to front
macpilot app frontmost --json       # Get frontmost app
macpilot app list --json            # List running apps
macpilot app quit "Safari"          # Quit app
macpilot app quit "Safari" --force  # Force quit
macpilot app hide "Safari"          # Hide app

Menu Interaction

macpilot menu click File Open --app Safari      # Click menu item
macpilot menu list --app Safari --json           # List all menus
macpilot menu list --app Safari --menu File      # List specific menu

Clipboard

macpilot clipboard get --json              # Read clipboard text
macpilot clipboard set "text"              # Set clipboard text
macpilot clipboard image photo.png         # Copy image to clipboard
macpilot clipboard info --json             # Content type, size, preview
macpilot clipboard types --json            # List all UTI types
macpilot clipboard clear --json            # Clear clipboard
macpilot clipboard paste --json            # Simulate Cmd+V
macpilot clipboard copy file.txt --json    # Copy file(s) to clipboard
macpilot clipboard save /tmp/out.png       # Save clipboard content to file

# Clipboard history (background daemon, max 50 items)
macpilot clipboard history start --json    # Start tracking
macpilot clipboard history stop --json     # Stop tracking
macpilot clipboard history list --json     # Show history
macpilot clipboard history search "text"   # Search history
macpilot clipboard history clear --json    # Delete history

Shell Commands

macpilot shell run "ls -la"                # Run command, get output
macpilot shell interactive "top"           # Open in Terminal
macpilot shell type "git status"           # Type into active terminal
macpilot shell paste "long command here"   # Paste via clipboard

System Controls

macpilot audio volume get --json           # Get volume (0-100)
macpilot audio volume set 50               # Set volume
macpilot audio volume mute                 # Mute
macpilot display brightness set 75         # Set brightness
macpilot appearance dark                   # Dark mode
macpilot appearance light                  # Light mode
macpilot notification send "Title" "Body"  # System notification
macpilot notification list --json          # List visible notifications
macpilot notification click --title "match" # Click notification by title
macpilot notification dismiss --json       # Dismiss top notification
macpilot notification dismiss --all        # Dismiss all notifications
macpilot system info --json                # System info
macpilot network wifi-name --json          # Wi-Fi name
macpilot network ip --json                 # IP address

Waiting & Synchronization

macpilot wait seconds 2                          # Sleep 2 seconds
macpilot wait element "Save" --app TextEdit       # Wait for UI element
macpilot wait window "Untitled" --timeout 10      # Wait for window
macpilot watch events --duration 5 --json         # Monitor events

Spaces & Dock

macpilot space list --json                  # List spaces
macpilot space switch right                 # Switch space
macpilot dock hide                          # Auto-hide dock
macpilot dock show                          # Always show dock

Critical Patterns

  1. Always focus the app before interacting: macpilot app focus "AppName" must come before clicking, typing, or menu operations. The first click after focus may be consumed by window activation - click the app's content area first, then click the target.

  2. Use --json for parsing: Always add --json when you need to parse output programmatically.

  3. Use ui find-text for coordinates: When you need to click a specific element, first find its coordinates with macpilot ui find-text "label" --app AppName --json, then click at the returned position.

  4. Chain for complex sequences: Use macpilot chain for multi-step keyboard workflows instead of multiple separate commands.

  5. AX value set over keyboard: Setting text field values via macpilot ui set-value is more reliable than keyboard typing when focus is uncertain.

  6. Wait for elements: Use macpilot wait element before interacting with UI elements that may not have appeared yet.

Example Workflows

Open a URL in Safari

macpilot app open Safari
macpilot wait window Safari --timeout 5
macpilot app focus Safari
macpilot keyboard key cmd+l
macpilot keyboard type "https://example.com"
macpilot keyboard key enter

Copy text from one app to another

macpilot app focus "TextEdit"
macpilot keyboard key cmd+a
macpilot keyboard key cmd+c
macpilot app focus "Notes"
macpilot keyboard key cmd+v

Create a new file in TextEdit

macpilot app open TextEdit
macpilot wait window TextEdit --timeout 5
macpilot keyboard type "Hello from MacPilot!"
macpilot keyboard key cmd+s
macpilot wait seconds 1
macpilot dialog navigate "/Users/me/Desktop"
macpilot dialog set-field "myfile.txt"
macpilot dialog click-button "Save"