diff options
| author | Jay V <[email protected]> | 2025-12-22 17:45:42 -0500 |
|---|---|---|
| committer | opencode <[email protected]> | 2025-12-22 22:47:22 +0000 |
| commit | c9140c6babf6b7b4711f7bf5dd05331aabfe3d33 (patch) | |
| tree | d3468b0e24c84834b45e9600fe7e990bfc9b799e /packages | |
| parent | 38551bda38660c7e2ddbd25f960d48e2236ead19 (diff) | |
| download | opencode-c9140c6babf6b7b4711f7bf5dd05331aabfe3d33.tar.gz opencode-c9140c6babf6b7b4711f7bf5dd05331aabfe3d33.zip | |
docs: edit gitlab
Diffstat (limited to 'packages')
| -rw-r--r-- | packages/web/src/content/docs/gitlab.mdx | 45 |
1 files changed, 24 insertions, 21 deletions
diff --git a/packages/web/src/content/docs/gitlab.mdx b/packages/web/src/content/docs/gitlab.mdx index 3810ba318..bc8edac80 100644 --- a/packages/web/src/content/docs/gitlab.mdx +++ b/packages/web/src/content/docs/gitlab.mdx @@ -3,45 +3,48 @@ title: GitLab description: Use OpenCode in GitLab issues and merge requests. --- -## Integration options +OpenCode integrates with your GitLab workflow through your GitLab CI/CD pipeline or with GitLab Duo. -There are at least two approaches to run OpenCode in GitLab: +In both cases, OpenCode will run on your GitLab runners. -- Run it in GitLab pipelines as a regular pipeline -- Run it through GitLab Duo +--- -In both cases, OpenCode will run on your GitLab runners. +## GitLab CI -## GitLab CI integration +OpenCode works in a regular GitLab pipeline. You can build it into a pipeline as a [CI component](https://docs.gitlab.com/ee/ci/components/) -OpenCode works in a regular GitLab pipeline. You build it into a pipeline as a [CI component](https://docs.gitlab.com/ee/ci/components/) +Here we are using a community-created CI/CD component for OpenCode — [nagyv/gitlab-opencode](https://gitlab.com/nagyv/gitlab-opencode). --- ### Features -- **Use custom configuration per job**: Configure OpenCode with a [custom configuration directory](./config/#custom-directory) to enable/disable functionality per OpenCode invocation. +- **Use custom configuration per job**: Configure OpenCode with a custom configuration directory, for example `./config/#custom-directory` to enable or disable functionality per OpenCode invocation. - **Minimal setup**: The CI component sets up OpenCode in the background, you only need to create the OpenCode configuration and the initial prompt. - **Flexible**: The CI component supports several inputs for customizing its behavior +--- + ### Setup -1. Store your OpenCode authentication JSON as a File type CI environment variables under **Settings -> CI/CD -> Variables**. Tip: Mark it "Masked and hidden". -2. Add code blocks like the following to your `.gitlab-ci.yml` file: +1. Store your OpenCode authentication JSON as a File type CI environment variables under **Settings** > **CI/CD** > **Variables**. Make sure to mark them as "Masked and hidden". +2. Add the following to your `.gitlab-ci.yml` file. + + ```yaml title=".gitlab-ci.yml" + include: + - component: $CI_SERVER_FQDN/nagyv/gitlab-opencode/[email protected] + inputs: + config_dir: ${CI_PROJECT_DIR}/opencode-config + auth_json: $OPENCODE_AUTH_JSON # The variable name for your OpenCode authentication JSON + command: optional-custom-command + message: "Your prompt here" + ``` -``` -include: - - component: $CI_SERVER_FQDN/nagyv/gitlab-opencode/[email protected] - inputs: - config_dir: ${CI_PROJECT_DIR}/opencode-config - auth_json: $OPENCODE_AUTH_JSON # The variable name for your OpenCode authentication JSON - command: optional-custom-command - message: "Your prompt here" -``` +For more inputs and use cases [check out the docs](https://gitlab.com/explore/catalog/nagyv/gitlab-opencode) for this component. -See more inputs and use cases in [its documentation](https://gitlab.com/explore/catalog/nagyv/gitlab-opencode). +--- -## GitLab Duo integration +## GitLab Duo OpenCode integrates with your GitLab workflow. Mention `@opencode` in a comment, and OpenCode will execute tasks within your GitLab CI pipeline. |
