Skip to content

Commit 9c2e454

Browse files
committed
fix: use positional argument instead of deprecated --prompt flag
The Gemini CLI has deprecated the --prompt (-p) flag and recommends using positional arguments instead. This change updates the CLI invocation to pass the prompt as a positional argument, eliminating the deprecation warning: "The --prompt (-p) flag has been deprecated and will be removed in a future version. Please use a positional argument for your prompt." Changes: - Update gemini CLI invocations to use positional argument - Update input description to reflect positional argument usage - Regenerate README.md documentation Fixes #453
1 parent b7c22b0 commit 9c2e454

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ go to the [Gemini Assistant workflow documentation](./examples/workflows/gemini-
175175

176176
- <a name="__input_google_api_key"></a><a href="#user-content-__input_google_api_key"><code>google_api_key</code></a>: _(Optional)_ The Vertex AI API key to use with Gemini.
177177

178-
- <a name="__input_prompt"></a><a href="#user-content-__input_prompt"><code>prompt</code></a>: _(Optional, default: `You are a helpful assistant.`)_ A string passed to the Gemini CLI's [`--prompt` argument](https://github.com/google-gemini/gemini-cli/blob/main/docs/get-started/configuration.md#command-line-arguments).
178+
- <a name="__input_prompt"></a><a href="#user-content-__input_prompt"><code>prompt</code></a>: _(Optional, default: `You are a helpful assistant.`)_ A string passed to the Gemini CLI as a [positional argument](https://github.com/google-gemini/gemini-cli/blob/main/docs/get-started/configuration.md#command-line-arguments).
179179

180180
- <a name="__input_settings"></a><a href="#user-content-__input_settings"><code>settings</code></a>: _(Optional)_ A JSON string written to `.gemini/settings.json` to configure the CLI's _project_ settings.
181181
For more details, see the documentation on [settings files](https://github.com/google-gemini/gemini-cli/blob/main/docs/get-started/configuration.md#settings-files).

action.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ inputs:
5656
required: false
5757
prompt:
5858
description: |-
59-
A string passed to the Gemini CLI's [`--prompt` argument](https://github.com/google-gemini/gemini-cli/blob/main/docs/get-started/configuration.md#command-line-arguments).
59+
A string passed to the Gemini CLI as a [positional argument](https://github.com/google-gemini/gemini-cli/blob/main/docs/get-started/configuration.md#command-line-arguments).
6060
required: false
6161
default: 'You are a helpful assistant.'
6262
settings:
@@ -294,14 +294,14 @@ runs:
294294
if [[ "${GEMINI_DEBUG}" = true ]]; then
295295
echo "::warning::Gemini CLI debug logging is enabled. This will stream responses, which could reveal sensitive information if processed with untrusted inputs."
296296
echo "::: Start Gemini CLI STDOUT :::"
297-
if ! gemini --debug --yolo --prompt "${PROMPT}" --output-format json 2> >(tee "${TEMP_STDERR}" >&2) | tee "${TEMP_STDOUT}"; then
297+
if ! gemini --debug --yolo --output-format json "${PROMPT}" 2> >(tee "${TEMP_STDERR}" >&2) | tee "${TEMP_STDOUT}"; then
298298
FAILED=true
299299
fi
300300
# Wait for async stderr logging to complete. This is because process substitution in Bash is async so let tee finish writing to ${TEMP_STDERR}
301301
sleep 1
302302
echo "::: End Gemini CLI STDOUT :::"
303303
else
304-
if ! gemini --yolo --prompt "${PROMPT}" --output-format json 2> "${TEMP_STDERR}" 1> "${TEMP_STDOUT}"; then
304+
if ! gemini --yolo --output-format json "${PROMPT}" 2> "${TEMP_STDERR}" 1> "${TEMP_STDOUT}"; then
305305
FAILED=true
306306
fi
307307
fi

0 commit comments

Comments
 (0)