macOS CLI cannot attach media
-
“A required entitlement isn’t present” / cannot write to PendingMedia Summary The macOS command line tool creates text entries correctly, but silently fails to attach any media. It reports success (
EXIT=0) and creates the entry without the attachment, so the failure is easy to miss. Environment – macOS (current release) – Day One for Mac, current version – CLI at/Applications/Day One.app/Contents/MacOS/dayone– Invoked directly from a shell (and from a third-party automation tool) Steps to reproduce 1. Have any image file available, e.g./Users/me/Downloads/cover.jpg2. Run:"/Applications/Day One.app/Contents/MacOS/dayone" --verbose new "Test entry" --no-stdin --attachments "/Users/me/Downloads/cover.jpg"<code>3. Check the created entry in Day One. **Expected:** the entry is created with the image attached. **Actual:** the entry is created **without** the image. The command exits</code> 0 <code>and prints</code> Created new entry with uuid: ...<code>, so nothing signals the failure. **Verbose output**</code>[Keychain] Unable to Fetch All Items: Error Domain=com.samsoffes.sskeychain Code=-34018 "A required entitlement isn't present." - SSKeychainQuery Service [Day One UDID] AccessGroup [5U8NS4GX82.dayone-access-group] [Keychain] Failure saving new Keychain Item: Error Domain=com.samsoffes.sskeychain Code=-34018 "A required entitlement isn't present." Error saving to keychain: A required entitlement isn't present. Unable to copy media file to pending media area: Error Domain=NSCocoaErrorDomain Code=513 "“cover.jpg” couldn’t be copied because you don’t have permission to access “PendingMedia”." NSSourceFilePathErrorKey=/Users/me/Downloads/cover.jpg NSDestinationFilePath=/Users/me/Library/Group Containers/5U8NS4GX82.dayoneapp2/Data/Documents/PendingMedia/<UUID>.jpg NSUnderlyingError=0x... {Error Domain=NSPOSIXErrorDomain Code=1 "Operation not permitted"} Created new entry with uuid: <UUID> EXIT=0<code>**What I've already ruled out** - **File location:** tried</code> /tmp<code>,</code> ~/Downloads<code>, and other user-writable paths — identical failure. - **File format:** tried JPEG and WebP — identical failure. - **App running:** same failure whether Day One is open and frontmost or closed. - **Launch method:** same failure when launched directly and via</code> open<code>. - **Remote URLs:**</code> --attachments <code>with an</code> https:// <code>URL fails outright (no entry created at all), consistent with the help text requiring a local path. **Related: URL scheme</code> imageClipboard <code>also doesn't attach** As a workaround I tried the documented URL scheme parameter:</code>open "dayone://post?entry=Test&imageClipboard=1"`with a genuine image on the clipboard (verified viaosascript -e “clipboard info”showing«class PNGf»,JPEG picture,TIFF picture). The entry is created in the correct journal with the correct tags, but **no image is attached**. **Question** Is the CLI expected to be able to attach media when invoked outside the app's own launch context? TheCode=-34018keychain error and thePendingMediawrite failure both suggest the tool isn't receiving the entitlements it needs to reach the app's group container. If this is a known limitation, is there a supported way to attach media from a script — or is the URL scheme'simageClipboardparameter intended to cover that case?