feat(cli): undeprecate the --prompt flag (#13981)

Co-authored-by: Allen Hutchison <adh@google.com>
This commit is contained in:
Alex Austin Chettiar
2026-01-15 04:39:27 +05:30
committed by GitHub
parent fb7640886b
commit a2dab146b9
4 changed files with 1 additions and 78 deletions

View File

@@ -51,7 +51,6 @@ interface RunNonInteractiveParams {
settings: LoadedSettings;
input: string;
prompt_id: string;
hasDeprecatedPromptArg?: boolean;
resumedSessionData?: ResumedSessionData;
}
@@ -60,7 +59,6 @@ export async function runNonInteractive({
settings,
input,
prompt_id,
hasDeprecatedPromptArg,
resumedSessionData,
}: RunNonInteractiveParams): Promise<void> {
return promptIdContext.run(prompt_id, async () => {
@@ -264,21 +262,6 @@ export async function runNonInteractive({
let currentMessages: Content[] = [{ role: 'user', parts: query }];
let turnCount = 0;
const deprecateText =
'The --prompt (-p) flag has been deprecated and will be removed in a future version. Please use a positional argument for your prompt. See gemini --help for more information.\n';
if (hasDeprecatedPromptArg) {
if (streamFormatter) {
streamFormatter.emitEvent({
type: JsonStreamEventType.MESSAGE,
timestamp: new Date().toISOString(),
role: 'assistant',
content: deprecateText,
delta: true,
});
} else {
process.stderr.write(deprecateText);
}
}
while (true) {
turnCount++;
if (