What happened?
When using GEMINI_CLI_HOME to run multiple accounts, settings.json (including customAliases) is silently ignored if placed at $GEMINI_CLI_HOME/settings.json.
The correct path is $GEMINI_CLI_HOME/.gemini/settings.json — because homedir() in paths.js returns GEMINI_CLI_HOME and then getGlobalGeminiDir() appends .gemini/.
This is not documented anywhere. The enterprise docs mention GEMINI_CLI_HOME for isolation but don't explain the .gemini/ subdirectory requirement for settings.
Steps to reproduce
- Set up a second account:
export GEMINI_CLI_HOME=~/.gemini2
- Copy settings:
cp ~/.gemini/settings.json ~/.gemini2/settings.json
- Run with a customAlias model (e.g. a
-long alias with maxOutputTokens)
- Result:
ModelNotFoundError — customAliases not loaded
Expected behavior
Either:
- Document that settings.json must be at
$GEMINI_CLI_HOME/.gemini/settings.json
- Or also look for settings.json at
$GEMINI_CLI_HOME/settings.json (more intuitive)
Workaround
mkdir -p ~/.gemini2/.gemini
cp ~/.gemini/settings.json ~/.gemini2/.gemini/settings.json
Client information
- CLI v0.34.0
- macOS ARM64
- Auth: OAuth (Google One AI Premium)
What happened?
When using
GEMINI_CLI_HOMEto run multiple accounts,settings.json(includingcustomAliases) is silently ignored if placed at$GEMINI_CLI_HOME/settings.json.The correct path is
$GEMINI_CLI_HOME/.gemini/settings.json— becausehomedir()inpaths.jsreturnsGEMINI_CLI_HOMEand thengetGlobalGeminiDir()appends.gemini/.This is not documented anywhere. The enterprise docs mention
GEMINI_CLI_HOMEfor isolation but don't explain the.gemini/subdirectory requirement for settings.Steps to reproduce
export GEMINI_CLI_HOME=~/.gemini2cp ~/.gemini/settings.json ~/.gemini2/settings.json-longalias with maxOutputTokens)ModelNotFoundError— customAliases not loadedExpected behavior
Either:
$GEMINI_CLI_HOME/.gemini/settings.json$GEMINI_CLI_HOME/settings.json(more intuitive)Workaround
Client information