gemini-cli icon indicating copy to clipboard operation
gemini-cli copied to clipboard

code not updated in project directory

Open michalpilch opened this issue 1 year ago • 4 comments

What happened?

My apologies for the persistent issues with the write_file tool. It seems there's a technical problem preventing me from updating the script on your system correctly.

project dir in /home/project

What did you expect to happen?

write_file tool not working - pasting part of a code to the terminal output only

Client information

$ gemini /about
│ About Gemini CLI                       │
│                                        │
│ CLI Version  0.1.18                    │
│ Git Commit   cd7e60e0                  │
│ Model        gemini-2.5-pro            │
│ Sandbox      no sandbox                │
│ OS           linux                     │
│ Auth Method  OAuth                     │
│                       

Login information

Google Account

Anything else we need to know?

No response

michalpilch avatar Aug 10 '25 09:08 michalpilch

Few things that might help troubleshoot this:

  1. Permissions issue:
  • Try running gemini as admin/sudo
  • Check if /home/project has write permissions
  • Maybe the write_file tool is getting blocked
  1. Be more explicit in requests:
  • Instead of "update the file" try "use write_file tool to save this code to /home/project/filename.js"
  • Sometimes being super specific about the tool helps
  1. Directory context:
  • Make sure you're running gemini from inside your project root
  • Try with a simple test file first to isolate the issue
  1. Sandbox settings:
  • If you're using sandbox mode, that might be blocking file writes
  • Try with --no-sandbox flag

This happens more on certain file types or when the path has spaces/special chars. Would be helpful to know what kind of files you're trying to update and if you get any specific error messages.

Usually works better when you're really explicit about the exact file path and tool to use.

shivas1432 avatar Aug 10 '25 11:08 shivas1432

GCLI runs under whatever permissions you grant it. Are you getting a stack trace or something? If so, please let me know and I'll reopen.

scidomino avatar Aug 14 '25 20:08 scidomino

Being more explicit in requests made job:

michalpilch avatar Aug 14 '25 20:08 michalpilch

Looks like your comment got cut off:

Image

scidomino avatar Aug 14 '25 21:08 scidomino