Gemini命令行助手 是 AI Skill Hub 本期精选AI工具之一。在 GitHub 上收获超过 103.8k 颗 Star,综合评分 8.2 分,整体质量较高。我们强烈推荐将其纳入你的 AI 工具库,帮助提升工作效率。
Gemini命令行助手 是一款基于 TypeScript 开发的开源工具,专注于 Gemini、CLI、MCP 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
Gemini命令行助手 是一款基于 TypeScript 开发的开源工具,专注于 Gemini、CLI、MCP 等核心功能。作为 GitHub 开源项目,它拥有活跃的社区支持和持续的版本迭代,代码完全透明可审计,支持本地部署以保护数据隐私。无论是个人使用还是集成到企业工作流,都能提供稳定可靠的解决方案。
# 方式一:npm 全局安装 npm install -g gemini-cli # 方式二:npx 直接运行(无需安装) npx gemini-cli --help # 方式三:项目依赖安装 npm install gemini-cli # 方式四:从源码运行 git clone https://github.com/google-gemini/gemini-cli cd gemini-cli npm install npm start
# 命令行使用
gemini-cli --help
# 基本用法
gemini-cli [options] <input>
# Node.js 代码中使用
const gemini_cli = require('gemini-cli');
const result = await gemini_cli.run(options);
console.log(result);
# gemini-cli 配置说明 # 查看配置选项 gemini-cli --config-example > config.yml # 常见配置项 # output_dir: ./output # log_level: info # workers: 4 # 环境变量(覆盖配置文件) export GEMINI_CLI_CONFIG="/path/to/config.yml"

Gemini CLI is an open-source AI agent that brings the power of Gemini directly into your terminal. It provides lightweight access to Gemini, giving you the most direct path from your prompt to our model.
Learn all about Gemini CLI in our documentation.
- Ground your queries with built-in Google Search for real-time information - Conversation checkpointing to save and resume complex sessions - Custom context files (GEMINI.md) to tailor behavior for your projects
- Commands Reference - All slash commands (/help, /chat, etc). - Custom Commands - Create your own reusable commands. - Context Files (GEMINI.md) - Provide persistent context to Gemini CLI. - Checkpointing - Save and resume conversations. - Token Caching - Optimize token usage.
See Gemini CLI installation, execution, and releases for recommended system specifications and a detailed installation guide.
```bash
npx @google/gemini-cli
#### Install globally with npm
bash npm install -g @google/gemini-cli
#### Install globally with Homebrew (macOS/Linux)
bash brew install gemini-cli
#### Install globally with MacPorts (macOS)
bash sudo port install gemini-cli
#### Install with Anaconda (for restricted environments)
bash
npm install -g @google/gemini-cli ```
- Quickstart Guide - Get up and running quickly. - Authentication Setup - Detailed auth configuration. - Configuration Guide - Settings and customization. - Keyboard Shortcuts - Productivity tips.
See the Uninstall Guide for removal instructions.
gemini
gemini --include-directories ../lib,../docs
gemini -m gemini-2.5-flash
Get a simple text response:
gemini -p "Explain the architecture of this codebase"
For more advanced scripting, including how to parse JSON and handle errors, use the --output-format json flag to get structured output:
gemini -p "Explain the architecture of this codebase" --output-format json
For real-time event streaming (useful for monitoring long-running operations), use --output-format stream-json to get newline-delimited JSON events:
gemini -p "Run tests and deploy" --output-format stream-json
cd new-project/
gemini
> Write me a Discord bot that answers questions using a FAQ.md file I will provide
git clone https://github.com/google-gemini/gemini-cli
cd gemini-cli
gemini
> Give me a summary of all of the changes that went in yesterday
conda create -y -n gemini_env -c conda-forge nodejs conda activate gemini_env
Choose the authentication method that best fits your needs:
✨ Best for: Individual developers as well as anyone who has a Gemini Code Assist License. (see quota limits and terms of service for details)
Benefits:
gemini
```bash
✨ Best for: Developers who need specific model control or paid tier access
Benefits:
```bash
✨ Best for: Enterprise teams and production workloads
Benefits:
```bash
export GEMINI_API_KEY="YOUR_API_KEY" gemini ```
- Automate operational tasks like querying pull requests or handling complex rebases - Use MCP servers to connect new capabilities, including media generation with Imagen, Veo or Lyria - Run non-interactively in scripts for workflow automation
Integrate Gemini CLI directly into your GitHub workflows with Gemini CLI GitHub Action:
- Pull Request Reviews: Automated code review with contextual feedback and suggestions - Issue Triage: Automated labeling and prioritization of GitHub issues based on content analysis - On-demand Assistance: Mention @gemini-cli in issues and pull requests for help with debugging, explanations, or task delegation - Custom Workflows: Build automated, scheduled and on-demand workflows tailored to your team's needs
- Built-in Tools Overview - File System Operations - Shell Commands - Web Fetch & Search - MCP Server Integration - Extend with custom tools. - Custom Extensions - Build and share your own commands.
- Troubleshooting Guide - Common issues and solutions. - FAQ - Frequently asked questions. - Use /bug command to report issues directly from the CLI.
Gemini CLI 是一个用于交互式聊天和问答的命令行工具,基于 Google Search 和 Gemini API 提供实时信息和高级功能。
Gemini CLI 的关键功能包括:高级查询能力、实时信息、会话检查点、自定义上下文文件(GEMINI.md)等。
安装 Gemini CLI 可以使用 npx、npm、Homebrew 或 MacPorts 等方式,具体步骤请参见官方文档。
使用 Gemini CLI 可以通过以下方式:启动 CLI、包含多个目录、使用特定模型、非交互式模式等。
配置 Gemini CLI 可以通过创建和激活环境、选择身份验证方法等方式,具体请参见官方文档。
获取 Gemini API 键可以通过访问 https://aistudio.google.com/apikey 进行申请。
Gemini CLI 可以用于自动化操作任务、连接新能力、运行非交互式脚本等,具体请参见官方文档。
Gemini CLI 的常见问题包括安装、使用、配置等,具体请参见官方文档。
aiskill88点评:高星开源项目,集成度强,MCP框架赋能丰富。TypeScript编写保证质量。活跃维护,生态友好,终端AI体验完善。
AI Skill Hub 为第三方内容聚合平台,本页面信息基于公开数据整理,不对工具功能和质量作任何法律背书。
建议在沙箱或测试环境中充分验证后,再部署至生产环境,并做好必要的安全评估。
✅ Apache 2.0 — 宽松开源协议,可商用,需保留版权声明和 NOTICE 文件,含专利授权条款。
经综合评估,Gemini命令行助手 在AI工具赛道中表现稳健,质量优秀。如果你已有明确的使用需求,可以直接上手体验;如果还在评估阶段,建议对比同类工具后再做决策。
| 原始名称 | gemini-cli |
| 原始描述 | 开源MCP工具:An open-source AI agent that brings the power of Gemini directly into your termi。⭐103.8k · TypeScript |
| Topics | GeminiCLIMCPAI代理TypeScript开源 |
| GitHub | https://github.com/google-gemini/gemini-cli |
| License | Apache-2.0 |
| 语言 | TypeScript |
收录时间:2026-05-13 · 更新时间:2026-05-16 · License:Apache-2.0 · AI Skill Hub 不对第三方内容的准确性作法律背书。