macos-desktop-control

macOS 桌面控制工具。截屏、进程管理、系统信息、剪贴板、应用控制。macOS desktop control via native tools (screencapture, ps, AppleScript). 仅支持 macOS。

3,891 stars

Best use case

macos-desktop-control is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

macOS 桌面控制工具。截屏、进程管理、系统信息、剪贴板、应用控制。macOS desktop control via native tools (screencapture, ps, AppleScript). 仅支持 macOS。

Teams using macos-desktop-control should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/macos-desktop-control-zhang/SKILL.md --create-dirs "https://raw.githubusercontent.com/openclaw/skills/main/skills/asa-zhang/macos-desktop-control-zhang/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/macos-desktop-control-zhang/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How macos-desktop-control Compares

Feature / Agentmacos-desktop-controlStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

macOS 桌面控制工具。截屏、进程管理、系统信息、剪贴板、应用控制。macOS desktop control via native tools (screencapture, ps, AppleScript). 仅支持 macOS。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

Related Guides

SKILL.md Source

# macOS Desktop Control

macOS 原生桌面控制工具,无需额外依赖即可使用核心功能。

## 🚀 快速开始

### 基础命令(无需依赖)

```bash
# 截屏
bash scripts/screenshot.sh

# 进程列表
bash scripts/processes.sh

# 系统信息
bash scripts/system_info.sh

# 剪贴板读取
bash scripts/clipboard.sh get

# 剪贴板写入
bash scripts/clipboard.sh set "要复制的文字"
```

### 进阶命令(需要 pyautogui)✅

```bash
# 安装依赖
pip3 install --user --break-system-packages pyautogui pyscreeze pillow psutil

# 鼠标位置
python3 scripts/desktop_ctrl.py mouse position

# 鼠标移动
python3 scripts/desktop_ctrl.py mouse move 500 300

# 鼠标点击
python3 scripts/desktop_ctrl.py mouse click 500 300

# 键盘输入
python3 scripts/desktop_ctrl.py keyboard type "Hello"

# 快捷键(Cmd+C)
python3 scripts/desktop_ctrl.py keyboard hotkey command c
```

**⚠️ 重要**: 需要授予辅助功能权限!
```bash
bash scripts/check_permissions.sh
```

---

## 📋 命令速查

| 命令 | 功能 | 依赖 | 权限 |
|------|------|------|------|
| `screenshot` | 截屏 | 无 | 屏幕录制 |
| `processes` | 进程列表 | 无 | 无 |
| `info` | 系统信息 | 无 | 无 |
| `clipboard get` | 读取剪贴板 | 无 | 无 |
| `clipboard set` | 写入剪贴板 | 无 | 无 |
| `app open` | 打开应用 | 无 | 自动化 |
| `app close` | 关闭应用 | 无 | 自动化 |
| `app front` | 前端应用 | 无 | 自动化 |
| `mouse position` | 鼠标位置 | pyautogui | 辅助功能 |
| `mouse click` | 鼠标点击 | pyautogui | 辅助功能 |
| `keyboard type` | 键盘输入 | pyautogui | 辅助功能 |

---

## 🔐 权限配置

### 首次使用必须配置

运行权限检测脚本:
```bash
bash scripts/check_permissions.sh
```

或手动打开设置:
```bash
# 辅助功能(鼠标键盘控制)
open "x-apple.systempreferences:com.apple.preference.security?Privacy_Accessibility"

# 自动化(应用控制)
open "x-apple.systempreferences:com.apple.preference.security?Privacy_Automation"

# 屏幕录制(截屏)
open "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"
```

**⚠️ 重要**: 授权后需要重启终端应用!

---

## 📖 使用示例

### 示例 1: 截屏
```
用户:帮我截个屏
小龙虾:✅ 已截取屏幕,保存到 ~/Desktop/screenshot_20260331_213700.png
```

### 示例 2: 查看进程
```
用户:看看现在运行着哪些应用
小龙虾:
当前运行的主要进程:
- Safari (PID: 1234)
- VS Code (PID: 2345)
- Terminal (PID: 3456)
- QQ (PID: 4567)
```

### 示例 3: 关闭应用
```
用户:把 Safari 关了
小龙虾:✅ 已关闭 Safari 应用
```

### 示例 4: 系统信息
```
用户:看看我的电脑配置
小龙虾:
📊 系统信息
- 型号:MacBook Air (M2, 2023)
- 系统:macOS 15.3.1
- 内存:16 GB
- 存储:512 GB SSD
```

### 示例 5: 剪贴板操作
```
用户:复制这段文字到剪贴板
小龙虾:✅ 已将文字复制到剪贴板
```

---

## 🛠️ 安装

### 一键安装
```bash
cd skills/macos-desktop-control
bash scripts/install.sh
```

### 手动安装
```bash
# 1. 设置脚本权限
chmod +x scripts/*.sh

# 2. 检查权限
bash scripts/check_permissions.sh

# 3. 安装 Python 依赖(可选,用于鼠标键盘控制)
pip3 install --user --break-system-packages pyautogui pyscreeze pillow psutil
```

---

## 🔖 命令别名(快捷方式)

| 完整命令 | 快捷方式 | 说明 |
|----------|---------|------|
| `bash scripts/screenshot.sh` | `mdc shot` | 截屏 |
| `bash scripts/processes.sh -g` | `mdc ps` | 进程列表 |
| `bash scripts/system_info.sh --short` | `mdc info` | 系统信息 |
| `bash scripts/app_control.sh front` | `mdc front` | 前端应用 |
| `python3 scripts/desktop_ctrl.py mouse position` | `mdc mouse` | 鼠标位置 |

**设置别名**(添加到 ~/.zshrc):
```bash
echo 'alias mdc="cd ~/.openclaw/workspace/skills/macos-desktop-control && bash"' >> ~/.zshrc
source ~/.zshrc
```

---

## 🐛 故障排除

### 问题 1: 权限未授予
```bash
bash scripts/check_permissions.sh
```

### 问题 2: 脚本无执行权限
```bash
chmod +x scripts/*.sh
```

### 问题 3: pyautogui 导入失败
```bash
pip3 install --user pyautogui pyscreeze pillow psutil
```

### 问题 4: 截屏为空白
检查屏幕录制权限:
```bash
open "x-apple.systempreferences:com.apple.preference.security?Privacy_ScreenCapture"
```

---

## 📚 相关文档

- `references/permissions_guide.md` - 权限配置指南
- `references/applescript_cheatsheet.md` - AppleScript 速查表
- `references/troubleshooting.md` - 故障排除
- `examples/basic_usage.md` - 基础使用示例

---

## ⚠️ 安全说明

1. **截屏隐私**: 截屏默认保存到用户目录,请注意不要泄露敏感信息
2. **键盘记录**: 本技能不会记录键盘输入,仅模拟输入
3. **权限最小化**: 仅申请必要的权限
4. **危险操作**: 结束进程等危险操作需要确认

---

**版本**: 1.0.0  
**最后更新**: 2026-03-31  
**平台**: macOS only

Related Skills

Pest Control Operations Agent

3891
from openclaw/skills

You are an expert pest control business operations advisor. Help operators with licensing, EPA/FIFRA compliance, pricing, route optimization, seasonal planning, technician management, and growth strategy.

Business Management

Export Compliance & Trade Controls

3891
from openclaw/skills

Analyze products, destinations, and end-users against US export control regulations (EAR, ITAR, OFAC sanctions). Generate classification recommendations, license requirements, and compliance checklists.

Regulatory Compliance

ecovacs-robot-control

3891
from openclaw/skills

Control Ecovacs/DEEBOT robot vacuums via the Ecovacs IoT API. Use when the user wants to control a robot vacuum, check battery, start/stop/pause cleaning, return to dock, check clean status, set suction/water level, manage schedules, check consumables, or control auto-empty station. Covers all mainstream Ecovacs protocols including clean_V2, charge, getBattery, getCleanInfo_V2, getStats, getSpeed/setSpeed, getWaterInfo/setWaterInfo, getWorkMode/setWorkMode, getLifeSpan, getAutoEmpty/setAutoEmpty, getCachedMapInfo, getMapSet, getSched_V2/setSched_V2.

Smart Home & IoT

desktop-monitor-widget

3891
from openclaw/skills

桌面监控悬浮球 - 实时显示系统资源状态

General Utilities

free-mission-control

3891
from openclaw/skills

JARVIS Mission Control v2 — free, self-hosted command center for OpenClaw AI agents. Kanban board, real-time chat, Claude Code session tracking, GitHub Issues sync, webhook delivery monitoring, CLI console, agent SOUL editor, and a full Matrix-themed dashboard.

windows-ui-controller

3891
from openclaw/skills

Windows 软件自动化控制技能包 - 使用 pywinauto 控制微信/QQ/网易云等任何 Windows 应用。包含完整教程、依赖包、最佳实践。

xiaoai-ha-control

3891
from openclaw/skills

通过 Home Assistant + Xiaomi Miot 控制小爱音箱,并可选支持“小爱语音 → OpenClaw”的桥接。适用于两类场景:1) 用户要求“让小爱说一句… / 播报… / 通知…”、“告诉小爱… / 让小爱执行…”、“让小爱播放音频 / mp3 / 链接”时,使用本 skill 进行下行控制;2) 已接入小爱语音桥时,处理带有 `【来自小爱】` / `【来自小爱语音】` 标识的上行消息。只要任务涉及小爱音箱控制、通过小爱执行命令、通过小爱播报结果,或小爱来源消息的桥接与分流,就应使用此 skill。

opencode-acp-control

3891
from openclaw/skills

Control OpenCode directly via the Agent Client Protocol (ACP). Start sessions, send prompts, resume conversations, and manage OpenCode updates.

clawphone-wechat-control

3891
from openclaw/skills

处理微信会话列表、进入聊天、发送消息、处理微信内弹窗与聊天页失败排查。适用于用户要求查看微信消息、回复联系人、转发、处理聊天输入框或发送失败时。执行时必须先确认当前在微信的哪个页面,再按聊天场景一步一验。

clawphone-phone-control

3891
from openclaw/skills

使用手机控制 MCP 完成手机界面感知与操作。适用于读取当前手机状态、打开 App、处理弹窗、点击控件、输入文本、排查手机自动化失败等场景。执行时优先读取界面状态,涉及坐标点击时必须基于当前截图临时判定,禁止把历史坐标当成通用规则。

desktop-control

3891
from openclaw/skills

Advanced desktop automation with mouse, keyboard, and screen control. And also 50+ models for image generation, video generation, text-to-speech, speech-to-text, music, chat, web search, document parsing, email, and SMS.

controld

3891
from openclaw/skills

Manage Control D DNS filtering service via API. Use for DNS profile management, device configuration, custom blocking rules, service filtering, analytics settings, and network diagnostics. Triggers when user mentions Control D, DNS filtering, DNS blocking, device DNS setup, or managing DNS profiles.