chezmoi/Q/What is the idiomatic way to add the Obsidian CLI to PATH via chezmoi dotfiles and install Obsidian in a Brewfile?
Properties
- logseq-entity
- Logseq/Entity/Question
- see-also
- Zsh/Init/File
What is the idiomatic way to add the Obsidian CLI to PATH via chezmoi dotfiles, and install Obsidian in a Brewfile?
AI Answer
- AI/Response
- Short answer: Add
cask "obsidian"to arun_onchange_before_install-packages-darwin.sh.tmplheredoc script (the chezmoi-idiomatic package-install pattern), and export the PATH entry indot_zprofile.tmplwith a macOS template guard. - Brewfile / package installation:
- The idiomatic chezmoi pattern for Homebrew is an inline heredoc inside a
run_onchange_script, not a standaloneBrewfile. chezmoi only re-runs the script when its content changes, avoiding redundantbrew bundleruns on everychezmoi apply. - File:
~/.local/share/chezmoi/run_onchange_before_install-packages-darwin.sh.tmpl - Obsidian is a cask (GUI macOS app), not a formula —
cask "obsidian"is the correct entry.
- The idiomatic chezmoi pattern for Homebrew is an inline heredoc inside a
- PATH addition:
- Obsidian's settings can add
/Applications/Obsidian.app/Contents/MacOSto PATH to expose theobsidianCLI binary. To manage this in chezmoi, add the export todot_zprofile.tmpl. - Prefer
dot_zprofileoverdot_zshrcfor macOS PATH additions:.zprofileloads after/etc/zprofile(which runspath_helper), so additions here survive macOS's built-in path reordering;.zshrcis for interactive aliases, not login-shell PATH. - File:
~/.local/share/chezmoi/dot_zprofile.tmpl - Use
.tmplonly if the file has machine- or OS-varying content. If macOS-only, a plaindot_zprofilewith a hardcoded export line works equally well.
- Obsidian's settings can add
- Sources: chezmoi macOS guide · chezmoi: use scripts · Homebrew cask: obsidian
- Short answer: Add
- AI/Response