Get the FREE Ultimate OpenClaw Setup Guide →

macctl

npx machina-cli add skill lu-zhengda/macos-toolkit/macctl --openclaw
Files (1)
SKILL.md
6.7 KB

macctl — macOS Environment Controller

Show power and environment status:

!macctl power status 2>&1 || echo "macctl not installed — brew install lu-zhengda/tap/macctl"

Analyze the output above. Report battery level, charging state, and health. Offer to check thermals with macctl power thermal, adjust display with macctl display, or apply a preset with macctl preset.

Commands — Power

CommandPurposeExample
macctl power statusBattery %, health, cycles, charging, time remainingmacctl power status
macctl power healthDesign vs max capacity, condition, agemacctl power health
macctl power thermalCPU/GPU temp, thermal pressure, fansmacctl power thermal
macctl power assertionsWhat is preventing sleepmacctl power assertions
macctl power hogsTop energy consumersmacctl power hogs
macctl power historyBattery/thermal trends from persistent storemacctl power history --last 7d
macctl power recordCapture power snapshot (for lanchr agent periodic recording)macctl power record

Commands — Disk

CommandPurposeExample
macctl disk statusSSD health: model, wear level, SMART statusmacctl disk status
macctl disk ioCurrent read/write MB/s and IOPSmacctl disk io
macctl disk historySSD wear trends over timemacctl disk history --last 30d
macctl disk recordCapture disk health snapshot (for lanchr agent)macctl disk record

Commands — Events

CommandPurposeExample
macctl eventsPower-related events: wake, sleep, lid, thermal, power sourcemacctl events
macctl events --last <duration>Filter events by time windowmacctl events --last 1h
macctl events --type <type>Filter by event typemacctl events --type wake
macctl events --jsonJSON output for scriptingmacctl events --json

Event types: wake, sleep, lid, thermal, power_source

Events are automatically deduplicated — consecutive same-type events within 30s are collapsed with a count.

Commands — Display

CommandPurposeExample
macctl display listConnected displays with resolution, refresh, profilemacctl display list
macctl display resolutionGet current resolutionmacctl display resolution
macctl display resolution <WxH>Set resolutionmacctl display resolution 1920x1080
macctl display brightnessGet current brightnessmacctl display brightness
macctl display brightness <0-100>Set brightnessmacctl display brightness 70
macctl display nightshift [on|off]Toggle Night Shiftmacctl display nightshift on
macctl display truetone [on|off]Toggle True Tonemacctl display truetone on

Commands — Audio

CommandPurposeExample
macctl audio listList input and output devicesmacctl audio list
macctl audio outputGet current output devicemacctl audio output
macctl audio output <device>Switch audio outputmacctl audio output "AirPods Pro"
macctl audio inputGet current input devicemacctl audio input
macctl audio input <device>Switch audio inputmacctl audio input "MacBook Pro Microphone"
macctl audio volumeGet current volumemacctl audio volume
macctl audio volume <0-100>Set volumemacctl audio volume 50
macctl audio mute [on|off|toggle]Control mutemacctl audio mute toggle
macctl audio testPlay test tone and mic checkmacctl audio test

Commands — Focus

CommandPurposeExample
macctl focus statusCurrent focus mode and DnD statemacctl focus status
macctl focus on [mode]Enable a focus modemacctl focus on "Do Not Disturb"
macctl focus offDisable current focus modemacctl focus off
macctl focus listList configured focus modesmacctl focus list

Commands — Presets

CommandPurposeExample
macctl preset <name>Apply a compound presetmacctl preset deep-work

Compound Presets

Presets span all four domains in a single command:

PresetDisplayAudioFocusNotes
deep-workDim to 50%MuteDnD onMinimize distractions
meetingNo changeAirPods + unmuteDnD on (allow calls)Ready for calls
presentMirror 1080p, 100% brightnessSpeakersDnD onPresentation mode
chillDim to 40%, Night Shift onVolume 30%DnD offRelaxed evening
battery-saverDim to 30%MuteNo changeExtend battery life

Example workflow:

# Start a focused coding session
macctl preset deep-work

# Switch to a meeting
macctl preset meeting

# Done for the day
macctl preset chill

JSON Output

Add --json to any read command for machine-readable output:

macctl power status --json
macctl power thermal --json
macctl power history --json
macctl disk status --json
macctl disk io --json
macctl disk history --json
macctl events --json
macctl display list --json
macctl audio list --json
macctl focus status --json
macctl focus list --json

Safety Guidelines

  • Presets are reversible: Apply another preset or manually adjust individual settings
  • Brightness changes are immediate: Display brightness adjusts instantly
  • Audio routing affects all apps: Switching output device redirects all audio
  • Focus mode respects system config: Focus presets use modes configured in System Settings
  • Resolution changes may flash: Screen may briefly flash when changing resolution

TUI Mode

Launch macctl without arguments for an interactive environment dashboard.

Source

git clone https://github.com/lu-zhengda/macos-toolkit/blob/main/skills/macctl/SKILL.mdView on GitHub

Overview

macctl is a macOS environment controller that surfaces power and environment status and lets you adjust display, audio routing, focus settings, and presets for meetings or presentations. It reports battery health, thermal data, display details, audio devices, and SSD health, then applies quick changes with simple commands.

How This Skill Works

macctl exposes categorized commands (power, disk, display, audio, events) to query sensors and perform changes. You run subcommands to retrieve status or apply settings, and some outputs can be streamed or reformatted for scripting. The toolkit supports presets and status reports across power, display, audio, and focus-related features.

When to Use It

  • Check battery level, charging state, and health before a trip or heavy task
  • Inspect CPU/GPU temperatures and thermal status during long builds or rendering
  • Adjust display brightness or change resolution for presentations or editing
  • Toggle Night Shift, enable Do Not Disturb, or switch Focus modes for work sessions
  • List displays or audio devices to troubleshoot I/O or prepare a setup

Quick Start

  1. Step 1: macctl power status
  2. Step 2: macctl power thermal (optional for temps) or macctl display brightness 70
  3. Step 3: Apply a preset, e.g., macctl preset deep_work (or macctl preset meeting)

Best Practices

  • Always start with macctl power status to establish baseline battery health and charging state
  • Use macctl power thermal before intensive tasks to anticipate thermal throttling
  • Adjust display with macctl display brightness or resolution for precise control
  • Leverage presets (deep_work, meeting, presentation) to apply multiple settings consistently
  • Combine status commands with disk and events queries to diagnose sleep or performance issues

Example Use Cases

  • macctl power status
  • macctl display brightness 70
  • macctl display list
  • macctl events --json
  • macctl preset meeting

Frequently Asked Questions

Add this skill to your agents
Sponsor this space

Reach thousands of developers