N·03Integration guides
Gemini CLI
Google's AI assistant for the terminal: ask it in plain words to read code, edit files or look things up. It's command-line only, and three settings point it at XylemNode to call Gemini.
The three things this tool needs
- Address
https://api.xylemnode.com- Key
sk-your-key- Model name
gemini-4-argon
Gemini CLI's address stops at .com, with no /v1 after it. Your key's group needs to include the Gemini models.
- 01
Open a terminal and install Gemini CLI
On Windows, search the Start menu for "PowerShell"; on a Mac, open Terminal. Paste one of the install commands below and press Enter. The npm route needs Node.js installed first.
terminal # npm (recommended, all platforms)
npm install -g @google/gemini-cli# macOS Homebrew
brew install gemini-cliYou should seeThe install finishes without red error text.
Why, and what to do if it goes wrong
To try it without installing, run npx @google/gemini-cli, which downloads it fresh each time.
- 02
Check that it installed
terminal gemini --versionYou should seeIt prints a version number.
- 03
Add the address, key and model
A file is the easiest way, written once and then forgotten: in Notepad, create a file named .env in the .gemini folder in your user directory, paste the three lines below, replace sk-your-key with your key, and save.
- Windows
%USERPROFILE%\.gemini\.env- macOS / Linux
~/.gemini/.env
.env GOOGLE_GEMINI_BASE_URL=https://api.xylemnode.com GEMINI_API_KEY=sk-your-key GEMINI_MODEL=gemini-4-argonYou should seeThe .gemini folder has a .env file (not .env.txt).
Why, and what to do if it goes wrong
In Windows Notepad, set "Save as type" to "All files", or it saves as .env.txt. If the .gemini folder doesn't exist, run gemini once and close it, and it creates the folder; or make it yourself. Gemini CLI reads only the first .env it finds, looking upward from the folder you're in. If your project already has its own .env, the one in your user directory isn't read; add the three lines to the project's .env too (a project .env only takes effect in folders you've trusted). You can also skip the file and set system environment variables instead: on Windows, setx GOOGLE_GEMINI_BASE_URL "https://api.xylemnode.com" (the other two likewise), then reopen the terminal; on macOS / Linux, export, added to the end of ~/.zshrc to keep it.
- 04
Start it and choose the right sign-in
Run gemini in the terminal. The first start asks two questions:
- Trust this folder? Choose to trust it.
- How to sign in? Choose Use Gemini API key, not a Google account.
- Then type "Hi, reply with OK only" and press Enter.
terminal gemini# Pick a model just this once / test without opening a chat
gemini -m gemini-4-argon -p "Reply with OK only"You should seeGemini replies.
Why, and what to do if it goes wrong
If you chose a Google account before, it remembers that. Type /auth inside gemini and switch to Use Gemini API key. The -p test command has to run in a folder you've already trusted.
Common questions
Gemini CLI still logs in with a Google account despite the environment variables — or won't switch back
It follows the sign-in method it saved: the choice you made on the first start is remembered, so setting GEMINI_API_KEY later doesn't necessarily switch it. If you want XylemNode but it still uses your Google account, type /auth inside gemini and choose Use Gemini API key; if it still doesn't see the key after that, the process probably never got it (writing it with setx and not reopening the terminal is the classic case). To go back to a Google account, also start with /auth; if that doesn't take, clear GEMINI_API_KEY from the environment and from .env, then clear the cached credentials. Worth knowing: CC Switch configures Gemini through those same environment variables, which pins the CLI to API-key mode, and uninstalling CC Switch does not undo it.