opencode icon indicating copy to clipboard operation
opencode copied to clipboard

Add audio input and camera permissions to entitlements

Open saeedvaziry opened this issue 2 weeks ago • 3 comments

This PR adds camera and audio entitlements to the desktop app.

Why?

While opencode doesn't need camera or audio, it has a built-in terminal which can be used to run the project that you're working with.

For example I am working on an app that requires camera and audio permissions and without this I am not able to run the app in my local because macOS doesn't allow camera or audio if it is not included in the entitlements file.

This has been already considered in terminal emulators like Ghostty or Alacrritty for such scenarios.

saeedvaziry avatar Jan 06 '26 19:01 saeedvaziry

The following comment was made by an LLM, it may be inaccurate:

No duplicate PRs found

github-actions[bot] avatar Jan 06 '26 20:01 github-actions[bot]

cc @Brendonovich

adamdotdevin avatar Jan 06 '26 20:01 adamdotdevin

@adamdotdevin @Brendonovich I only added audio and camera. Does it make sense to inherit from what Ghostty has to avoid another PR in the future?

Like this:

<key>com.apple.security.automation.apple-events</key>
<true/>
<key>com.apple.security.device.audio-input</key>
<true/>
<key>com.apple.security.device.camera</key>
<true/>
<key>com.apple.security.personal-information.addressbook</key>
<true/>
<key>com.apple.security.personal-information.calendars</key>
<true/>
<key>com.apple.security.personal-information.location</key>
<true/>
<key>com.apple.security.personal-information.photos-library</key>

saeedvaziry avatar Jan 06 '26 20:01 saeedvaziry

I think adding all of them would make sense. Does this cause OC to prompt for all these things on startup or does it just give it the ability to prompt for them when needed?

Brendonovich avatar Jan 07 '26 03:01 Brendonovich

Does this cause OC to prompt for all these things on startup or does it just give it the ability to prompt for them when needed

No opencode doesn't prompt it neither gets the permissions.

It just gives OC the entitlements and authorization by mac that it can request for such permissions and the apps you run via OC's terminal can request for such permissions.

saeedvaziry avatar Jan 07 '26 09:01 saeedvaziry