{"id":42608279,"url":"https://github.com/zaucy/gemini.nvim","last_synced_at":"2026-01-29T02:17:08.226Z","repository":{"id":333414786,"uuid":"1137130233","full_name":"zaucy/gemini.nvim","owner":"zaucy","description":"gemini cli integration for neovim","archived":false,"fork":false,"pushed_at":"2026-01-19T04:52:43.000Z","size":15,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-01-19T13:35:49.130Z","etag":null,"topics":["gemini-cli","mcp","mcp-server","neovim","neovim-plugin"],"latest_commit_sha":null,"homepage":"","language":"Lua","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zaucy.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-01-19T00:32:36.000Z","updated_at":"2026-01-19T11:25:08.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/zaucy/gemini.nvim","commit_stats":null,"previous_names":["zaucy/gemini.nvim"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/zaucy/gemini.nvim","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaucy%2Fgemini.nvim","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaucy%2Fgemini.nvim/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaucy%2Fgemini.nvim/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaucy%2Fgemini.nvim/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zaucy","download_url":"https://codeload.github.com/zaucy/gemini.nvim/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zaucy%2Fgemini.nvim/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28860683,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-28T22:56:21.783Z","status":"online","status_checked_at":"2026-01-29T02:00:06.714Z","response_time":59,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["gemini-cli","mcp","mcp-server","neovim","neovim-plugin"],"created_at":"2026-01-29T02:17:06.492Z","updated_at":"2026-01-29T02:17:08.220Z","avatar_url":"https://github.com/zaucy.png","language":"Lua","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gemini.nvim\n\nNeovim support for the Gemini CLI, featuring a built-in diff viewer and hook support. This plugin doesn't actually spawn Gemini; it just sets up environment variables and workspace settings so that when you run Gemini, it can communicate with Neovim.\n\nNote that you should use [zaucy/mcp.nvim](https://github.com/zaucy/mcp.nvim) to register tools and prompts; this plugin focuses specifically on the Gemini IDE integration and listening for hooks.\n\n## Installation\n\n### [lazy.nvim](https://github.com/folke/lazy.nvim)\n\n```lua\n{\n    \"zaucy/gemini.nvim\",\n    dependencies = {\n        \"zaucy/mcp.nvim\",\n    },\n    opts = {},\n}\n```\n\n## Autocommands\n\nThis plugin exposes several user autocommands that you can use to trigger actions during various stages of the Gemini interaction.\n\n| Pattern | Description | Data |\n| :--- | :--- | :--- |\n| `GeminiHookSessionStart` | Triggered when a new Gemini session starts. | `context` |\n| `GeminiHookBeforeAgent` | Triggered before the agent begins processing. | `context` |\n| `GeminiHookBeforeToolSelection` | Triggered before the model selects a tool. | `context` |\n| `GeminiHookBeforeTool` | Triggered before a tool is executed. | `context` |\n| `GeminiHookAfterTool` | Triggered after a tool has been executed. | `context` |\n| `GeminiHookAfterModel` | Triggered after the model completes its response. | `context` |\n| `GeminiHookSessionEnd` | Triggered when the Gemini session ends. | `context` |\n| `GeminiOpenDiffPre` | Triggered before a diff view is opened. | - |\n| `GeminiOpenDiff` | Triggered after a diff view is opened. | `bufnr` |\n| `GeminiCloseDiff` | Triggered after a diff view is closed. | `bufnr` |\n\n### Example Usage\n\n```lua\nvim.api.nvim_create_autocmd(\"User\", {\n    pattern = \"GeminiHookAfterTool\",\n    callback = function(args)\n        local context = args.data.context\n        -- Example: Print tool name if available in context\n        if context.tool_name then\n            print(\"Tool executed: \" .. context.tool_name)\n        end\n    end,\n})\n```\n\n## Implementation Strategy\n\n`gemini.nvim` integrates closely with [mcp.nvim](https://github.com/zaucy/mcp.nvim) to provide a seamless environment for the Gemini CLI.\n\nThe implementation relies on several key mechanisms:\n\n1.  **Event-Driven Configuration:** The plugin listens for `McpServerCreated` and `McpServerDirChange` autocommands from `mcp.nvim`. When these events occur, `gemini.nvim` dynamically generates settings for the current workspace.\n2.  **Environment Variables:** Upon a directory change within an MCP-enabled project, the plugin updates specific environment variables:\n    - `GEMINI_CLI_IDE_WORKSPACE_PATH`: The current project root.\n    - `GEMINI_CLI_SYSTEM_SETTINGS_PATH`: Path to a workspace-specific `settings.json` file generated by the plugin.\n    - `GEMINI_CLI_IDE_SERVER_STDIO_COMMAND` \u0026 `GEMINI_CLI_IDE_SERVER_STDIO_ARGS`: Configures Gemini to communicate back to Neovim as an MCP server using a specialized client script.\n3.  **Dynamic Settings Generation:** The plugin generates a `settings.json` file that:\n    - Configures Neovim as an MCP server for Gemini, enabling it to call tools like `openDiff` and `closeDiff`.\n    - Sets up \"Hooks\" that notify Neovim about session events (e.g., `BeforeTool`, `AfterModel`).\n4.  **Hook System:** When Gemini executes hooks, it calls a hook script provided by this plugin, which in turn communicates with Neovim via RPC to trigger `User` autocommands, allowing for extensible behavior.\n\n## Other plugins\n* https://github.com/vaijab/gemini-cli.nvim - original inspiration for this plugin\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaucy%2Fgemini.nvim","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzaucy%2Fgemini.nvim","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzaucy%2Fgemini.nvim/lists"}