ctrl+shift+p filters: :st2 :st3 :win :osx :linux
Browse

Gemini​CLI

by flashmodel ST4

interactive google Gemini CLI interface for Sublime Text with file-context and agentic coding support

Labels agent, ai, chat

Details

Installs

  • Total 92
  • Win 41
  • Mac 31
  • Linux 20
Apr 18 Apr 17 Apr 16 Apr 15 Apr 14 Apr 13 Apr 12 Apr 11 Apr 10 Apr 9 Apr 8 Apr 7 Apr 6 Apr 5 Apr 4 Apr 3 Apr 2 Apr 1 Mar 31 Mar 30 Mar 29 Mar 28 Mar 27 Mar 26 Mar 25 Mar 24 Mar 23 Mar 22 Mar 21 Mar 20 Mar 19 Mar 18 Mar 17 Mar 16 Mar 15 Mar 14 Mar 13 Mar 12 Mar 11 Mar 10 Mar 9 Mar 8 Mar 7 Mar 6 Mar 5
Windows 1 1 2 0 3 1 1 2 0 0 0 4 5 0 4 1 1 3 4 6 4 1 3 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Mac 0 0 2 4 2 1 4 1 0 1 1 1 0 1 3 0 1 1 3 3 1 4 4 5 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
Linux 0 1 0 2 2 1 0 1 1 2 1 1 1 2 0 0 1 0 1 0 1 1 1 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0

Readme

Source
raw.​githubusercontent.​com

Gemini CLI for Sublime Text

This package provides an agentic interface to the google Gemini CLI directly within Sublime Text.

Gemini Chat

For detailed usage and features, please refer to the Gemini CLI in SublimeText.

Prerequisites

This plugin relies on the Google Gemini CLI. Install the required CLI tool:

npm install -g @google/gemini-cli

Requirement: gemini-cli version 0.34.0 or higher. For detailed installation, refer to the geminicli official docs.

Note: The plugin automatically detects CLI installation across multiple environments, including Homebrew, npm-global, Yarn, and common local binary directories. You typically don't need to manually configure environment variables or search paths.

Install GeminiCLI plugin from Package Control

The easiest way to install this plugin is through Package Control.

  1. Open the command palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux).
  2. Type Package Control: Install Package and press Enter.
  3. Search for GeminiCLI and press Enter.

The plugin automatically detects gemini-cli. If the command line tool is installed elsewhere, or you wish to use a specific geminiversion, you can manually set the path in Preferences -> Package Settings -> GeminiCLI -> Settings

For example set the "gemini_command" in settings with:

  • Windows: "C:/Users/myname/AppData/Roaming/npm/gemini.cmd"
  • macOS/Linux: "/usr/local/bin/gemini"

Gemini Authentication

You need to authenticate before using the plugin. Supported methods:

  • gemini cli auth: Run gemini in your system terminal, then type /auth to login with your Google account.
  • API Key: Obtain an API key from Google AI Studio and set it in Preferences -> Package Settings -> GeminiCLI -> Settings.
  • Google Vertex AI: If you're using Vertex AI on Google Cloud, configure your project and location in the env section of your settings:

    "env": {
        "GOOGLE_CLOUD_PROJECT": "your-project-id",
        "GOOGLE_CLOUD_LOCATION": "us-central1"
    }
    

    Ensure you've authenticated with your Google Cloud account via gcloud auth application-default login.

Start Gemini Chat

  1. Open the command palette (Cmd+Shift+P on macOS, Ctrl+Shift+P on Windows/Linux).
  2. Type Gemini: Start Chat and press Enter.
  3. A new view will open for the Gemini chat.
  4. Alternatively, you can use a shortcut to start the chat (see Key Bindings for configuration).
  5. Type your message and press Ctrl+Enter (or Super+Enter on macOS) to send.

Using Gemini in Sublime Text

Chat with Current File or Selection

You can right-click in any file, tab, or item in the sidebar, and select Chat with Gemini agent. This will:

  • Open the Gemini chat view (if not already open).
  • Insert a reference to the file (@filename) or selected line range (@filename#L1-10) into the message prompt.
  • Tagged files will be automatically sent as context to Gemini.

Set Gemini Working Space

Right-click on any folder in the sidebar and select Set Gemini Working Space to set the primary working directory for Gemini. This affects the current working directory when Gemini executes commands or accesses files.

Additionally, this plugin supports Sublime Text's multi-root workspaces. By default, it injects all currently open folders into the Gemini CLI automatically, ensuring the agent can access your entire open project across multiple roots. This can be disabled via the share_workspace_folders setting in GeminiCLI.sublime-settings.

Quick Prompt Without Chat View

Use the command palette (Gemini: Prompt) to send a quick instruction to Gemini without opening the chat view manually.

Gemini Approval Mode

Gemini CLI performs various actions (tools) like reading files, searching the web, or executing commands. You can control how much manual approval is required for these actions via the command palette: Gemini: Approval Mode

  • Default: Prompts for your approval by default.
  • Allow Edit: Automatically approves “safe” read/edit operations; still prompts for “risky” commands.
  • Accept All: Automatically approves all tool calls, including shell command execution.

Clear Session

To reset the current conversation history and start a completely fresh context, open the command palette and run Gemini: Clear Session. This will reload the agent and clear its memory for the current workspace.

Key Bindings

In the Gemini chat view, you can use the Up and Down arrow keys to scroll through your input history.

This package does not include a global shortcut by default. You can add key bindings manually:

  1. Go to Preferences -> Key Bindings.
  2. Add the following lines to your user keymap file:
  3. now you can use the shortcut Ctrl+Alt+G (or Super+Alt+G on macOS) to start Gemini Chat
[
    {
        "keys": ["ctrl+alt+g"],
        "command": "gemini_cli",
        "args": {}
    },
    {
        "keys": ["super+alt+g"],
        "command": "gemini_cli",
        "args": {},
        "context":
        [
            { "key": "setting.is_widget", "operand": false }
        ]
    }
]

Manual Installation from github

  1. Open Sublime Text and navigate to Preferences -> Browse Packages....
  2. This will open the Packages directory. clone the repository from github into the directory: │
  3. Rename the repository folder to GeminiCLI directory; and Restart Sublime Text.

Gemini Context Interaction and Data Privacy

By default, this plugin does not send your entire workspace or file contents to Gemini. Data is only sent to the Google Gemini CLI in the following scenarios:

  • Chat Messages: Any text you type directly into the Gemini Chat view.
  • Explicit Context (@-mentions): When you use the @filename syntax (either manually or via the “Gemini: Chat with this file” context menu), the content of the specified file or selected range is sent.
  • Tool-driven Context: If the Gemini agent requests to read a file or list a directory (and you have granted permission if required by the CLI), that information is sent back to the model as part of the interaction.

All communication happens via the gemini CLI tool installed on your system, which connects directly to Google's servers using your configured credentials (API key or OAuth).

License

This project is licensed under the MIT License - see the LICENSE file for details.