{
  "markdown": "# Gopls Extension for Gemini CLI\n\nEnglish | [简体中文](./README_zh.md)\n\nThis extension integrates the [**official** MCP](https://tip.golang.org/gopls/features/mcp) of the Go language server (`gopls`) with Gemini CLI. It enables Gemini to understand, write, and modify Go code with greater precision by providing language-aware features directly within the CLI environment.\n\n## Demo\n\nTo demonstrate its effectiveness, I performed the same code refactoring task in a Go project, both with and without this extension.\n\nWhen using the extension, Gemini CLI calls the `gopls` tool to obtain precise symbol relationships and runs diagnostics immediately after each file modification. This avoids having to deal with a large number of syntax errors all at once during the final compilation.\n\nBoth the speed and accuracy of refactoring were significantly improved with the extension. For example, in the comparison case, Gemini missed updating some references to the refactored code when the extension was not used.\n\n![compare](https://github.com/user-attachments/assets/c3913176-afae-4b9e-af23-a29dbd3dda81)\n\n## Installation\n\nInstall this extension using the following Gemini CLI command:\n\n```bash\ngemini extensions install https://github.com/Menghuan1918/gemini-cli-gopls\n```\n\nThe extension automatically checks the `gopls` version in the system `PATH` at runtime. Since the MCP feature requires `gopls` v0.20.0 or later, if a compatible version of `gopls` is not found, the extension will attempt to automatically download and install it to the `~/go/bin` directory.\n\nIf it still fails to start, please try manually installing `gopls` v0.20.0 or a later version into your `PATH`.\n\n## Features\n\nThis extension provides Gemini CLI with the following tools based on the `gopls` MCP:\n\n- `go_diagnostics`: Workspace-based syntax error checking\n- `go_file_context`: Summarizes cross-file dependencies for a file\n- `go_package_api`: Provides information on external/internal Go package APIs\n- `go_search`: Searches for symbols in the workspace\n- `go_symbol_references`: Provides reference locations for Go symbols\n- `go_workspace`: Provides Go workspace information\n\nAdditionally, the plugin has built-in prompts from the official gopls MCP, with minor modifications to better suit Gemini CLI. You can view them in [GEMINI.md](./GEMINI.md).\n\n> The built-in prompts from the official gopls MCP were exported using `gopls mcp -instructions > GEMINI.md`\n\n## Usage\n\nWhen launched in a Go project (a workspace containing a `go.mod` file), the relevant tools will be loaded automatically. Otherwise, only an empty MCP service will be loaded (to avoid errors).\n",
  "bytes": 2638,
  "sha": "1135c9b0d58e80c2fe7041b16ce2a835ecd7070b95065b6bcfd6bb8ea0f73880",
  "repo_slug": "menghuan1918/gemini-cli-gopls",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/plg_menghuan1918_gemini_cli_gopls_569cf17d/readme"
}