Skip to content

Commit 1aae1c7

Browse files
nagyvjayair
authored andcommitted
Add gitlab-opencode to GitLab docs
The current GitLab page describes OpenCode integration through GitLab Duo. GitLab Duo is a paying functionality and is limited to workflows supported by GitLab. GitLab-OpenCode is a community project that offers more flexiblity, better customization and easier setup to use OpenCode in GitLab. On the downside, it does not have the level of integration into GitLab as Duo does.
1 parent 526c723 commit 1aae1c7

File tree

1 file changed

+43
-3
lines changed

1 file changed

+43
-3
lines changed

packages/web/src/content/docs/gitlab.mdx

Lines changed: 43 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,52 @@ title: GitLab
33
description: Use OpenCode in GitLab issues and merge requests.
44
---
55

6+
## Integration options
7+
8+
There are at least two approaches to run OpenCode in GitLab:
9+
10+
- Run it in GitLab pipelines as a regular pipeline
11+
- Run it through GitLab Duo
12+
13+
In both cases, OpenCode will run on your GitLab runners.
14+
15+
## GitLab CI integration
16+
17+
OpenCode works in a regular GitLab pipeline. You build it into a pipeline as a [CI component](https://docs.gitlab.com/ee/ci/components/)
18+
19+
---
20+
21+
### Features
22+
23+
- **Use custom configuration per job**: Configure OpenCode with a [custom configuration directory](./config/#custom-directory) to enable/disable functionality per OpenCode invocation.
24+
- **Minimal setup**: The CI component sets up OpenCode in the background, you only need to create the OpenCode configuration and the initial prompt.
25+
- **Flexible**: The CI component supports several inputs for customizing its behavior
26+
27+
### Setup
28+
29+
1. Store your OpenCode authentication JSON as a File type CI environment variables under **Settings -> CI/CD -> Variables**. Tip: Mark it "Masked and hidden".
30+
2. Add code blocks like the following to your `.gitlab-ci.yml` file:
31+
32+
```
33+
include:
34+
- component: $CI_SERVER_FQDN/nagyv/gitlab-opencode/[email protected]
35+
inputs:
36+
config_dir: ${CI_PROJECT_DIR}/opencode-config
37+
auth_json: $OPENCODE_AUTH_JSON # The variable name for your OpenCode authentication JSON
38+
command: optional-custom-command
39+
message: "Your prompt here"
40+
```
41+
42+
See more inputs and use cases in [its documentation](https://gitlab.com/explore/catalog/nagyv/gitlab-opencode).
43+
44+
## GitLab Duo integration
45+
646
OpenCode integrates with your GitLab workflow.
747
Mention `@opencode` in a comment, and OpenCode will execute tasks within your GitLab CI pipeline.
848

949
---
1050

11-
## Features
51+
### Features
1252

1353
- **Triage issues**: Ask OpenCode to look into an issue and explain it to you.
1454
- **Fix and implement**: Ask OpenCode to fix an issue or implement a feature.
@@ -17,7 +57,7 @@ Mention `@opencode` in a comment, and OpenCode will execute tasks within your Gi
1757

1858
---
1959

20-
## Setup
60+
### Setup
2161

2262
OpenCode runs in your GitLab CI/CD pipeline, here's what you'll need to set it up:
2363

@@ -113,7 +153,7 @@ You can refer to the [GitLab CLI agents docs](https://docs.gitlab.com/user/duo_a
113153
114154
---
115155
116-
## Examples
156+
### Examples
117157
118158
Here are some examples of how you can use OpenCode in GitLab.
119159

0 commit comments

Comments
 (0)