Accessibility support varies wildly between Mac apps. Some publish a clean tree; some expose buttons with no press action; some publish nothing until you set an obscure attribute. Every quirk you document saves the next person an afternoon.
If an app misbehaves, open an issue with:
scu doctor
scu axdump --app "That App" --actions --max 200Include what you expected and what happened. That's enough to turn it into a documented workaround or a code fix.
git clone https://github.com/paperfoot/scu && cd scu
make # builds ./scu
make test # regression suite, drives a real TextEdit window
make conform # agent-cli-framework conformance probeBoth suites must pass before a PR merges. make test needs Accessibility granted to your
terminal; run scu doctor if it complains.
src/output.swift format detection, JSON envelope, exit codes
src/args.swift argument access
src/ax.swift tree walking, addressing, settle, cursor, windows
src/actions.swift press/type/key/scroll/drag primitives
src/commands.swift one function per command
src/doctor.swift permission diagnostics
src/agentinfo.swift capability manifest and help text
src/main.swift entry point and dispatch
Plain Swift, no third-party dependencies. Keep it that way.
These hold the agent contract together. A change that breaks one is a bug.
- Every stdout path respects the output format. JSON when piped, human text in a terminal. No raw text leaks.
- Errors go to stderr with a code, a message, and a suggestion. The suggestion is a literal command someone can run — a wrong one is worse than none.
- Exit codes are 0-4 and nothing else.
0success,1transient,2config,3bad input,4rate limited. agent-infomatches reality. If it lists a command, that command works. Add new commands to the manifest in the same commit.- No interactive prompts. Never read stdin except for a piped batch script.
- Never steal focus. No
activate, noactivateIgnoringOtherApps. If a change makes an app come forward, it's wrong, andmake testwill catch it.
- Write
cmdYourThing()incommands.swift, ending inemit(...)orfail(...). - Add a
caseinmain.swift. - Add a
CmdSpectocommandSpecsinagentinfo.swift. - Add a line to
helpText. - Add a case to
test/regression.sh.
Match the surrounding code. Comments explain why, not what — the AX API has enough non-obvious behaviour to justify them, and the existing comments are the model.