google-gemini / google-gemini/gemini-cli

~/.gemini/.env VS untrusted folder

Open
#27,114 3 comments 2 reactions 0 assignees View on GitHub
area/security kind/bug priority/p3 status/bot-triaged
Dominant language
TypeScript
Stars
107k
Forks
14.6k
Avg merge
2d 3h
Merged PRs (30d)
45

Description

### What happened?

I'm using a Workspace account which requires me setting the GOOGLE_CLOUD_PROJECT env var.
Since this var doesn't appear to be gemini-cli specific, it is insane to set this var globally, so I've put it into ~/.gemini/.env

When I start the cli in a trusted folder it works as expected.
But when I start in an untrusted folder the login credentials are considered invalid and I end up in an endless login loop.

### What did you expect to happen?

~/.gemini/.env must be loaded even while in untrusted folder

### Client information

Client Information

Run `gemini` to enter the interactive CLI, then run the `/about` command.

```console
> /about
version 0.42.0
the rest is irrelevant
```

### Login information

_No response_

### Anything else we need to know?

_No response_

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.