OmniDino
Home Models Pricing Guides About Contact Login Get API Key
EN 中文
Gemini CLI

Use Gemini in the terminal to understand code, call tools, and complete tasks automatically.

Gemini CLI is Google’s official open-source terminal agent. It supports project context, file editing, Shell commands, web tools, GEMINI.md, MCP, Extensions, Hooks, and non-interactive automation.

OSS Official Google Open Source Source code, releases, issues, and development documentation are public on GitHub.
CLI Terminal Agent Read files, edit code, run commands, and handle complex workflows.
MCP Tool Extensions Connect external systems and data through MCP and Extensions.
GEM Gemini Models The official upstream focuses on Google Gemini and Vertex AI services.
Overview

What is Gemini CLI?

It brings Gemini models and engineering tools into the terminal to understand code, make plans, modify files, and run commands in the current directory.

Move from answering questions to completing tasks inside the workspace.

Gemini CLI is more than a chat window. It can read project files, run Shell commands, search the web, call MCP tools, and follow project rules through GEMINI.md. Test any agent that edits files or runs commands in a disposable Git repository first.

Interactive Development Run gemini to continue a conversation, approve tool calls, and complete project tasks.
Non-Interactive Automation Use gemini -p, piped input, and structured output to connect scripts and CI.
Extensible Architecture Extend capabilities with MCP, Extensions, Skills, Hooks, Subagents, and custom commands.

The official Gemini CLI cannot currently use OmniDino’s OpenAI-compatible endpoint directly.

Gemini CLI officially supports Google accounts, Gemini Developer API Keys, and Vertex AI. Arbitrary OpenAI-compatible Base URLs, multi-provider routing, and custom providers are not stable official features. Do not put https://api.omnidino.com/v1 into a nonexistent Gemini CLI Base URL setting, and do not claim that Gemini CLI can directly call GPT, Claude, DeepSeek, or Qwen. For direct OmniDino multi-model access, use Codex, Claude Code, Cherry Studio, Dify, or another client that explicitly supports custom gateways.

GitHub Download Center

All required tools link to open-source projects.

GCLI

Google Gemini CLI

Google’s official open-source terminal agent, including CLI, Core, tools, Extensions, and complete documentation.

Official Google Apache-2.0 Windows macOS Linux
NODE

Node.js

The open-source JavaScript runtime required to install Gemini CLI with npm or npx.

Node.js 20+ npm npx Cross-Platform
BREW

Homebrew

An open-source package manager commonly used on macOS and Linux to install Gemini CLI.

macOS Linux Package Manager
VS

Visual Studio Code

An open-source editor for reviewing diffs, terminals, code changes, and Gemini CLI IDE integration.

Editor Git Terminal IDE Integration
MCP

MCP Reference Servers

Official Model Context Protocol reference servers and community server indexes.

MCP Tools Resources Open Source
SDK

MCP SDK

Build custom MCP servers for Gemini CLI and expose internal APIs or OmniDino features as tools.

TypeScript Python Server Client
Do not download modified Gemini CLI builds from unknown npm mirrors, file-sharing sites, or third-party installers. The official npm package is @google/gemini-cli, and the GitHub repository is google-gemini/gemini-cli
Install Gemini CLI

The stable release is recommended.

Install globally, run temporarily with npx, use Homebrew, or download a binary from GitHub Releases.

Global npm Installation

Suitable for Windows, macOS, and Linux, and the most common installation method.

Install Node.js 20 or later first.
The package name must be @google/gemini-cli.
Run gemini –version after installation.
Reinstall latest when upgrading.
npm
npm install -g @google/gemini-cli gemini --version # Upgrade later npm install -g @google/gemini-cli@latest

Temporary npx Run

No global installation is required. The package is fetched for each run.

Suitable for temporary use and controlled environments.
Node.js and npm are still required.
Dependencies are downloaded on the first run.
Global installation is better for long-term daily use.
npx
npx @google/gemini-cli # Use latest explicitly npx @google/gemini-cli@latest

Homebrew Installation

Suitable for macOS and Linux users who already use Homebrew.

Confirm that brew works correctly.
Follow the current command shown in the official documentation.
Check the Gemini CLI version after installation.
Update with brew upgrade.
Homebrew
brew install gemini-cli gemini --version # Upgrade later brew upgrade gemini-cli

GitHub Release

Choose the file matching your operating system and architecture from the official Releases page.

The repository must be google-gemini/gemini-cli.
Prefer a stable release.
Check Windows, macOS, Linux, and CPU architecture compatibility.
Preview and nightly builds are better suited to testers.
Release Channels
stable Recommended for daily use preview Try upcoming features nightly Built from the latest commits with the lowest stability Choose stable for first-time use.
Authentication Methods

Gemini CLI officially supports three main authentication routes.

GOOG

Google Account Login

Suitable for local personal use. Run gemini then choose Sign in with Google and complete OAuth in the browser.

KEY

Gemini API Key

Use a Gemini Developer API Key created in Google AI Studio. The environment variable is GEMINI_API_KEY

GCP

Vertex AI

Suitable for Google Cloud enterprise use, requiring a project, region, permissions, and Vertex AI authentication.

Google OAuth
gemini # In the sign-in menu, choose: # Sign in with Google
GEMINI_API_KEY This must be a Google Gemini Developer API Key, not an OmniDino Key. Their authentication, domains, and protocols are different.
GEMINI.md

Create persistent project rules and context.

Gemini CLI reads GEMINI.md hierarchically so the model understands project context, conventions, safety boundaries, and validation methods.

01

Project Context

Describe project goals, technology stack, directory structure, and key modules.

02

Coding Standards

Define naming, formatting, component patterns, error handling, and test requirements.

03

Safety Boundaries

Specify files that must not be modified, sensitive directories, and prohibited commands.

04

Build Commands

List installation, startup, lint, test, and production build commands.

05

Git Rules

Require branches and diff review, and prohibit automatic pushes to production repositories.

06

Output Format

Require a plan first, list risks, explain changes, and provide validation results.

GEMINI.md Template
# Project Context

## Project
- This is the OmniDino website and documentation project.
- Preserve the existing visual style.
- Prefer small, reviewable changes.

## Development Rules
- Use scoped CSS classes for every page.
- Keep mobile responsiveness.
- Use vanilla JavaScript unless the project already uses another framework.
- Do not remove working content without approval.

## Safety
- Never expose API keys or passwords.
- Do not edit production credentials.
- Do not run destructive database or deployment commands without approval.

## Verification
- Review the final Git diff.
- Test links, buttons, tabs and copy actions.
- Check desktop and mobile layouts.
- List every changed file and the reason.
In Gemini CLI, run /init to generate GEMINI.md from the current directory. Run /memory show to view the currently loaded context.
MCP and OmniDino

OmniDino can be used as a tool backend, not as the model provider.

Build an MCP server so Gemini can call OmniDino for model tests, image generation, balance checks, or internal business APIs.

Correct Architecture

Gemini CLI remains powered by Google Gemini models. When Gemini decides to call a tool, your MCP server uses a server-side OmniDino Key to request OmniDino.

Agent Model Google Gemini
Tool Protocol MCP
Tool Backend OmniDino API
API Key Store It on the MCP Server
This produces both Google Gemini usage and OmniDino tool-call usage, which should be reviewed separately.
OmniDino MCP Flow
Gemini CLI ↓ Gemini decides to call a tool Your MCP Server ↓ Uses a securely stored OmniDino Key https://api.omnidino.com/v1 ↓ OmniDino model / image / business endpoint ↓ MCP Server returns structured results to Gemini CLI
MCP Management Commands
# View MCP help gemini mcp --help # List configured servers gemini mcp list # View MCP in the interactive interface /mcp # Reload MCP /mcp reload
Common Commands

Quick reference for interactive mode and automation.

Command Purpose Recommendation
gemini Start interactive Gemini CLI. Enter the correct project directory first.
gemini -p "TASK" Run one task non-interactively. Suitable for scripts, CI, and batch operations.
gemini "TASK" Start an interactive session with an initial task. Jump directly into a specific project goal.
cat file | gemini Process file content through a pipe. Use Get-Content on Windows.
/about View version and client information. Include the output when submitting an issue.
/auth Manage authentication methods. Switch between Google sign-in, API Key, and Vertex.
/model View or set the Gemini model. Only models available to the current authentication method are shown.
/settings Open the settings interface. Manage UI, permissions, and advanced options.
/init Generate project GEMINI.md. Review and simplify it manually after generation.
/memory show View the currently loaded GEMINI.md. Troubleshoot project rules that are not taking effect.
/mcp Manage MCP servers. View tools, authentication, and connection status.
/tools View available tools. Confirm file, Shell, and MCP tools.
/permissions Manage directory trust and permissions. Use stricter policies for new projects.
/plan Enter read-only planning mode. Plan before modifying a large project.
/quit Exit Gemini CLI. Use –delete to remove the current session record.
Recommended Workflow

From installation to the first safe task.

01

Install Node.js and Gemini CLI

Use the official GitHub project and npm package, then verify the version.

02

Choose an Official Authentication Method

Local users should prefer Google sign-in, API development should use a Gemini Key, and enterprises should use Vertex AI.

03

Start in a Test Git Repository

Do not start in a production project. Use a small, reversible repository first.

04

Generate and Review GEMINI.md

Run /init, then manually add coding standards, safety boundaries, and test commands.

05

Start with a Read-Only Task

First ask Gemini to explain the README, project structure, and risks without modifying files.

06

Review the Plan and Permissions

Use /plan and /permissions to confirm the tool-call scope.

07

Add a Trusted MCP or Extension

Install only extensions with a clear GitHub repository, license, and permission description.

08

Connect an OmniDino MCP When Needed

Expose OmniDino as a controlled tool and never put the OmniDino Key in a public project.

FAQ

Troubleshoot installation, authentication, and OmniDino compatibility.

The official Gemini CLI does not support arbitrary OpenAI-compatible gateways as model providers. GEMINI_API_KEY must contain a Google Gemini Developer API Key, not an OmniDino Key.
The official upstream focuses on Google Gemini and Vertex AI. Multi-provider OpenAI-compatible backends are not an official feature. Use a client that explicitly supports custom Base URLs for OmniDino multi-model access.
Reopen the terminal, confirm the global npm directory is in PATH, and run npm list -g @google/gemini-cli. You can also test with npx @google/gemini-cli.
Local OAuth requires communication between the browser and terminal environment. For remote SSH or headless servers, use a Gemini API Key or Vertex AI instead of browser sign-in.
Check that the Key comes from Google AI Studio, required services are enabled, the model is available to that account and region, and the environment variable contains no extra spaces or quotes.
Model visibility depends on authentication, account plan, region, quota, and rollout. Entering an arbitrary name does not grant model access.
Check the file name and capitalization, then use /memory show to inspect loaded content. After changes, run /memory refresh or restart the session.
Use gemini mcp list and /mcp to inspect status. Check commands, dependencies, environment variables, HTTP URLs, OAuth, and logs. Running the MCP startup command directly can help isolate errors.
Ordinary Gemini CLI model requests do not pass through OmniDino, so no record is expected. Records appear only when a custom MCP tool explicitly calls the OmniDino API.

Still having trouble with Gemini CLI or MCP?

When contacting support, provide your operating system, Gemini CLI version, Node.js version, installation method, authentication method, model name, error message, and logs. Hide Google Keys, OmniDino Keys, and OAuth tokens.

[email protected]
Continue Reading

Continue to the next OmniDino guide.