← 返回 Skills 市场
2669
总下载
2
收藏
25
当前安装
1
版本数
在 OpenClaw 中安装
/install macos
功能描述
macOS system administration, command-line differences from Linux, and automation best practices.
使用说明 (SKILL.md)
BSD vs GNU Commands
sed -irequires extension argument:sed -i '' 's/a/b/' file— empty string for no backup, Linux doesn't need itfinddoesn't support-printf— use-exec statorxargswithstat -finsteaddateuses different format flags:date -j -f '%Y-%m-%d' '2024-01-15' '+%s'—-jprevents setting timegrep -P(Perl regex) doesn't exist — usegrep -E(extended) or installggrepvia Homebrewxargsdefaults to/usr/bin/echonot the command — always specify the command explicitlyreadlink -fdoesn't exist — userealpathorpython3 -c "import os; print(os.path.realpath('path'))"
Homebrew Paths
- Apple Silicon:
/opt/homebrew/bin,/opt/homebrew/lib - Intel:
/usr/local/bin,/usr/local/lib - Check architecture:
uname -mreturnsarm64orx86_64 - Homebrew doesn't add to PATH automatically — check
~/.zprofilefor eval line - Running x86 binaries:
arch -x86_64 /bin/bashthen install/run Intel-only tools
Keychain (Secrets)
- Store:
security add-generic-password -a "$USER" -s "service_name" -w "secret_value" -U - Retrieve:
security find-generic-password -a "$USER" -s "service_name" -w -Uflag updates if exists — without it, duplicate entries error- Keychain prompts for access on first use — authorize permanently for automation
- Delete:
security delete-generic-password -a "$USER" -s "service_name"
launchd (Services)
- User agents:
~/Library/LaunchAgents/— runs as user when logged in - System daemons:
/Library/LaunchDaemons/— runs at boot as root - Load:
launchctl load -w ~/Library/LaunchAgents/com.example.plist - Unload before editing:
launchctl unload— edits to loaded plists are ignored - Check errors:
launchctl list | grep service_namethenlaunchctl error \x3Cexit_code> - Logs:
log show --predicate 'subsystem == "com.example"' --last 1h
Privacy Permissions (TCC)
- Automation scripts fail silently without Full Disk Access or Automation permissions
- Grant in System Settings → Privacy & Security → corresponding category
- Terminal and iTerm need separate permissions — granting to one doesn't grant to other
tccutil resetclears permissions:tccutil reset AppleEventsfor Automation- Check granted permissions:
sqlite3 ~/Library/Application\ Support/com.apple.TCC/TCC.db "SELECT * FROM access"
defaults (Preferences)
- Read:
defaults read com.apple.finder AppleShowAllFiles - Write:
defaults write com.apple.finder AppleShowAllFiles -bool true - Delete:
defaults delete com.apple.finder AppleShowAllFiles - Restart app after changing:
killall Finder - Find app bundle ID:
osascript -e 'id of app "App Name"' - Export all:
defaults export com.apple.finder -outputs XML
File Operations
dittopreserves resource forks and metadata — use instead ofcpfor app bundles- Create DMG:
hdiutil create -volname "Name" -srcfolder ./folder -format UDZO output.dmg - Mount DMG:
hdiutil attach image.dmg— returns mount point path - Unmount:
hdiutil detach /Volumes/Name - Extended attributes:
xattr -l fileto list,xattr -c fileto clear all - Quarantine removal:
xattr -d com.apple.quarantine app.app
Clipboard
- Copy to clipboard:
echo "text" | pbcopy - Paste from clipboard:
pbpaste - Copy file contents:
pbcopy \x3C file.txt - Preserve RTF:
pbpaste -Prefer rtf - Clipboard works in SSH sessions to local machine — useful for remote file copying
Screenshots and Screen
- Screenshot region to file:
screencapture -i output.png - Screenshot window:
screencapture -w output.png - Screenshot to clipboard:
screencapture -c - Headless (no UI):
screencapture -x— suppresses sound and cursor - Screen recording requires Screen Recording permission in Privacy settings
Process Management
- Prevent sleep:
caffeinate -i command— keeps system awake while command runs - Prevent sleep with timeout:
caffeinate -t 3600— 1 hour - Check why not sleeping:
pmset -g assertions - Power settings:
pmset -gto view,sudo pmset -a sleep 0to disable sleep - Current app in focus:
osascript -e 'tell application "System Events" to get name of first process whose frontmost is true'
Network
- List interfaces:
networksetup -listallhardwareports - Get IP:
ipconfig getifaddr en0(Wi-Fi usually en0 on laptops) - DNS servers:
scutil --dns | grep nameserver - Flush DNS:
sudo dscacheutil -flushcache; sudo killall -HUP mDNSResponder - Proxy settings:
networksetup -getwebproxy "Wi-Fi"
System Integrity Protection
- Check status:
csrutil status - Disable (Recovery Mode only):
csrutil disable— not recommended for production - Protected paths:
/System,/usr(except/usr/local),/sbin,/bin - Can't modify these even as root — design your automations around this
Logs
- Stream live:
log stream --predicate 'process == "processname"' - Search recent:
log show --last 1h --predicate 'eventMessage contains "error"' - Subsystem filter:
log show --predicate 'subsystem == "com.apple.example"' - Save to file:
log collect --output ./logs.logarchive— opens in Console.app
Automation Tips
- Open URL:
open "https://example.com"— uses default browser - Open app:
open -a "Safari"— by name, not path - Open file with specific app:
open -a "TextEdit" file.txt - Run AppleScript:
osascript -e 'tell application "Finder" to get name of home' - Spotlight search:
mdfind "kMDItemDisplayName == 'filename.txt'"— faster than find for indexed files
安全使用建议
This skill is a coherent macOS admin guide and appears benign, but it contains commands that read or change sensitive system state (Keychain operations, reading the TCC DB, resetting privacy permissions, altering power settings, and instructions mentioning disabling SIP). Before installing or letting an agent run these instructions: 1) review each command and only run ones you understand; 2) never run copied sudo commands without knowing the effect; 3) expect Keychain and TCC operations to prompt macOS permissions and potentially expose secrets if misused; 4) back up important data/configuration before making system changes; and 5) consider requiring explicit user confirmation before the agent executes any command that requires elevated privileges or could be disruptive.
功能分析
Type: OpenClaw Skill
Name: macos
Version: 1.0.0
The skill bundle is classified as suspicious due to the extensive range of powerful macOS system administration commands it describes, which, while plausibly needed for its stated purpose, significantly expand the attack surface for prompt injection. Key risky capabilities include instructions for interacting with the Keychain (`security find-generic-password`), managing `launchd` services (`launchctl load`), resetting privacy permissions (`tccutil reset`), removing file quarantine attributes (`xattr -d com.apple.quarantine`), taking screenshots (`screencapture`), and opening arbitrary URLs (`open`). Although the `SKILL.md` file itself does not contain explicit malicious instructions, the availability of these high-risk capabilities to an AI agent makes it a potent tool for potential misuse if a malicious prompt were to leverage them.
能力评估
Purpose & Capability
Name/description align with the content: SKILL.md provides macOS-specific command-line tips, Homebrew paths, Keychain, launchd, TCC, SIP, file ops, logs, and automation—everything requested is consistent with macOS administration.
Instruction Scope
Instructions stay within macOS admin scope, but include sensitive operations (reading the TCC DB via sqlite3, Keychain add/find/delete, sudo pmset, csrutil disable instructions, launchctl load/unload, tccutil reset). These are legitimate for an admin guide but can affect privacy/security or system stability; they should only be executed with explicit user consent and appropriate privileges.
Install Mechanism
No install spec and no code files — instruction-only skill. Nothing will be written to disk by an installer during install, minimizing installation risk.
Credentials
Skill declares no environment variables, no credentials, and no config paths. It does reference macOS system paths and commands appropriately for the stated purpose; no disproportionate credential requests.
Persistence & Privilege
always:false and no requested persistence. The skill does not request elevated persistent privileges or modify other skills or system-wide agent settings.
如何使用
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install macos - 安装完成后,直接呼叫该 Skill 的名称或使用
/macos触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
版本历史
v1.0.0
Initial release
元数据
常见问题
macOS 是什么?
macOS system administration, command-line differences from Linux, and automation best practices. 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 2669 次。
如何安装 macOS?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install macos」即可一键安装,无需额外配置。
macOS 是免费的吗?
是的,macOS 完全免费(开源免费),可自由下载、安装和使用。
macOS 支持哪些平台?
macOS 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 macOS?
由 Iván(@ivangdavila)开发并维护,当前版本 v1.0.0。
推荐 Skills