Skip to content

docs(cli): clarify ! command output visibility in shell commands tutorial#21041

Merged
gsquared94 merged 5 commits into
google-gemini:mainfrom
MohammedADev:docs/21038-shell-command-context
Mar 6, 2026
Merged

docs(cli): clarify ! command output visibility in shell commands tutorial#21041
gsquared94 merged 5 commits into
google-gemini:mainfrom
MohammedADev:docs/21038-shell-command-context

Conversation

@MohammedADev

@MohammedADev MohammedADev commented Mar 4, 2026

Copy link
Copy Markdown
Contributor

Summary

Updates the shell commands tutorial to match current CLI behavior for ! commands.

What changed

  • Clarified that ! command output is recorded in the current session context.
  • Clarified that the model can reference this output in follow-up prompts.
  • Added note that very large outputs may be truncated.

Why

Issue #21038 reports a mismatch between docs and observed behavior.

The implementation currently adds shell command output to session history in:

  • packages/cli/src/ui/hooks/shellCommandProcessor.ts via addShellCommandToGeminiHistory(...).

Fixes #21038

@MohammedADev MohammedADev requested review from a team as code owners March 4, 2026 01:17
@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, 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 updates the shell commands tutorial in the documentation to accurately reflect the current behavior of the Gemini CLI. The changes address a reported discrepancy where the documentation did not fully describe how ! command outputs are handled, ensuring that users understand the visibility and persistence of these outputs within the session context for model interaction.

Highlights

  • Documentation Update: Clarified that ! command output in the Gemini CLI is recorded in the current session context.
  • Model Reference: Explained that the model can reference the ! command output in follow-up prompts.
  • Output Truncation: Added a note indicating that very large outputs from ! commands may be truncated.
Changelog
  • docs/cli/tutorials/shell-commands.md
    • Updated the description of ! command behavior to include session context recording.
    • Added information about the model's ability to reference ! command output.
    • Included a note regarding potential truncation of large ! command outputs.
Activity
  • No human activity has been recorded on this pull request yet.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the documentation for the ! shell command in docs/cli/tutorials/shell-commands.md. The change clarifies that the output of commands executed with the ! prefix is recorded in the session context and can be used by the model in follow-up interactions, and that large outputs may be truncated. This aligns the documentation with the application's current behavior. I have reviewed the changes and have no issues to report.

Note: Security Review has been skipped due to the limited scope of the PR.

@chrstnb

chrstnb commented Mar 6, 2026

Copy link
Copy Markdown
Contributor

Build failed: Build process failed with link errors:

03:10:59 [ERROR] ✗ Found 39 invalid links in 1 file.
03:10:59 [ERROR] [starlight-links-validator-integration] An unhandled error occurred while running the "astro:build:done" hook

@g-samroberts g-samroberts self-assigned this Mar 6, 2026
@g-samroberts

Copy link
Copy Markdown
Contributor

Thank you for your contribution, @MohammedADev !

@MohammedADev

Copy link
Copy Markdown
Contributor Author

Build failed: Build process failed with link errors:

03:10:59 [ERROR] ✗ Found 39 invalid links in 1 file.
03:10:59 [ERROR] [starlight-links-validator-integration] An unhandled error occurred while running the "astro:build:done" hook

Hey Christine! I verified locally and my docs change is clean on this branch.
The remaining blocker seems to be docs-pr-check (gemini-cli-extensions) failing immediately with INVALID_ARGUMENT in Google Cloud Build. But I don't think I can access that Cloud Build project logs. Could a maintainer please rerun/check that trigger for this PR?

Thank you for your contribution, @MohammedADev !

Of course!

@gsquared94 gsquared94 enabled auto-merge March 6, 2026 08:36
@gsquared94 gsquared94 added this pull request to the merge queue Mar 6, 2026
Merged via the queue into google-gemini:main with commit f17f053 Mar 6, 2026
26 of 27 checks passed
@MohammedADev MohammedADev deleted the docs/21038-shell-command-context branch March 6, 2026 09:01
struckoff pushed a commit to struckoff/gemini-cli that referenced this pull request Mar 6, 2026
…rial (google-gemini#21041)

Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>
kunal-10-cloud pushed a commit to kunal-10-cloud/gemini-cli that referenced this pull request Mar 12, 2026
…rial (google-gemini#21041)

Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>
liamhelmer pushed a commit to badal-io/gemini-cli that referenced this pull request Mar 12, 2026
…rial (google-gemini#21041)

Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>
yashodipmore pushed a commit to yashodipmore/geemi-cli that referenced this pull request Mar 21, 2026
…rial (google-gemini#21041)

Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>
SUNDRAM07 pushed a commit to SUNDRAM07/gemini-cli that referenced this pull request Mar 30, 2026
…rial (google-gemini#21041)

Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>
warrenzhu25 pushed a commit to warrenzhu25/gemini-cli that referenced this pull request Apr 9, 2026
…rial (google-gemini#21041)

Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>
cocosheng-g pushed a commit that referenced this pull request May 6, 2026
…rial (#21041)

Co-authored-by: Sam Roberts <158088236+g-samroberts@users.noreply.github.com>
@sripasg sripasg added the size/xs An extra small PR label Jun 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xs An extra small PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Docs claim that AI doesn't "see" output of ! commands, but it does.

6 participants