gemini-cli - 💡(How to fix) Fix Dry Run Mode for Commands [1 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
google-gemini/gemini-cli#26028Fetched 2026-04-28 06:50:20
View on GitHub
Comments
0
Participants
1
Timeline
1
Reactions
0
Participants
Timeline (top)
labeled ×1

Introduce a "dry run" mode to Gemini CLI that allows users to preview the effects of commands without making any actual changes. This would help users understand what actions will be taken, especially for file operations or automation scripts.

Root Cause

Introduce a "dry run" mode to Gemini CLI that allows users to preview the effects of commands without making any actual changes. This would help users understand what actions will be taken, especially for file operations or automation scripts.

RAW_BUFFERClick to expand / collapse

Issue: Dry Run Mode for Commands

Summary

Introduce a "dry run" mode to Gemini CLI that allows users to preview the effects of commands without making any actual changes. This would help users understand what actions will be taken, especially for file operations or automation scripts.

Motivation

  • Prevent accidental changes or data loss.
  • Increase user confidence when running complex or unfamiliar commands.
  • Useful for scripting and automation scenarios.

Proposed Solution

  • Add a --dry-run flag to relevant commands (e.g., file operations, automation tasks).
  • When enabled, the CLI should output a detailed summary of actions it would perform, without executing them.
  • Clearly indicate in the output that this is a simulation.

Additional Context

  • Many CLI tools (e.g., rsync, npm, git) offer dry run or preview modes.
  • Could be extended to support custom extensions and MCP integrations.

Let me know if this feature would be helpful or if you have suggestions for specific commands to support!

extent analysis

TL;DR

Implementing a --dry-run flag for relevant Gemini CLI commands can provide a safe preview of command effects without making actual changes.

Guidance

  • Identify commands that would benefit most from a dry run mode, such as file operations and automation tasks, to prioritize implementation.
  • Design the output summary to clearly indicate that it's a simulation, including details of the actions that would be performed.
  • Consider existing dry run or preview modes in other CLI tools (e.g., rsync, npm, git) for inspiration on implementation and user experience.
  • Plan for potential extension to support custom extensions and MCP integrations, ensuring the dry run feature remains flexible and useful.

Example

# Example of how the --dry-run flag could be used
gemini cli-command --dry-run
# Output:
# "This is a dry run. The following actions would be performed:
# - Action 1
# - Action 2
# No changes will be made."

Notes

The implementation details of the --dry-run flag and its output will depend on the specific requirements and design of the Gemini CLI. It's essential to balance providing useful information with avoiding unnecessary complexity.

Recommendation

Apply a workaround by manually testing commands in a safe, non-production environment until the --dry-run feature is implemented, to mitigate the risk of accidental changes or data loss.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING