@@ -50,6 +50,22 @@ docker_git_link_gemini_file() {
5050docker_git_link_gemini_file "$GEMINI_CONFIG_DIR/.api-key" "$GEMINI_HOME_DIR/.api-key"
5151docker_git_link_gemini_file "$GEMINI_CONFIG_DIR/.env" "$GEMINI_HOME_DIR/.env"
5252
53+ # Ensure gemini YOLO wrapper exists
54+ GEMINI_REAL_BIN="$(command -v gemini || echo "/usr/local/bin/gemini")"
55+ GEMINI_WRAPPER_BIN="/usr/local/bin/gemini-wrapper"
56+ if [[ -f "$GEMINI_REAL_BIN" && "$GEMINI_REAL_BIN" != "$GEMINI_WRAPPER_BIN" ]]; then
57+ if [[ ! -f "$GEMINI_WRAPPER_BIN" ]]; then
58+ cat <<'EOF' > "$GEMINI_WRAPPER_BIN"
59+ #!/usr/bin/env bash
60+ GEMINI_ORIGINAL_BIN="__GEMINI_REAL_BIN__"
61+ exec "$GEMINI_ORIGINAL_BIN" --yolo "$@"
62+ EOF
63+ sed -i "s#__GEMINI_REAL_BIN__#$GEMINI_REAL_BIN#g" "$GEMINI_WRAPPER_BIN" || true
64+ chmod 0755 "$GEMINI_WRAPPER_BIN" || true
65+ # Create an alias or symlink if needed, but here we just ensure it exists
66+ fi
67+ fi
68+
5369# Special case for .gemini folder: we want the folder itself to be the link if it doesn't exist
5470# or its content to be linked if we want to manage it.
5571if [[ -d "$GEMINI_CONFIG_DIR/.gemini" ]]; then
@@ -137,7 +153,7 @@ printf "export GEMINI_HOME=%q\n" "${config.geminiHome}" >> "$GEMINI_PROFILE"
137153printf "export GEMINI_CLI_DISABLE_UPDATE_CHECK=true\n" >> "$GEMINI_PROFILE"
138154printf "export GEMINI_CLI_NONINTERACTIVE=true\n" >> "$GEMINI_PROFILE"
139155printf "export GEMINI_CLI_APPROVAL_MODE=yolo\n" >> "$GEMINI_PROFILE"
140- printf "alias gemini='gemini --yolo '\n" >> "$GEMINI_PROFILE"
156+ printf "alias gemini='/usr/local/bin/ gemini-wrapper '\n" >> "$GEMINI_PROFILE"
141157cat <<'EOF' >> "$GEMINI_PROFILE"
142158if [[ -f "$GEMINI_HOME/.api-key" ]]; then
143159 export GEMINI_API_KEY="$(cat "$GEMINI_HOME/.api-key" | tr -d '\r\n')"
0 commit comments