5

I'd like to use sops to edit files in my IDE (Intellij), but I'm not sure how best to set it up as an External Tool.

I found these related questions:

drewish
  • 9,042
  • 9
  • 38
  • 51

3 Answers3

3

IntelliJ IDEA at least 2020.2 does now support --wait

https://www.jetbrains.com/help/idea/working-with-the-ide-features-from-command-line.html#arguments

I tried

export EDITOR="idea --wait"
sops secret.yaml

Unfortunately doesn't work even though in idea there is the message

Activated from command line: Command line will be waiting until the file '/Users/user/Development/../secret.yaml' has been closed.

Vad1mo
  • 5,156
  • 6
  • 36
  • 65
1

IntelliJ IDEA has no support for --wait and cannot be used via the EDITOR environment.

See this issue and the linked duplicates.

External tool will not work. This can be supported by implementing IntelliJ IDEA plug-in that will integrate with the command line tool to transparently encrypt/decrypt the files you are editing.

CrazyCoder
  • 389,263
  • 172
  • 990
  • 904
1

As of 2020.3.2 i can confirm that setting environment EDITOR to

"C:\\Program Files\\JetBrains\\GoLand 2020.3.2\\bin\\goland.exe" --wait

and then using sops <file.enc.yaml> works fine for me (in windows). You need to press Ctrl-S each time you want changes to be saved since opened file treated as external for the project you working with.

mainpart
  • 538
  • 5
  • 8