fix(docs): fix headless mode docs#21287
Conversation
…ractive mode and default positional arguments to interactive.
…is piped or redirected
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request addresses inaccuracies in the documentation for the Gemini CLI's headless mode. It clarifies that positional arguments run interactively by default in TTY environments, and the Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request aims to correct the documentation for headless mode. All review comments provided are valid and align with the rule to maintain consistency and accuracy in documentation. Specifically, a duplicate line in the CLI reference needs removal, and several examples in the automation tutorial incorrectly include the -p flag where headless mode is automatically enabled by piping or redirection. The suggestions provided will help clarify these inaccuracies.
Note: Security Review has been skipped due to the limited scope of the PR.
Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
g-samroberts
left a comment
There was a problem hiding this comment.
Hi @ame2en, please make the requested changes. Ignore the bot comments, I've resolved them, because I think when both positional or a flag works (like when piping) it's better use the flag in the example to remain unambiguous.
|
@g-samroberts solved the review comments, let me know if any other changes are required |
Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com> Co-authored-by: gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>
Summary
This PR corrects inaccuracies in the documentation regarding headless mode. It ensures that the examples and command-line references correctly reflect that positional arguments run interactively by default in a TTY environment, and that the
-por--promptflag is explicitly required for non-interactive (headless) execution in those cases.Details
The fix involves the following changes:
-pflag in TTY examples, while maintaining that piped or redirected commands automatically trigger headless mode.gemini "query"andgemini -p "query". Removed the deprecation notice from the-p/--promptoption description.-p/--promptflag.Related Issues
Closes #21111
How to Validate locally
npm run start -- "tell me a joke"npm run start -- -p "tell me a joke"-p:echo "tell me a joke" | npm run start