Command rejected because it could not be parsed safely
What happened?
Recently, the tool started having trouble executing commands in PowerShell. I have already checked the PowerShell execution policies and even set them to 'Unrestricted', but it didn't solve the issue. I have tried several solutions, but I can't identify exactly what in my environment is causing this behavior. Can anyone help?
What did you expect to happen?
The tool needs to be able to execute shell commands to create directories, files, etc.
Client information
- CLI Version: 0.15.4
- Git Commit: 60407daf5
- Session ID: eb418989-2fdf-44b6-a149-2bf95eaf82be
- Operating System: win32 v22.19.0
- Sandbox Environment: no sandbox
- Model Version: auto
- Memory Usage: 203.8 MB
Login information
google account with GOOGLE_CLOUD_PROJECT
Anything else we need to know?
No response
i am also facing same problem "rejecting shell commands cause could not be parsed safely "
I resolved this on Windows. It turns out the "could not be parsed safely" error was misleading in my case.
The root cause was that powershell was missing from my system Environment Variables (PATH). The CLI tries to invoke PowerShell in the background, and it failed because the command wasn't found.
I added the standard PowerShell path to my system Path variable, and the CLI works perfectly now.
@M-DaniyalHS1 @Ikeoh If you still have this problem, I would strongly suggest using gemini cli on wsl. That helped me
I encountered the same problem on MacOS, what should I do?