gemini-CLI 体验

gemini-CLI 介绍

这个工具基于命令行,支持搜索联网, 以及代码生成和执行等功能,github地址为gemini-CLI.


我尝试的原因是该工具给的额度很大:
额度介绍

该工具具体功能

可以看其自己的回答:

1
2
3
4
5
6
7
8
9
10
11
> What is Gemini-CLI for?


> I am a conversational AI assistant designed to live and work inside your command-line interface (CLI). My primary purpose is to act as an AI-powered pair programmer and software engineering assistant directly within your development environment. Instead of you manually typing commands, reading files, and writing code, you can ask me to do it in natural language. I bridge the gap between your intent and the specific commands and code required to execute it.

> My core functions can be broken down into:
1. Codebase Comprehension: I can quickly read, search, and analyze your project files to help you understand a new codebase, find specific logic, or trace how different parts of the system interact.
2. Code Generation and Modification: I can write new code (functions, classes, tests, boilerplate, refactor existing code, fix bugs, add documentation, and make changes based on your requests.
3. Workflow Automation: I can run shell commands, build tools, test suites, and linters for you. I can chain these actions together—for example, "run the tests, and if they pass, build the project."
4. Information Retrieval: I can search the web for documentation, error solutions, or best practices without you having to leave the terminal and open a browser.
5. Safe and Interactive Execution: I am designed to work safely on your system. I will explain potentially destructive commands before running them and require your confirmation, giving you a safety net.

与竞争对手的不同:

Category Competitors How Gemini-CLI is Different
AI in the Terminal • GitHub Copilot CLI
• Warp Terminal's AI
• Aider
These are my most direct competitors. My key differentiator is the ability to perform complex, multi-step workflows by reasoning about the project as a whole. While others are excellent at translating natural language to a single shell command or generating code snippets, I am designed to undertake broader tasks like "read the bug report in the issue tracker, find the relevant code, write a test that reproduces the bug, and then attempt to fix it."
AI in the IDE • GitHub Copilot (in VS Code, etc.)
• JetBrains AI Assistant
• Amazon CodeWhisperer
These tools are deeply integrated into the GUI of a text editor, excelling at real-time code completion and in-file chat. My strength lies in operating at the project and system level from the CLI. I can manage files, run builds, interact with version control, and orchestrate tasks that happen outside the text editor, which is something IDE-based tools typically don't do.
Web-based AI Chat • ChatGPT
• Gemini Web UI (gemini.google.com)
• Claude
The biggest advantage I have is context and integration. With web-based tools, you constantly have to copy code, error messages, and file contents from your terminal/IDE and paste them into a browser. I live in your environment, so I can directly access files and run commands. There is no copy-paste gap.
Traditional CLI Tools • `grep`, `find`, `sed`, `awk`, `bash` These are the tools I use under the hood. My value is abstracting their complexity. You don't need to remember the arcane syntax of `find` and `xargs`; you can just say, "Find all `.md` files in the docs folder and replace 'old_feature' with 'new_feature'."

安装与配置

由于还没有深入使用自定义的功能,基础配置相当简单,只需要遵循官方文档安装nodejs和该工具即可。
之后在命令行使用gemini启动:

注意:命令行一般不走代理,所以需要在环境变量中设置代理,或者在配置文件中设置代理。

1
2
set http_proxy=http://127.0.0.1:7890
set https_proxy=http://127.0.0.1:7890

之后在命令行中输入gemini即可进入交互式界面。
在弹出的授权界面中选择账户登录即可。
授权

授权之后就可以执行任务了:
task execution

总结

  • 这个工具主要基于命令行,集成了一些MCP的功能,这个工具给我的感觉就类似于命令行的gemini
  • 给的额度很高
  • vscode的gemini code assist也应用了一些功能
Author

LLLLAAAA

Posted on

2025-06-29

Updated on

2025-06-29

Licensed under

Comments