twpayne / chezmoi

Manage your dotfiles across multiple diverse machines, securely.
https://www.chezmoi.io/
MIT License
13.35k stars 493 forks source link

Tidy up 1Password template functions #2669

Closed twpayne closed 12 months ago

twpayne commented 1 year ago

Is your feature request related to a problem? Please describe.

chezmoi includes a bunch of 1Password-related template functions, several of which relate to 1Password CLI v1, which is long since deprecated. These functions cause unnecessary confusion for users.

Describe the solution you'd like

chezmoi should remove all 1Password CLI v1-related template functions, as hopefully everybody has migrated to 1Password CLI v2.

Describe alternatives you've considered

Maintaining the existing 1Password CLI v1 functions for backwards compatibilty.

Additional context

https://github.com/twpayne/chezmoi/discussions/1974 cc @halostatue

halostatue commented 1 year ago

I’d like to raise the idea of revisiting the functions and potentially implementing new functions with different names and improved behaviour.

One thing that would be nice—and I’m not sure how it would be done—is having less reliance on the order of parameters after the first (this may apply to other classes of functions that interact with external systems).

Right now, if I want to ensure that I pull something from a particular account (which is sort of required when you have multiple accounts on modern 1Password CLI), I need to do something like {{ onepasswordDocument "my-document" "specific-vault" "specific-account" }}, but my naming convention for my-document is such that all I should need is {{ onepasswordDocument "my-document" "specific-account" }}. I know that Go templates have no real way of doing named parameters, and something like {{ opDocument "my-document" "account=specific-account" }} doesn’t seem to be any better, but it would be nice to figure out a way for the ergonomics to be improved here.

twpayne commented 12 months ago

Let's fold this into #2668. Closing.