I love working in the command line, but one part of OS X that thus far has been difficult to script is modifying the accessibility database in OS X 10.9.

There are many examples out there of people needing to do something like this:

Download The Utility

https://github.com/jacobsalmela/tccutil/releases

or install it via Homebrew:

brew install tccutil

Apple’s Limited Utility

Apple has an existing utility called tccutil, which lives in /usr/bin, but it only supports one command:

tccutil reset SERVICE

This command will just remove everything, which is useful, but very limited.  When trying to script a GUI login, I found myself needing to enable osascript for access to assistive devices–I use osacript to simulate keystrokes at the login window–but you cannot just drag-and-drop it into the System Preference window like you can with an .app.  So I decided to write a Python program–tccutil.py— which could add or remove items into the database.