Authenticated Gemini Code Assist in Devcontainer

I’ve been trying to persist the authentication of Gemini Code Assist between container rebuilds (and in/outside the container), but I cannot seem to locate the files it needs. So now in after each rebuild, we need to follow the Oath flow to make sure it is active. As we work with multiple devcontainers that get regular updates, this make using it impractical.

Do note, the gcloud CLI authentication is persistent.

At the moment i’m mounting:

~/.gemini/
~/.config/gcloud/

Anyone has any idea what else I could include to this work?
OS: Macos 26.2
IDE: VSCode

1 Like

Hi @Koen Gemini Code Assist in VS Code stores its auth in the VS Code extension storage, not only in ~/.gemini or ~/.config/gcloud. In a devcontainer you also need to persist the VS Code server data folder, usually ~/.vscode-server (or ~/.vscode-server-insiders). Try mounting that directory as a volume.

Also make sure you are not rebuilding the container with a different user, because auth is user-scoped.

Alternatively, instead of OAuth login inside the container, consider using gcloud auth application-default login and ensure ADC credentials are available to the extension.