You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
description: Run Gemini CLI in your workspace for AI pair programming
3
4
icon: ../../../../.icons/gemini.svg
4
-
description: Run Gemini CLI in your workspace with AgentAPI integration
5
5
verified: true
6
6
tags: [agent, gemini, ai, google, tasks]
7
7
---
8
8
9
9
# Gemini CLI
10
10
11
-
Run [Gemini CLI](https://ai.google.dev/gemini-api/docs/cli) in your workspace to access Google's Gemini AI models, and custom pre/post install scripts. This module integrates with [AgentAPI](https://github.com/coder/agentapi) for Coder Tasks compatibility.
11
+
Run [Gemini CLI](https://github.com/google-gemini/gemini-cli) in your workspace to access Google's Gemini AI models for interactive coding assistance and automated task execution.
-**Install**: The module installs Gemini CLI using npm (installs Node.js via NVM if needed)
58
-
-**Instruction Prompt**: If `GEMINI_INSTRUCTION_PROMPT` and `GEMINI_START_DIRECTORY` are set, creates the directory (if needed) and writes the prompt to `GEMINI.md`
59
-
-**Start**: Launches Gemini CLI in the specified directory, wrapped by AgentAPI
60
-
-**Environment**: Sets `GEMINI_API_KEY`, `GOOGLE_GENAI_USE_VERTEXAI`, `GEMINI_MODEL` for the CLI (if variables provided)
86
+
data "coder_parameter" "ai_prompt" {
87
+
type = "string"
88
+
name = "AI Prompt"
89
+
default = ""
90
+
description = "Task prompt for automated Gemini execution"
enable_yolo_mode = true # Auto-approve all tool calls for automation
104
+
gemini_system_prompt = <<-EOT
105
+
You are a helpful coding assistant. Always explain your code changes clearly.
106
+
YOU MUST REPORT ALL TASKS TO CODER.
107
+
EOT
108
+
}
109
+
```
110
+
111
+
> [!WARNING]
112
+
> YOLO mode automatically approves all tool calls without user confirmation. The agent has access to your machine's file system and terminal. Only enable in trusted, isolated environments.
113
+
114
+
### Using Vertex AI (Enterprise)
115
+
116
+
For enterprise users who prefer Google's Vertex AI platform:
- If Gemini CLI is not found, ensure `install_gemini = true` and your API key is valid
65
-
- Node.js and npm are installed automatically if missing (using NVM)
66
-
- Check logs in `/home/coder/.gemini-module/` for install/start output
67
-
- We highly recommend using the `gemini_api_key` variable, this also ensures smooth tasks running without needing to sign in to Google.
131
+
- If Gemini CLI is not found, ensure your API key is valid (`install_gemini` defaults to `true`)
132
+
- Check logs in `~/.gemini-module/` for install/start output
133
+
- Use the `gemini_api_key` variable to avoid requiring Google sign-in
68
134
69
-
> [!IMPORTANT]
70
-
> To use tasks with Gemini CLI, ensure you have the `gemini_api_key` variable set, and **you pass the `AI Prompt` Parameter**.
71
-
> By default we inject the "theme": "Default" and "selectedAuthType": "gemini-api-key" to your ~/.gemini/settings.json along with the coder mcp server.
72
-
> In `gemini_instruction_prompt` and `AI Prompt` text we recommend using (\`\`) backticks instead of quotes to avoid escaping issues. Eg: gemini_instruction_prompt = "Start every response with \`Gemini says:\` "
135
+
The module creates log files in the workspace's `~/.gemini-module` directory for debugging purposes.
0 commit comments