iTranslated by AI
Preventing Gemini CLI from Executing Linux Commands on Windows
Background
When operating Gemini CLI, I often encounter cases where it attempts to use Linux commands during command execution, leading to failures.
(Example: trying to use the rm command when deleting a file)
It is a waste of time to have it correct Linux commands to Windows commands every single time, so I would like Gemini CLI to remember in advance that the development environment is Windows.
Additionally, you might want it to learn common coding rules or thought processes regardless of the project.
Solution
If you place a GEMINI.md file in the Gemini configuration folder, it will be automatically loaded across all projects.
The configuration folder is located at %USERPROFILE%\.gemini (C:\Users\Username\.gemini).
Create a new GEMINI.md here and specify that commands should be written in Command Prompt syntax.
# GEMINI.md (Global Settings)
## Development Environment
- **OS**: Windows 11
### Notes on Command Execution
Gemini CLI uses **`cmd.exe` (Command Prompt) by default when executing commands** on Windows.
Therefore, please keep the following points in mind:
- File operation commands must be written in **cmd-compatible syntax**, such as `del`, `mkdir`, and `rmdir`.
- PowerShell-specific syntax (e.g., `$variable`, `Remove-Item`, etc.) will not work as-is.
Discussion