360 Secure SkillHub
360 安全技能中心

macos-audio

该 Skill 以 macOS 上的 macos-audio CLI 为核心,指导扫描蓝牙/本地/AirPlay 音频设备、连接与断开蓝牙、切换输出路由、读取与设置音量、播放本地音频文件以及查询音频状态,并说明退出码含义、brew 依赖安装方式与已知限制(不支持 ssh,AirPlay 仍属实验功能)。

vossenwout
vossenwout
热度 72.02
最近更新 2026-05-11 17:31:05
分类:自动化依赖:代码执行 / 读写文件应用场景:自动化脚本 / 工作流

安装技能

复制下面的话术发给你的 Agent,它会通过 secure-skills 检索并安装该技能。

执行命令安装此 skill: npx secure-skills-cli add macos-audio
Metadata
name
macos-audio
description
Manage macOS audio output and Bluetooth devices via the macos-audio CLI. Use when scanning paired devices, connecting or disconnecting Bluetooth, switching audio output (including AirPlay), getting or setting volume, playing audio files, or checking audio status.

macos-audio

Control Bluetooth devices, audio output routing, and volume on macOS through the macos-audio CLI.

Installation

Brew dependencies

brew install switchaudio-osx   # required for output switching
brew install blueutil           # required for Bluetooth control

Install the CLI

brew install vossenwout/tap/macos-audio-cli

Commands

Scan & connect

macos-audio scan                # clean sections: Bluetooth, Local, AirPlay
macos-audio connect bt <name|mac>
macos-audio connect airplay
macos-audio connect local <name>
macos-audio disconnect <target> # disconnect bluetooth and switch to local output

Volume

macos-audio volume set <0-100>  # set system output volume
macos-audio volume get          # print output volume, input volume, mute state

Playback

macos-audio play <file>                    # play a local audio file
macos-audio play <file> --background       # start playback and return immediately

Status

macos-audio status                         # show output, volume, mute state
macos-audio status --json                  # same but machine-readable JSON
macos-audio status --device <name|mac>     # include bluetooth status for a specific device

Exit codes

Code Meaning
0 Success
1 Runtime error
2 Bad arguments
3 Target resolution error
4 Missing tool dependency (blueutil or SwitchAudioSource not installed)

Workflow guidance

  • Always run macos-audio status first to understand the current state before making changes.
  • If a command exits with code 4, the required brew dependency is missing — install it and retry.
  • connect airplay uses the generic AirPlay route; room names in scan are informational.
  • Bluetooth devices only appear in scan after manual pairing in macOS.

Limitations

  • Doesn't work over ssh
  • connect airplay is known to be buggy and airplay functionality is still experimental