@@ -16,6 +16,12 @@ echo "Setting up environment variables..."
1616read -p " Enter your Git Name: " GIT_NAME
1717read -p " Enter your Git Email: " GIT_EMAIL
1818
19+ echo " "
20+ echo " Optional: SSH Public Key for commit signing."
21+ echo " If you use 1Password as your SSH agent, you can copy the public key string directly."
22+ echo " (e.g., ssh-ed25519 AAAAC3Nz...)"
23+ read -p " Enter your SSH Public Key (press Enter to skip): " SSH_PUBLIC_KEY
24+
1925echo " "
2026echo " Optional: The Gemini API Key is used by the Gemini CLI inside this Devcontainer."
2127echo " You can get an API key from: https://aistudio.google.com/app/apikey"
@@ -50,10 +56,20 @@ update_env() {
5056update_env " GIT_NAME" " $GIT_NAME "
5157update_env " GIT_EMAIL" " $GIT_EMAIL "
5258
59+ if [ -n " $SSH_PUBLIC_KEY " ]; then
60+ update_env " SSH_PUBLIC_KEY" " $SSH_PUBLIC_KEY "
61+ fi
62+
5363# Also configure git locally for the current environment
5464git config --global user.name " $GIT_NAME "
5565git config --global user.email " $GIT_EMAIL "
5666
67+ if [ -n " $SSH_PUBLIC_KEY " ]; then
68+ git config --global gpg.format ssh
69+ git config --global user.signingkey " key::${SSH_PUBLIC_KEY} "
70+ git config --global commit.gpgsign true
71+ fi
72+
5773if [ -n " $GEMINI_API_KEY " ]; then
5874 update_env " GEMINI_API_KEY" " $GEMINI_API_KEY "
5975fi
0 commit comments