summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorVladimir Glafirov <[email protected]>2026-01-19 16:51:27 +0100
committerGitHub <[email protected]>2026-01-19 09:51:27 -0600
commit29e206b6c6df09efd369218017c0da2569793899 (patch)
tree8006b5d6204984b5fb2ff4978632e7f51536cd4a
parent31864cadb49fb356e98ec56b1021ec469972e82c (diff)
downloadopencode-29e206b6c6df09efd369218017c0da2569793899.tar.gz
opencode-29e206b6c6df09efd369218017c0da2569793899.zip
docs: Improve Gitlab self-hosted instances documentation (#9391)
-rw-r--r--packages/web/src/content/docs/providers.mdx62
1 files changed, 59 insertions, 3 deletions
diff --git a/packages/web/src/content/docs/providers.mdx b/packages/web/src/content/docs/providers.mdx
index 6022d174a..2a7d2ffb4 100644
--- a/packages/web/src/content/docs/providers.mdx
+++ b/packages/web/src/content/docs/providers.mdx
@@ -654,21 +654,77 @@ GitLab Duo provides AI-powered agentic chat with native tool calling capabilitie
- **duo-chat-sonnet-4-5** - Balanced performance for most workflows
- **duo-chat-opus-4-5** - Most capable for complex analysis
+:::note
+You can also specify 'GITLAB_TOKEN' environment variable if you don't want
+to store token in opencode auth storage.
+:::
+
##### Self-Hosted GitLab
+:::note[compliance note]
+OpenCode uses a small model for some AI tasks like generating the session title.
+It is configured to use gpt-5-nano by default, hosted by Zen. To lock OpenCode
+to only use your own GitLab-hosted instance, add the following to your
+`opencode.json` file. It is also recommended to disable session sharing.
+
+```json
+{
+ "$schema": "https://opencode.ai/config.json",
+ "small_model": "gitlab/duo-chat-haiku-4-5",
+ "share": "disabled"
+}
+```
+
+:::
+
For self-hosted GitLab instances:
```bash
-GITLAB_INSTANCE_URL=https://gitlab.company.com GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx opencode
+export GITLAB_INSTANCE_URL=https://gitlab.company.com
+export GITLAB_TOKEN=glpat-...
+```
+
+If your instance runs a custom AI Gateway:
+
+```bash
+GITLAB_AI_GATEWAY_URL=https://ai-gateway.company.com
```
Or add to your bash profile:
```bash title="~/.bash_profile"
export GITLAB_INSTANCE_URL=https://gitlab.company.com
-export GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
+export GITLAB_AI_GATEWAY_URL=https://ai-gateway.company.com
+export GITLAB_TOKEN=glpat-...
```
+:::note
+Your GitLab administrator must enable the following:
+
+1. [Duo Agent Platform](https://docs.gitlab.com/user/gitlab_duo/turn_on_off/) for the user, group, or instance
+2. Feature flags (via Rails console):
+ - `agent_platform_claude_code`
+ - `third_party_agents_enabled`
+ :::
+
+##### OAuth for Self-Hosted instances
+
+In order to make Oauth working for your self-hosted instance, you need to create
+a new application (Settings → Applications) with the
+callback URL `http://127.0.0.1:8080/callback` and following scopes:
+
+- api (Access the API on your behalf)
+- read_user (Read your personal information)
+- read_repository (Allows read-only access to the repository)
+
+Then expose application ID as environment variable:
+
+```bash
+export GITLAB_OAUTH_CLIENT_ID=your_application_id_here
+```
+
+More documentation on [opencode-gitlab-auth](https://www.npmjs.com/package/@gitlab/opencode-gitlab-auth) homepage.
+
##### Configuration
Customize through `opencode.json`:
@@ -690,7 +746,7 @@ Customize through `opencode.json`:
}
```
-##### GitLab API Tools (Optional)
+##### GitLab API Tools (Optional, but highly recommended)
To access GitLab tools (merge requests, issues, pipelines, CI/CD, etc.):