Gemini Configuration
getting-started / Gemini Configuration
Gemini Configuration
Configure Required Environment Variables
Gemini currently only supports usage via the CLI command-line tool and does not yet support the VS Code extension. The configuration method is similar to Claude Code.
macOS or Linux
Add the following content to ~/.zshrc (zsh) or ~/.bashrc (bash):
1 export GOOGLE_GEMINI_BASE_URL="https://www.codebyai.net/api/agent"2 export GEMINI_API_KEY="sk-proj-xxxx"
Run source ~/.zshrc after saving the file to make the configuration take effect immediately.
If you prefer to append them one by one, you can run (bash users change ~/.zshrc to ~/.bashrc):
1 echo 'export GOOGLE_GEMINI_BASE_URL="https://www.codebyai.net/api/agent"' >> ~/.zshrc2 echo 'export GEMINI_API_KEY="sk-proj-xxxx"' >> ~/.zshrc3 4 source ~/.zshrc
Windows
You can use any of the following methods to complete the same configuration:
Method 1 · GUI (Recommended, Permanent)
- Press
Win + R, typesysdm.cpland hit Enter. - Open Advanced → Environment Variables.
- Under User variables, click New, and add them one by one:
GOOGLE_GEMINI_BASE_URL→https://www.codebyai.net/api/agentGEMINI_API_KEY→sk-proj-xxxx
- Close all windows.
Method 2 · Command Prompt (Permanent)
1 setx GOOGLE_GEMINI_BASE_URL "https://www.codebyai.net/api/agent"2 setx GEMINI_API_KEY "sk-proj-xxxx"
Method 3 · PowerShell (Permanent)
1 [System.Environment]::SetEnvironmentVariable('GOOGLE_GEMINI_BASE_URL', 'https://www.codebyai.net/api/agent', 'User')2 [System.Environment]::SetEnvironmentVariable('GEMINI_API_KEY', 'sk-proj-xxxx', 'User')
Method 4 · Temporary Session (Valid only for current CMD window)
1 set GOOGLE_GEMINI_BASE_URL=https://www.codebyai.net/api/agent2 set GEMINI_API_KEY=sk-proj-xxxx
Start Gemini CLI
Run in any project directory:
1 cd your-project2 gemini
After successful startup, you will see an interface similar to this:
