gemini-cli

n8n Community Node for Gemini CLI as LangChain Chat Model

Package Information

Downloads: 4 weekly / 27 monthly
Latest Version: 1.0.0
Author: Christian Schindler

Documentation

n8n-nodes-gemini-cli

This is an n8n community node that lets you use Gemini CLI (@google/gemini-cli) as a LangChain Chat Model.

Installation
Nodes
Authentication
Usage
Compatibility
Resources

Installation

Follow the installation guide in the n8n community nodes documentation.

Gemini CLI is bundled via @google/gemini-cli. If you prefer, set Gemini CLI Source to Custom Path and point to the gemini binary or a dist/index.js file.

Nodes

  • Gemini Auth (CLI): Google OAuth login flow (no API keys).
  • Gemini Chat Model (CLI): LangChain Chat Model wrapper around Gemini CLI.

Authentication

This plugin is built for the OAuth login flow (no API keys).

  1. Add the Gemini Auth (CLI) node.
  2. Run Login Start to get a login URL and session ID.
  3. Run Login Complete (use the session ID) to start the localhost listener.
  4. Open the URL, complete the Google login, and allow the browser redirect to localhost. If localhost is not reachable, paste the full redirect URL or the code as a manual fallback.
  5. Use the Gemini Chat Model (CLI) node in your workflows.

If you need a custom location for Gemini CLI settings, set Gemini Home Directory in the credentials. OAuth tokens will be stored in <home>/.gemini/oauth_creds.json.

Docker hint: set Login Listener Host to 0.0.0.0, choose a fixed Login Port, and publish that port (e.g. -p 57418:57418). The redirect URL remains http://localhost:PORT/oauth2callback.

Usage

  • Use Gemini Chat Model (CLI) inside AI chains and agents.
  • Optional features: custom instructions, stateless vs stateful conversations, and streaming.
  • Image inputs: image_url message parts (e.g. passthrough binary images) are written to <workingDirectory>/.gemini-attachments and referenced automatically.
  • Binary attachments: pass files as binary input and set Binary Property Names (e.g. data).

Compatibility

Compatible with n8n@1.60.0 or later.

Resources

Discussion