Collaborating With Gemini Cliのロゴ

Collaborating With Gemini Cli

コミュニティ
ZhenHuangLab
collaborating-with-gemini-cli

Delegates code review, debugging, and alternative implementation comparisons to Google Gemini CLI (`gemini`) via a JSON bridge script (default model: `gemini-3-pro-preview`). Supports headless one-shot and multi-turn sessions via `SESSION_ID`, with conservative defaults for Gemini effective-context constraints (file-scoped, `--no-full-access` by default) while allowing user override.

概要

公開者ZhenHuangLab
リポジトリcollaborating-with-gemini-cli
スキル名collaborating-with-gemini-cli
スター
30
フォーク
6
同梱ファイル
2
ライセンスMIT
リンク
  • Markdown形式の指示

    モデルが必要に応じて読み込むSKILL.mdファイルです。関連するリクエストがあったときだけトークンを消費します。

  • どのLLMでも利用可能

    AIスキルはプロバイダー固有のコードではなく、通常のMarkdownなので、GPT、Claude、Gemini、Grok、ローカルモデルで利用できます。

  • 2個の同梱ファイル

    モデルが作業中に読み取れるスクリプト、テンプレート、参考資料です。ファイルは読み取り専用で、実行されることはありません。

  • オープンソース

    ZhenHuangLabがGitHubで公開しています。インストールする前にソースを確認してください。

インストール

AIスキルCollaborating With Gemini CliをTypingMindにインストールすれば、どのLLMでも利用できます。SKILL.mdを読み取れる別のAIエージェントに追加することもできます。

1

TypingMindにインストール

TypingMindはGitHubフォルダから直接スキルをインストールします。SKILL.mdを読み取り、リソースファイルをまとめてローカルに保存します。

  1. アプリを開き、「プラグイン」→「スキル」に移動します。
  2. 「GitHubからインストール」を選択します。
  3. 以下のスキルフォルダのURLを貼り付けて確定します。
    https://github.com/ZhenHuangLab/collaborating-with-gemini-cli/tree/main
  4. スキルを利用したいチャットごとに、そのスキルを有効にしてください。
「プラグイン」→「スキル」→「スキルを追加」→「GitHubのURLから」を選択し、フォルダのURLを貼り付けて「続行」を押します。
2

別のAIエージェントにインストール

Agent Skills形式を読み取れるAIエージェントなら、このスキルを利用できます。フォルダをそのAIエージェントのスキルディレクトリにコピーしてください。

Claude Code — .claude/skills
git clone --depth 1 https://github.com/ZhenHuangLab/collaborating-with-gemini-cli.git \
  .claude/skills/collaborating-with-gemini-cli
コピー後、新しいスキルを読み込むためにClaude Codeを再起動してください。

TypingMindで使用

TypingMindのチャットでCollaborating With Gemini Cliを有効にするだけで、あとはモデルが対応します。名前と説明がシステムプロンプトに含まれ、関連するリクエストがあると、モデルが指示の全文を自動で読み込みます。手動で呼び出す必要はなく、実際に使用されるまでトークンを消費しません。

関連するリクエストがあると、モデルが自動的にCollaborating With Gemini Cliを読み込みます。

どのAIモデルでも利用可能

AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、Collaborating With Gemini Cliは作成時に想定されたモデルに縛られません。TypingMindに一度インストールすれば、ご自身のAPIキーを使って、GPT-5、Claude、Gemini、Grok、DeepSeek、Mistral、Llama、またはご自身で実行するローカルモデルで利用できます。

  • 必要なときだけ読み込み

    システムプロンプトには名前と説明だけが含まれます。関連するリクエストが初めてあったときに指示を取得するため、未使用のスキルにはコストがかかりません。

  • チャットの途中でモデルを切り替え

    スキルはコードではなく指示なので、モデルを切り替えてもそのまま使えます。次のモデルも同じSKILL.mdを読み込みます。

スキルの指示

モデルが読み込むSKILL.mdの内容です。スキルはモデルが従う指示なので、インストールする前に確認してください。

Collaborating with Gemini CLI

Use this skill when you want a second model (Gemini) to sanity-check a solution, spot edge cases, propose tests, or suggest an alternative implementation approach.

This skill provides a small JSON bridge script that runs gemini (Gemini CLI) in non-interactive headless mode and returns structured output.

Compared to collaborating-with-claude-code, this skill defaults to read-only and is optimized for file-scoped, one-shot requests to avoid practical effective-context degradation.

Requirements

  • Gemini CLI installed (gemini --version).
    • Install via npm: npm i -g @google/gemini-cli
  • Gemini CLI authenticated (Google account login or API key auth, depending on your local setup).
  • Python 3 (to run the bridge script).

Quick start

bash
python scripts/gemini_cli_bridge.py --cd "/path/to/repo" --PROMPT "Review src/auth/login.py for bypasses; propose fixes as a unified diff."

Recommended (explicit file scope, best for effective context):

bash
python scripts/gemini_cli_bridge.py --cd "/path/to/repo" --file "src/auth/login.py" --PROMPT "Review this file for bypasses; propose fixes as a unified diff."

Multi-turn sessions

Always capture the returned SESSION_ID and pass it back on follow-ups:

bash
# Start a new session (one-shot by default)
python scripts/gemini_cli_bridge.py --cd "/repo" --file "src/auth/login.py" --PROMPT "Summarize issues and propose a patch."

# Continue the same session
python scripts/gemini_cli_bridge.py --cd "/repo" --SESSION_ID "uuid-from-response" --PROMPT "Now propose 5 targeted tests for the fix."

Access modes

This skill defaults to --no-full-access (read-only).

  • Read-only (default): --no-full-access → maps to gemini --approval-mode default
  • Full access (edits allowed): --full-access → maps to gemini --approval-mode auto_edit
  • YOLO (auto-approve everything): --yolo → maps to gemini --approval-mode yolo

Examples:

bash
# Allow edits (auto-approve edit tools)
python scripts/gemini_cli_bridge.py --full-access --cd "/repo" --file "src/foo.py" --PROMPT "Refactor for clarity; keep behavior; apply edits."
bash
# YOLO mode (dangerous): allow any tool calls without confirmation
python scripts/gemini_cli_bridge.py --yolo --cd "/repo" --PROMPT "Run tests, fix failures, and apply edits."

Effective-context guardrails (default ON)

By default the bridge enables conservative guardrails designed for practical effective context:

  • Adds a preamble instructing Gemini to stop and ask before reading additional files.
  • Strongly encourages file-scoped runs (use --file and keep each call small).
  • Uses --max-files as a preference for “how many files per turn” and as a cap for auto-extracted files (only when you did not pass explicit --file).

User override options:

  • --file PATH (repeatable): explicitly decide the focus file set (recommended; not blocked by --max-files).
  • --max-files N: raise the preferred cap / auto-extraction cap.
  • --no-guardrails: disable guardrails (Gemini may read many files; treat like a normal agent).

Session rotation guidance (effective context)

The bridge exposes Gemini CLI token stats when available:

  • meta.prompt_tokens: prompt tokens reported by Gemini CLI
  • meta.over_effective_context_limit: true when prompt_tokens > --effective-context-tokens

When meta.over_effective_context_limit is true, prefer starting a new session for the next turn (omit --SESSION_ID) and/or reduce the focus scope.

Parameters (bridge script)

  • --PROMPT (required): Instruction to send to Gemini.
  • --cd (required): Working directory to run Gemini CLI in (typically repo root).
  • --SESSION_ID (optional): Resume an existing Gemini CLI session (uuid).
  • --model (optional): Defaults to gemini-3-pro-preview.
  • --full-access / --no-full-access (optional): Defaults to --no-full-access.
  • --yolo (optional): YOLO approval mode (implies full access).
  • --sandbox (optional): Run Gemini CLI in sandbox mode (requires Docker). Default: off.
  • --return-all-messages (optional): Return the full streamed event list (debugging).
  • --file PATH (repeatable): Focus files to prepend as @PATH (recommended).
  • --max-files / --no-guardrails / --effective-context-tokens: Guardrail controls (--max-files is a preference + auto-extraction cap; it does not block explicit --file).
  • --timeout-s (optional): Defaults to 1800 seconds.

Output format

The bridge prints JSON:

json
{
  "success": true,
  "SESSION_ID": "uuid",
  "agent_messages": "…Gemini output…",
  "all_messages": [],
  "meta": {}
}

meta includes the normalized focus file list and (when available) token stats extracted from Gemini CLI output.

同梱ファイル

スキルが読み込まれている間、モデルは必要に応じてこれらを読み取ります。読み取り可能なファイルとして提供され、実行されることはありません。

よくある質問

AIスキル「Collaborating With Gemini Cli」では何ができますか?

Delegates code review, debugging, and alternative implementation comparisons to Google Gemini CLI (`gemini`) via a JSON bridge script (default model: `gemini-3-pro-preview`). Supports headless one-shot and multi-turn sessions via `SESSION_ID`, with conservative defaults for Gemini effective-context constraints (file-scoped, `--no-full-access` by default) while allowing user override.

TypingMindでCollaborating With Gemini Cliを使うメリットは何ですか?

一度インストールすれば、どのモデルでも使えるからです。Collaborating With Gemini Cliはプロバイダー固有のコードではなく、通常のMarkdownで記述されているため、同じスキルをGPT-5、Claude、Gemini、Grok、ローカルモデルで利用できます。チャットの途中でモデルを切り替えても、そのまま使い続けられます。TypingMindは自分のAPIキーで動作するため、シート単位のサブスクリプションではなく、プロバイダーに直接料金を支払います。スキルとチャットは自分のストレージに保持されます。

TypingMindにCollaborating With Gemini Cliをインストールするにはどうすればよいですか?

TypingMindで「プラグイン」→「スキル」→「GitHubからインストール」を開き、https://github.com/ZhenHuangLab/collaborating-with-gemini-cli/tree/mainを貼り付けてください。TypingMindがSKILL.mdを読み込み、関連ファイルをまとめて、チャットごとに有効にできるスキルとしてインストールします。

Collaborating With Gemini Cliを使えるAIモデルはどれですか?

TypingMindに接続したどのモデルでも利用できます。AIスキルはプロバイダー固有のコードではなく、通常のMarkdownで書かれた指示です。そのため、GPT、Claude、Gemini、Grok、ローカルモデルのいずれも、リクエストが合致したときにこのスキルを読み込めます。

Collaborating With Gemini Cliは何個のAIモデルで使えますか?

数に制限はありません。スキルに対応したモデルであれば、GPT、Claude、Gemini、Grok、DeepSeek、Mistral、Llamaなど、どのモデルでもCollaborating With Gemini Cliを利用できます。すべてTypingMind上で、自分のAPIキーを使って利用できます。

AIスキル「Collaborating With Gemini Cli」は無料ですか?

はい。ZhenHuangLabがGitHubでMITライセンスの下で公開しています。支払いが必要なのは、利用したトークンに対する、ご自身が契約するAIプロバイダーへの料金だけです。

AIスキルとは何ですか?

AIスキルは、特定のタスクの実行方法をAIモデルに教える、再利用可能な指示のセットです。オープンなAgent Skills形式に従い、名前と説明を含むSKILL.mdファイルに加え、モデルが必要とするスクリプト、テンプレート、参照ファイルで構成されます。モデルはリクエストがスキルに合致したときだけ指示を読み込むため、インストール済みのスキルも、使うまでは費用がかかりません。

AIスキルは、プラグインやMCPサーバーとどう違いますか?

プラグインやMCPサーバーは、モデルが呼び出せる新しいツールを提供します。ツールとは、どこかで実行され、結果を返すコードです。一方、AIスキルは、タスクへの取り組み方、従うべき手順、望ましい出力の例といった知識や進め方をモデルに伝えます。スキルは通常のMarkdownで記述されているため、サーバー、APIキー、実行環境は不要で、どのモデルでも利用できます。

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇