skills/bun-guides-runtime-codesign-macos-executable/SKILL.md
Fix the "can't be opened because it is from an unidentified developer" Gatekeeper warning when running your JavaScript executable.
npx skillsauth add jarle/bun-skills Bun Codesign a single-file JavaScript executable on macOSInstall this skill globally with one command. Works with Claude Code, Cursor, and Windsurf.
3 of 9 scanners reported clean
Some scanners were skipped, did not run, or reported a non-clean status. Review each row below.
Fix the "can't be opened because it is from an unidentified developer" Gatekeeper warning when running your JavaScript executable.
Compile your executable using the --compile flag.
bun build --compile ./path/to/entry.ts --outfile myapp
List your available signing identities. One of these will be your signing identity that you pass to the codesign command. This command requires macOS.
security find-identity -v -p codesigning
1. XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX "Developer ID Application: Your Name (ZZZZZZZZZZ)"
1 valid identities found
Optional, but recommended: create an entitlements.plist file with the necessary permissions for the JavaScript engine to work correctly.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>com.apple.security.cs.allow-jit</key>
<true/>
<key>com.apple.security.cs.allow-unsigned-executable-memory</key>
<true/>
<key>com.apple.security.cs.disable-executable-page-protection</key>
<true/>
<key>com.apple.security.cs.allow-dyld-environment-variables</key>
<true/>
<key>com.apple.security.cs.disable-library-validation</key>
<true/>
</dict>
</plist>
Sign your executable using the codesign command and verify it works.
codesign --entitlements entitlements.plist -vvvv --deep --sign "XXXXXXXXXX" ./myapp --force
codesign -vvv --verify ./myapp
For more information on macOS codesigning, refer to Apple's Code Signing documentation. For details about creating single-file executables with Bun, see Standalone Executables. This guide requires Bun v1.2.4 or newer.
development
Using TypeScript with Bun, including type definitions and compiler options
development
Learn how to write tests using Bun's Jest-compatible API with support for async tests, timeouts, and various test modifiers
testing
Learn how to use snapshot testing in Bun to save and compare output between test runs
testing
Learn about Bun test's runtime integration, environment variables, timeouts, and error handling