Created
June 30, 2025 21:39
-
-
Save tomsiwik/741de995c8d1b4acc6b623446b394b07 to your computer and use it in GitHub Desktop.
.env
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Create a vault for your app secrets & api keys | |
# Mine is Apps | |
op vault create Apps | |
# Go into the folder where your .env file is located. Mine is at | |
# cd project_name/packages/monorepo_pkg/ | |
# I'll use this path for the title too | |
op item create --category="Login" --vault="Apps" --title="project_name/packages/monorepo_pkg/.env" $(grep -v '^#' .env | grep -v '^$' | sed 's/\([^=]*\)=\(.*\)/\1[password]="\2"/') | |
# Read them back into .env (on another computer or smth) | |
op item get "project_name/packages/monorepo_pkg/.env" --vault="Apps" --format=json | jq -r '.fields[] | select(.type=="CONCEALED") | "\(.label)=\(.value)"' > .env |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment