Advanced URI from mac terminal - Encoding issue

Hello everyone!

What I’m trying to do

I’m trying to append some text to my Daily note from the macOS terminal using Advanced URI, but I can’t get it to work when the data contains an “&” character.

Here is my basic command:
open --background "obsidian://adv-uri?daily=true&mode=append&data=* 10h - Coffee & TV"

Things I have tried

  • I tried encoding and double-encoding my data (as suggested in the Advanced URI documentation), but the result file contains the encoded string instead: → 10h - Coffee%20%26%20TV

  • I tried escaping special characters in every way I could think of. It works for ", ', or /, but & breaks the command: → 10h - Coffee

  • I searched through the Advanced URI documentation, GitHub issues, and this forum but couldn’t find a clear solution.

The only workaround I found is to copy first data in clipboard and then using clipboard data but I don’t understand why it doesn’t works in first place.

Any ideas or examples ?
Thanks!