mirror of
https://github.com/sst/opencode.git
synced 2025-08-22 14:04:07 +00:00
docs: gitlab
This commit is contained in:
parent
8b01676ec0
commit
256d074411
2 changed files with 96 additions and 70 deletions
|
@ -67,7 +67,14 @@ export default defineConfig({
|
|||
|
||||
{
|
||||
label: "Usage",
|
||||
items: ["docs/tui", "docs/cli", "docs/ide", "docs/share", "docs/github"],
|
||||
items: [
|
||||
"docs/tui",
|
||||
"docs/cli",
|
||||
"docs/ide",
|
||||
"docs/share",
|
||||
"docs/github",
|
||||
"docs/gitlab"
|
||||
],
|
||||
},
|
||||
|
||||
{
|
||||
|
|
|
@ -19,14 +19,25 @@ Mention `@opencode` in a comment, and opencode will execute tasks within your Gi
|
|||
|
||||
## Setup
|
||||
|
||||
Refer to the [GitLab CLI agents docs](https://docs.gitlab.com/user/duo_agent_platform/agent_assistant/)
|
||||
for detailed setup instructions.
|
||||
opencode runs in your GitLab CI/CD pipeline, here's what you'll need to set it up:
|
||||
|
||||
Here is an example of the agent configuration:
|
||||
:::tip
|
||||
Check out the [**GitLab docs**](https://docs.gitlab.com/user/duo_agent_platform/agent_assistant/) for up to date instructions.
|
||||
:::
|
||||
|
||||
```yaml
|
||||
image: node:22-slim
|
||||
commands:
|
||||
1. Configure your GitLab environment
|
||||
2. Set up CI/CD
|
||||
3. Get an AI model provider API key
|
||||
4. Create a service account
|
||||
5. Configure CI/CD variables
|
||||
6. Create a flow config file, here's an example:
|
||||
|
||||
<details>
|
||||
<summary>Flow configuration</summary>
|
||||
|
||||
```yaml
|
||||
image: node:22-slim
|
||||
commands:
|
||||
- echo "Installing opencode"
|
||||
- npm install --global opencode-ai
|
||||
- echo "Installing glab"
|
||||
|
@ -89,11 +100,15 @@ commands:
|
|||
else
|
||||
echo "No git changes detected, skipping push"
|
||||
fi
|
||||
variables:
|
||||
variables:
|
||||
- ANTHROPIC_API_KEY
|
||||
- GITLAB_TOKEN_OPENCODE
|
||||
- GITLAB_HOST
|
||||
```
|
||||
```
|
||||
|
||||
</details>
|
||||
|
||||
You can refer to the [GitLab CLI agents docs](https://docs.gitlab.com/user/duo_agent_platform/agent_assistant/) for detailed instructions.
|
||||
|
||||
---
|
||||
|
||||
|
@ -101,6 +116,10 @@ variables:
|
|||
|
||||
Here are some examples of how you can use opencode in GitLab.
|
||||
|
||||
:::tip
|
||||
You can configure to use a different trigger phrase than `@opencode`.
|
||||
:::
|
||||
|
||||
- **Explain an issue**
|
||||
|
||||
Add this comment in a GitLab issue.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue