AIインテリジェント(エージェント)は、クラウドから開発者のローカルエンドポイントに移行しつつある。コマンドライン(CLI)インテリジェンスは、グラフィカル・ユーザー・インターフェース(GUI)ベースのインテリジェンスよりも開発ワークフローに深く統合することができ、スクリプティングによって複雑なタスクを自動化し、ローカルのファイルやコードライブラリを直接操作することができます。
類似 Claude Code
歌で応える Gemini-CLI
このようなツールは、強力なプログラミング支援として非常に人気があるが、地域によっては開発者がこれらのサービスにアクセスするのに障壁がある。この問題に対処するため、コミュニティ開発者はGoogleのオープンソース Gemini-CLI
プロジェクト DeepSeek
モデリングとシリコンベースのフロー SiliconCloud
という新しいAPIの開発に成功した。 Gen-CLI
代替ツール。オリジナルと比較すると若干の性能差はあるものの、多くの場面で効果的な代替品となっている。
迅速なインストールと設定
取り付け Gen-CLI
手続きは非常に簡単で、いくつかの簡単なステップを踏むだけだ。
- オペレーティング・システムがインストールされていることを確認する
Node.js
18歳以上 - APIキー環境変数を設定する。環境変数を設定するには
SiliconCloud
公式プラットフォームに登録し、以下のものを手に入れよう。YOUR_API_KEY
.export SILICONFLOW_API_KEY="YOUR_API_KEY"
- うごきだす
Gen-CLI
.これは次のようにして行うことができる。
npx
リモートリポジトリを直接実行する:npx https://github.com/gen-cli/gen-cli
あるいは
npm
将来の使用のためのグローバルなインストール:npm install -g @gen-cli/gen-cli
基礎適性検査:自分の適性を見つける
効果的なAIインテリジェンスは、自身のコードベースを理解する能力を持つべきである。関連記事に触発されて、基本的だが重要なテストは Gen-CLI
プロンプトの動作を定義しているソースコードを探してください。
> find the prompts in this source code
✦ To find prompts in the source code, I'll search for files that might contain prompts, such as configuration files, CLI command definitions, or documentation. I'll
start by looking for common patterns like prompt, message, or input in the codebase.
Let me begin by searching for relevant files.
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✔ SearchText 'prompt|message|input' within ./ │
│ │
│ Found 2280 matche(s) │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
✦ The search results reveal several files and contexts where prompts are used in the Gemini CLI source code. Here's a summary of the findings:
Key Files and Contexts:
1. `packages/core/src/core/prompts.ts`:
- Contains the core system prompt logic, including the getCoreSystemPrompt function, which constructs the base prompt for the Gemini CLI.
- Includes instructions for user confirmations, sandbox-specific instructions, and Git repository handling.
2. `packages/cli/src/nonInteractiveCli.ts`:
- Handles non-interactive CLI mode, where prompts are passed directly via the --prompt flag.
3. `packages/cli/src/gemini.tsx`:
- Manages user input and logging of prompts, including telemetry for prompt logging.
4. `packages/core/src/core/client.ts`:
- Uses the getCoreSystemPrompt function to generate prompts for the Gemini API.
5. `packages/core/src/tools/web-fetch.ts`:
- Defines the web_fetch tool, which processes prompts containing URLs and instructions.
6. `packages/core/src/tools/memoryTool.ts`:
- Handles prompts for saving user facts to memory.
7. `packages/core/src/tools/edit.ts`:
- Manages prompts for file editing operations.
8. `docs/cli/commands.md`:
- Documents how prompts are used in the CLI, including the @ symbol for file inclusion in prompts.
Example Prompts:
- Core System Prompt (from prompts.ts):
1 You are an interactive CLI agent...
2 - Respect User Confirmations: Most tool calls will first require confirmation from the user...
- Non-Interactive Mode (from nonInteractiveCli.ts):
1 gemini --prompt "your prompt here"
- Web Fetch Tool (from web-fetch.ts):
1 Processes content from URL(s) embedded in a prompt. Include up to 20 URLs and instructions...
Next Steps:
If you need to inspect or modify specific prompts, I can:
1. Read the content of packages/core/src/core/prompts.ts to see the full system prompt.
2. Check the implementation of the web_fetch tool for URL handling in prompts.
3. Explore how prompts are logged or processed in the CLI.
Let me know which aspect you'd like to dive deeper into!
興味深い。Gen-CLI
パフォーマンスはオリジナルより良いようだ。オリジナル版 Gemini-CLI
このシナリオではキーワードのみを検索する prompt
でも Gen-CLI
ある DeepSeek
モデル・ドリブンで、自律的に検索範囲を拡大する。 prompt|message|input
そのため、より包括的な関連文書や文脈を見つけることができる。
上級習熟度試験:大規模コード・リポジトリの分析
小規模なコードベースを扱うのは比較的簡単ですが、次のようなコードベースを分析するのは大変です。 LLVM
このような大規模で複雑なプロジェクトでこそ、AIインテリジェンスのコードを理解する能力が試されるのだ。
% gen --prompt "what does this project do" --yolo
The **LLVM Project** is a collection of modular and reusable compiler and toolchain technologies. It is widely used for building compilers, optimizers, debuggers, and other programming tools. Here's a breakdown of its key components and functionalities:
### Core Components:
1. **LLVM Core**:
- Provides the infrastructure for building compilers, including:
- **Intermediate Representation (IR)**: A low-level, typed, and platform-independent representation of code.
- **Optimization Passes**: A suite of optimizations that can be applied to IR.
- **Code Generation**: Backends for generating machine code for various architectures (e.g., x86, ARM, etc.).
2. **Clang**:
- A C/C++/Objective-C compiler that uses LLVM as its backend. It is known for:
- Fast compilation.
- Better error messages and diagnostics.
- Support for modern C++ standards.
3. **LLDB**:
- A debugger for C, C++, and Objective-C, designed to integrate with LLVM and Clang.
4. **libc++** and **libc++abi**:
- Implementations of the C++ Standard Library and ABI, respectively, designed for performance and correctness.
5. **Compiler-RT**:
- Provides runtime libraries for compiler-builtins (e.g., `__builtin` functions), sanitizers (e.g., AddressSanitizer, MemorySanitizer), and profiling tools.
6. **LLD**:
- A high-performance linker designed to be faster than traditional linkers like GNU `ld`.
7. **MLIR**:
- A framework for building domain-specific compilers and optimizing transformations, particularly useful for machine learning and other high-level abstractions.
8. **Flang**:
- A Fortran compiler frontend for LLVM.
9. **Polly**:
- A high-level loop and data-locality optimizer for LLVM.
### Key Features:
- **Modularity**: LLVM is designed as a set of reusable libraries, making it easy to build custom tools or extend existing ones.
- **Performance**: LLVM's optimizations and code generation are highly efficient, making it a popular choice for performance-critical applications.
- **Cross-Platform**: Supports a wide range of operating systems (Linux, macOS, Windows, etc.) and architectures (x86, ARM, RISC-V, etc.).
- **Open Source**: The project is open-source and has a large community of contributors.
### Use Cases:
- **Building Compilers**: Many languages (e.g., Rust, Swift) use LLVM as their backend.
- **Static Analysis**: Tools like Clang-Tidy use LLVM for code analysis.
- **JIT Compilation**: LLVM's Just-In-Time (JIT) compilation is used in projects like Julia and LuaJIT.
- **Debugging and Profiling**: Tools like LLDB and sanitizers help developers find bugs and performance issues.
### Directory Structure (From Your Context):
- The project is organized into subdirectories for each major component (e.g., `clang/`, `lld/`, `mlir/`).
- Configuration files (e.g., `.clang-format`, `.gitignore`) and documentation (e.g., `README.md`) are present at the root level.
If you're working with the LLVM Project, you might be interested in building, debugging, or contributing to one of these components. Let me know if you'd like help with anything specific!
Gen-CLI
分析に成功 LLVM
コア・コンポーネント、主要機能、典型的なユースケースを正確に特定したプロジェクトの構造は、大規模なコードベースを扱う可能性を示している。
コア・ワークフロー:連続デバッグ-編集-検証ループ
依存度が高い場合 VSCode
Code Agentのユーザーにとって、インテリジェンスが自動的に変更を実行し、テストを実行し、その結果に基づいて再度変更を行うというサイクルは、効率向上の鍵となります。Gen-CLI
この "自動操縦 "モードに入ることは可能ですか?
テストタスクは Gen-CLI
プロジェクトにファイルのユニットテストを追加する。まず、スマート本体が問題のファイルを問題なく読み込む。
> create test for @packages/core/src/core/siliconFlowContentGenerator.ts following @packages/core/src/core/contentGenerator.test.ts
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✔ ReadManyFiles Will attempt to read and concatenate files using patterns: `packages/core/src/core/siliconFlowContentGenerator.ts`, `packages/core/src/core/conten… │
│ │
│ ### ReadManyFiles Result (Target Dir: `/oss/gen-cli`) │
│ │
│ Successfully read and concatenated content from **2 file(s)**. │
│ │
│ **Processed Files:** │
│ - `packages/core/src/core/contentGenerator.test.ts` │
│ - `packages/core/src/core/siliconFlowContentGenerator.ts` │
╰───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
未開封の場合 --yolo
(自動承認)モード。Gen-CLI
エディターのエージェントと同じように、ユーザーにファイル変更の承認を求めます。
Next Steps:
1. Save this file as packages/core/src/core/siliconFlowContentGenerator.test.ts.
2. Run the test to ensure it passes (assuming the implementation of siliconFlowContentGenerator.ts follows the expected behavior).
Let me know if you'd like me to save this file or make any adjustments!
> Save this file and run test with npm run test [file name]
╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ? WriteFile Writing to /siliconFlowContentGenerator.test.ts ← │
│ │
│ ... first 44 lines hidden ... │
│ 45 }, │
│ 46 }, │
│ 47 }); │
│ 48 expect(generator).toBe((mockGenerator as GoogleGenAI).models); │
│ 49 }); │
│ 50 }); │
│ │
│ Apply this change? │
│ │
│ ● Yes, allow once │
│ ○ Yes, allow always │
│ ○ Modify with external editor │
│ ○ No (esc) │
│
しかし、テスト中に以下のことも判明した。Gen-CLI
ツール・コールは常に信頼できるとは限らない。時々、間違ったツール・コール命令を生成し、タスクを中断させることがある。
╭─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ ✔ Edit /siliconFlowContentGenerator.test.ts: import { jest } from '@jest/gl... => import { vi } from 'vitest'; │
│ │
│ 7 import { SiliconFlowContentGenerator } from './siliconFlowContentGenerator'; │
│ 8 import { GenerateContentParameters, CountTokensParameters } from '@google/genai'; │
│ 9 import OpenAI from 'openai'; │
│ 10 - import { jest } from '@jest/globals'; │
│ 10 + import { vi } from 'vitest'; │
│ 11 │
│ 12 describe('SiliconFlowContentGenerator', () => { │
│ 13 let generator: SiliconFlowContentGenerator; │
╰─────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
╭───────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮
│ x undefined_tool_name ["function<|tool sep|>replace",{"file_path":"/oss/gen-cli/packages/core/src/core/siliconFlowContentGenerator.test.ts","old_strin… │
│ │
│ Tool "undefined_tool_name" not found in registry.
手作業で何度も試行錯誤を繰り返した後Gen-CLI
最終的には、Debug-Edit-Validateループに入ることができる。これに対してCursor
もしかしたら Aline
このようなツールは、自動化されたループをより流暢にトリガーする。これは、構造化されていない自然言語出力の処理に優れているためと思われ、頻繁なインタラクションシナリオにおいて、ツール呼び出しのトリガーをより信頼性の高いものにしている。 Gen-CLI
今後の改善の方向性。
ハンズオンアプリケーション:ワンクリックでTodoアプリを作成する
とおす --yolo
パラメータは、すべてのインタラクションを自動的に承認し、テストすることができます。 Gen-CLI
のエンド・ツー・エンドのプロジェクト作成能力。
gen --prompt "create a todo app, save the src files in the current dir" --yolo
コマンド実行後、関連ファイルが正常に作成されていることが確認できる:
% ls
app.js index.html styles.css
ブラウザで開く index.html
エラー処理を備えたフル機能のTodoアプリケーションを実行する準備が整いました。
非開発者も恩恵を受ける:日常業務の自動化
CLIエージェントの価値は、開発者だけにとどまりません。繰り返しのファイル操作に対処しなければならないすべてのユーザーにとって、非常に便利なものです。例えば、金銭的な払い戻しのシナリオでは、特定の金額に近い請求書PDFの組み合わせを、山の中からこつこつと集める必要があります。
GUIエージェントを使用する場合、ウェブページを開き、コマンドを入力し、モデルが処理するのを待ち、結果を再確認するというステップが必要になることがあります。CLI Agentの利点は、再利用性とプログラム性です。一連のコマンドをスクリプトとして保存し、必要なときにワンクリックで実行することができ、GUIの手動操作では実現できないスクリプトの連続最適化も可能です。
以下 Gen-CLI
このタスクを処理する実際のプロセス:
cd "6月发票"
gen --prompt "这个文件夹包含了这个月的发票,读取所有内容,找到正好加起来最接近888元的组合" --yolo
Gen-CLI
以下のステップは自律的に計画され、実行された:
- フォルダの内容を読む請求書の全書類をリストアップしてください。
- 道具の使い方を学ぶ自分で勉強して電話する
pdftotext
コマンドを使ってPDFファイルからテキストを抽出することができます。 - データ処理異なる通貨(米ドルと人民元)の金額を確認し、為替レートを換算する。
- 組み合わせ分析請求書のすべての可能な組み合わせを計算し、合計金額が目標値888ドルに最も近いオプションを見つける。
> 这个文件夹包含了这个月的发票,读取所有内容,找到正好加起来最接近888元的组合, 如果是pdf文件,请运行 poppler 的pdftotext命令来读取 pdf
... (Agent autonomously reads folder, executes pdftotext on multiple files, extracts text) ...
✦ Here are the extracted amounts from the invoices:
1. 2025-04-23_041203 火车票.pdf: ¥54.50 (Train ticket)
2. YYY-Invoice_2112627897.pdf: $8.97 (YYY invoice)
3. bj-tj25119110010001979920.pdf: ¥54.50 (Train ticket)
4. dzfp_25322000000121860670_20250320103244.pdf: ¥2961.00 (Hotel invoice)
... (and 8 more invoices) ...
Next Steps:
1. Convert all USD amounts to CNY (assuming an exchange rate of 1 USD = 7.2 CNY for simplicity).
2. Sum the amounts to find the combination closest to ¥888.
Would you like me to proceed with the calculations?
> yes
✦ Here are the converted amounts (assuming 1 USD = 7.2 CNY) and the total in CNY:
1. 2025-04-23_041203 火车票.pdf: ¥54.50
2. YYY-Invoice_2112627897.pdf: $8.97 → ¥64.58
... (all amounts converted to CNY) ...
Goal: Find the combination of invoices that sums closest to ¥888.
Possible Combinations:
... (Agent calculates multiple combinations) ...
Best Match:
Combination 3 sums to ¥888.80, which is only ¥0.80 above the target of ¥888.
Invoices in Combination 3:
1. 2025-04-23_041203 火车票.pdf (¥54.50)
2. YYY-Invoice_2112627897.pdf (¥64.58)
3. bj-tj25119110010001979920.pdf (¥54.50)
4. XXX云服务-Invoice-PPITBZ-00013.pdf (¥72.00)
5. Invoice_2149516169.pdf (¥97.49)
6. Invoice_2184658113.pdf (¥100.73)
7. XX酒店KPLS202505290028783_8432931_1.pdf (¥345.00)
いずれはね。Gen-CLI
タスクを成功裏に完了させただけでなく、目標金額からわずか$0.8だけずれた完璧な組み合わせを出した。この例は、複雑な日常業務を自動化するCLIエージェントの威力を示しています。
を合わせると、以下のようになる。 Claude Code
と、締約国が条約に基づく義務を履行する能力を100点の範囲で評価する。Gemini-CLI
は80点である。 DeepSeek
デマンド・ドリブン Gen-CLI
現在、70点を達成することができる。ツール起動の安定性やインタラクションのスムーズさにはまだ改善の余地があるが、モデルとCLIツールチェーンの継続的な反復により、その将来的なパフォーマンスは期待に値する。
Gen-CLI
プロジェクトはGitHubでオープンソース化されており、将来的にはより多くのモデルをサポートする予定だ。興味のあるユーザーや開発者の方は、ぜひご参加ください。