Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0fd038a

Browse files
Merge branch 'main' into feat/nexus-repository-module
2 parents 8de8da8 + 40863c0 commit 0fd038a

File tree

46 files changed

+1889
-256
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+1889
-256
lines changed

.github/workflows/ci.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
- name: Validate formatting
4949
run: bun fmt:ci
5050
- name: Check for typos
51-
uses: crate-ci/typos@v1.34.0
51+
uses: crate-ci/typos@v1.35.3
5252
with:
5353
config: .github/typos.toml
5454
validate-readme-files:

.github/workflows/deploy-registry.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ on:
1414
paths:
1515
- ".github/workflows/deploy-registry.yaml"
1616
- "registry/**/templates/**"
17+
- "registry/**/README.md"
1718
- ".icons/**"
1819

1920
jobs:
@@ -34,7 +35,7 @@ jobs:
3435
workload_identity_provider: projects/309789351055/locations/global/workloadIdentityPools/github-actions/providers/github
3536
service_account: [email protected]
3637
- name: Set up Google Cloud SDK
37-
uses: google-github-actions/setup-gcloud@6a7c903a70c8625ed6700fa299f5ddb4ca6022e9
38+
uses: google-github-actions/setup-gcloud@cb1e50a9932213ecece00a606661ae9ca44f3397
3839
- name: Deploy to dev.registry.coder.com
3940
run: gcloud builds triggers run 29818181-126d-4f8a-a937-f228b27d3d34 --branch main
4041
- name: Deploy to registry.coder.com

CONTRIBUTING.md

Lines changed: 18 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ The Coder Registry is a collection of Terraform modules and templates for Coder
2424

2525
### Install Dependencies
2626

27-
Install Bun:
27+
Install Bun (for formatting and scripts):
2828

2929
```bash
3030
curl -fsSL https://bun.sh/install | bash
@@ -89,7 +89,7 @@ Create `registry/[your-username]/README.md`:
8989
---
9090
display_name: "Your Name"
9191
bio: "Brief description of who you are and what you do"
92-
avatar_url: "./.images/avatar.png"
92+
avatar: "./.images/avatar.png"
9393
github: "your-username"
9494
linkedin: "https://www.linkedin.com/in/your-username" # Optional
9595
website: "https://yourwebsite.com" # Optional
@@ -102,7 +102,7 @@ status: "community"
102102
Brief description of who you are and what you do.
103103
```
104104

105-
> **Note**: The `avatar_url` must point to `./.images/avatar.png` or `./.images/avatar.svg`.
105+
> **Note**: The `avatar` must point to `./.images/avatar.png` or `./.images/avatar.svg`.
106106
107107
### 2. Generate Module Files
108108

@@ -124,19 +124,23 @@ This script generates:
124124
- Accurate description and usage examples
125125
- Correct icon path (usually `../../../../.icons/your-icon.svg`)
126126
- Proper tags that describe your module
127-
3. **Create `main.test.ts`** to test your module
127+
3. **Create at least one `.tftest.hcl`** to test your module with `terraform test`
128128
4. **Add any scripts** or additional files your module needs
129129

130130
### 4. Test and Submit
131131

132132
```bash
133-
# Test your module
134-
bun test -t 'module-name'
133+
# Test your module (from the module directory)
134+
terraform init -upgrade
135+
terraform test -verbose
136+
137+
# Or run all tests in the repo
138+
./scripts/terraform_test_all.sh
135139

136140
# Format code
137-
bun fmt
141+
bun run fmt
138142

139-
# Commit and create PR
143+
# Commit and create PR (do not push to main directly)
140144
git add .
141145
git commit -m "Add [module-name] module"
142146
git push origin your-branch
@@ -335,11 +339,12 @@ coder templates push test-[template-name] -d .
335339
### 2. Test Your Changes
336340

337341
```bash
338-
# Test a specific module
339-
bun test -t 'module-name'
342+
# Test a specific module (from the module directory)
343+
terraform init -upgrade
344+
terraform test -verbose
340345

341346
# Test all modules
342-
bun test
347+
./scripts/terraform_test_all.sh
343348
```
344349

345350
### 3. Maintain Backward Compatibility
@@ -388,7 +393,7 @@ Example: `https://github.com/coder/registry/compare/main...your-branch?template=
388393
### Every Module Must Have
389394

390395
- `main.tf` - Terraform code
391-
- `main.test.ts` - Working tests
396+
- One or more `.tftest.hcl` files - Working tests with `terraform test`
392397
- `README.md` - Documentation with frontmatter
393398

394399
### Every Template Must Have
@@ -488,6 +493,6 @@ When reporting bugs, include:
488493
2. **No tests** or broken tests
489494
3. **Hardcoded values** instead of variables
490495
4. **Breaking changes** without defaults
491-
5. **Not running** `bun fmt` before submitting
496+
5. **Not running** formatting (`bun run fmt`) and tests (`terraform test`) before submitting
492497

493498
Happy contributing! 🚀

MAINTAINER.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,9 @@ sudo apt install golang-go
1818

1919
Check that PRs have:
2020

21-
- [ ] All required files (`main.tf`, `main.test.ts`, `README.md`)
21+
- [ ] All required files (`main.tf`, `README.md`, at least one `.tftest.hcl`)
2222
- [ ] Proper frontmatter in README
23-
- [ ] Working tests (`bun test`)
23+
- [ ] Working tests (`terraform test`)
2424
- [ ] Formatted code (`bun run fmt`)
2525
- [ ] Avatar image for new namespaces (`avatar.png` or `avatar.svg` in `.images/`)
2626

@@ -127,7 +127,7 @@ tags: ["tag1", "tag2"]
127127
```yaml
128128
display_name: "Your Name"
129129
bio: "Brief description of who you are and what you do"
130-
avatar_url: "./.images/avatar.png"
130+
avatar: "./.images/avatar.png"
131131
github: "username"
132132
linkedin: "https://www.linkedin.com/in/username" # Optional
133133
website: "https://yourwebsite.com" # Optional
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
run "plan_with_required_vars" {
2+
command = plan
3+
4+
variables {
5+
agent_id = "example-agent-id"
6+
}
7+
}
8+
9+
run "app_url_uses_port" {
10+
command = plan
11+
12+
variables {
13+
agent_id = "example-agent-id"
14+
port = 19999
15+
}
16+
17+
assert {
18+
condition = resource.coder_app.MODULE_NAME.url == "http://localhost:19999"
19+
error_message = "Expected MODULE_NAME app URL to include configured port"
20+
}
21+
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
"fmt": "bun x prettier --write **/*.sh **/*.ts **/*.md *.md && terraform fmt -recursive -diff",
55
"fmt:ci": "bun x prettier --check **/*.sh **/*.ts **/*.md *.md && terraform fmt -check -recursive -diff",
66
"terraform-validate": "./scripts/terraform_validate.sh",
7-
"test": "bun test",
7+
"test": "./scripts/terraform_test_all.sh",
88
"update-version": "./update-version.sh"
99
},
1010
"devDependencies": {

registry/anomaly/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
display_name: "Jay Kumar"
33
bio: "I'm a Software Engineer :)"
4-
avatar_url: "./.images/avatar.png"
4+
avatar: "./.images/avatar.jpeg"
55
github: "35C4n0r"
66
linkedin: "https://www.linkedin.com/in/jaykum4r"
77
support_email: "[email protected]"
Lines changed: 100 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,41 @@
11
---
22
display_name: Gemini CLI
3+
description: Run Gemini CLI in your workspace for AI pair programming
34
icon: ../../../../.icons/gemini.svg
4-
description: Run Gemini CLI in your workspace with AgentAPI integration
55
verified: true
66
tags: [agent, gemini, ai, google, tasks]
77
---
88

99
# Gemini CLI
1010

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.
1212

1313
```tf
1414
module "gemini" {
15-
source = "registry.coder.com/coder-labs/gemini/coder"
16-
version = "1.0.0"
17-
agent_id = coder_agent.example.id
18-
gemini_api_key = var.gemini_api_key
19-
gemini_model = "gemini-2.5-pro"
20-
install_gemini = true
21-
gemini_version = "latest"
22-
agentapi_version = "latest"
15+
source = "registry.coder.com/coder-labs/gemini/coder"
16+
version = "1.1.0"
17+
agent_id = coder_agent.example.id
18+
folder = "/home/coder/project"
2319
}
2420
```
2521

22+
## Features
23+
24+
- **Interactive AI Assistance**: Run Gemini CLI directly in your terminal for coding help
25+
- **Automated Task Execution**: Execute coding tasks automatically via AgentAPI integration
26+
- **Multiple AI Models**: Support for Gemini 2.5 Pro, Flash, and other Google AI models
27+
- **API Key Integration**: Seamless authentication with Gemini API
28+
- **MCP Server Integration**: Built-in Coder MCP server for task reporting
29+
- **Persistent Sessions**: Maintain context across workspace sessions
30+
2631
## Prerequisites
2732

28-
- You must add the [Coder Login](https://registry.coder.com/modules/coder-login/coder) module to your template
2933
- Node.js and npm will be installed automatically if not present
34+
- The [Coder Login](https://registry.coder.com/modules/coder/coder-login) module is required
3035

31-
## Usage Example
36+
## Examples
3237

33-
- Example 1:
38+
### Basic setup
3439

3540
```tf
3641
variable "gemini_api_key" {
@@ -40,39 +45,97 @@ variable "gemini_api_key" {
4045
}
4146
4247
module "gemini" {
43-
count = data.coder_workspace.me.start_count
44-
source = "registry.coder.com/coder-labs/gemini/coder"
45-
version = "1.0.0"
46-
agent_id = coder_agent.example.id
47-
gemini_api_key = var.gemini_api_key # we recommend providing this parameter inorder to have a smoother experience (i.e. no google sign-in)
48-
gemini_model = "gemini-2.5-flash"
49-
install_gemini = true
50-
gemini_version = "latest"
51-
gemini_instruction_prompt = "Start every response with `Gemini says:`"
48+
source = "registry.coder.com/coder-labs/gemini/coder"
49+
version = "1.1.0"
50+
agent_id = coder_agent.example.id
51+
gemini_api_key = var.gemini_api_key
52+
folder = "/home/coder/project"
5253
}
5354
```
5455

55-
## How it Works
56+
This basic setup will:
57+
58+
- Install Gemini CLI in the workspace
59+
- Configure authentication with your API key
60+
- Set Gemini to run in `/home/coder/project` directory
61+
- Enable interactive use from the terminal
62+
- Set up MCP server integration for task reporting
63+
64+
### Automated task execution (Experimental)
65+
66+
> This functionality is in early access and is still evolving.
67+
> For now, we recommend testing it in a demo or staging environment,
68+
> rather than deploying to production
69+
>
70+
> Learn more in [the Coder documentation](https://coder.com/docs/ai-coder)
71+
72+
```tf
73+
variable "gemini_api_key" {
74+
type = string
75+
description = "Gemini API key"
76+
sensitive = true
77+
}
78+
79+
module "coder-login" {
80+
count = data.coder_workspace.me.start_count
81+
source = "registry.coder.com/coder/coder-login/coder"
82+
version = "~> 1.0"
83+
agent_id = coder_agent.example.id
84+
}
5685
57-
- **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"
91+
mutable = true
92+
}
93+
94+
module "gemini" {
95+
count = data.coder_workspace.me.start_count
96+
source = "registry.coder.com/coder-labs/gemini/coder"
97+
version = "1.1.0"
98+
agent_id = coder_agent.example.id
99+
gemini_api_key = var.gemini_api_key
100+
gemini_model = "gemini-2.5-flash"
101+
folder = "/home/coder/project"
102+
task_prompt = data.coder_parameter.ai_prompt.value
103+
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:
117+
118+
```tf
119+
module "gemini" {
120+
source = "registry.coder.com/coder-labs/gemini/coder"
121+
version = "1.1.0"
122+
agent_id = coder_agent.example.id
123+
gemini_api_key = var.gemini_api_key
124+
folder = "/home/coder/project"
125+
use_vertexai = true
126+
}
127+
```
61128

62129
## Troubleshooting
63130

64-
- 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
68134

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.
73136

74137
## References
75138

76-
- [Gemini CLI Documentation](https://ai.google.dev/gemini-api/docs/cli)
139+
- [Gemini CLI Documentation](https://github.com/google-gemini/gemini-cli/blob/main/docs/index.md)
77140
- [AgentAPI Documentation](https://github.com/coder/agentapi)
78-
- [Coder AI Agents Guide](https://coder.com/docs/tutorials/ai-agents)
141+
- [Coder AI Agents Guide](https://coder.com/docs/ai-coder)

0 commit comments

Comments
 (0)