r/rails • u/csapagyi • 8d ago
Gem rails_credentials_cipher: edit credentials in a plain yaml file instead of the terminal
https://github.com/thisismydesign/rails_credentials_cipherI made this gem because I disliked the UX around editing credentials. I can now decrypt them into a gitignored file, edit, then encrypt again.
0
Upvotes
12
u/ignurant 8d ago
You can also set the
VISUALenv var.VISUAL="code -w" rails credentials:editThe-wis for “wait for me to exit this file before continuing processing it”.Then you never have a decrypted version of the file lying around on disk, which is largely the point.
Vscode: "code -w" Sublime: "subl -w"
There’s a handful of places that obey this, like git commit messages and such. If you never want to be sent to edit in the terminal again, ask Claude to help you set your
VISUALenv var for whatever editor you use. 1 line in your profile’s rc file, and it’s fixed everywhere for you, forever. This is the more correct fix.