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.
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.
gemini to continue a conversation, approve tool calls, and complete project tasks.
gemini -p, piped input, and structured output to connect scripts and CI.
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.
All required tools link to open-source projects.
Google Gemini CLI
Google’s official open-source terminal agent, including CLI, Core, tools, Extensions, and complete documentation.
Node.js
The open-source JavaScript runtime required to install Gemini CLI with npm or npx.
Homebrew
An open-source package manager commonly used on macOS and Linux to install Gemini CLI.
Visual Studio Code
An open-source editor for reviewing diffs, terminals, code changes, and Gemini CLI IDE integration.
MCP Reference Servers
Official Model Context Protocol reference servers and community server indexes.
MCP SDK
Build custom MCP servers for Gemini CLI and expose internal APIs or OmniDino features as tools.
@google/gemini-cli, and the GitHub repository is google-gemini/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.
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.
npx @google/gemini-cli # Use latest explicitly npx @google/gemini-cli@latest
Homebrew Installation
Suitable for macOS and Linux users who already use 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.
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.
Gemini CLI officially supports three main authentication routes.
Google Account Login
Suitable for local personal use. Run gemini then choose Sign in with Google and complete OAuth in the browser.
Gemini API Key
Use a Gemini Developer API Key created in Google AI Studio. The environment variable is GEMINI_API_KEY。
Vertex AI
Suitable for Google Cloud enterprise use, requiring a project, region, permissions, and Vertex AI authentication.
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.
Create persistent project rules and context.
Gemini CLI reads GEMINI.md hierarchically so the model understands project context, conventions, safety boundaries, and validation methods.
Project Context
Describe project goals, technology stack, directory structure, and key modules.
Coding Standards
Define naming, formatting, component patterns, error handling, and test requirements.
Safety Boundaries
Specify files that must not be modified, sensitive directories, and prohibited commands.
Build Commands
List installation, startup, lint, test, and production build commands.
Git Rules
Require branches and diff review, and prohibit automatic pushes to production repositories.
Output Format
Require a plan first, list risks, explain changes, and provide validation results.
# 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.
/init to generate GEMINI.md from the current directory. Run /memory show to view the currently loaded context.
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.
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
# View MCP help gemini mcp --help # List configured servers gemini mcp list # View MCP in the interactive interface /mcp # Reload MCP /mcp reload
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. |
From installation to the first safe task.
Install Node.js and Gemini CLI
Use the official GitHub project and npm package, then verify the version.
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.
Start in a Test Git Repository
Do not start in a production project. Use a small, reversible repository first.
Generate and Review GEMINI.md
Run /init, then manually add coding standards, safety boundaries, and test commands.
Start with a Read-Only Task
First ask Gemini to explain the README, project structure, and risks without modifying files.
Review the Plan and Permissions
Use /plan and /permissions to confirm the tool-call scope.
Add a Trusted MCP or Extension
Install only extensions with a clear GitHub repository, license, and permission description.
Connect an OmniDino MCP When Needed
Expose OmniDino as a controlled tool and never put the OmniDino Key in a public project.
Troubleshoot installation, authentication, and OmniDino compatibility.
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]