Merge branch 'dev' into black-page-transitions-design-updates
This commit is contained in:
parent
2cb1c4cd6d
commit
6b63ea98d8
112 changed files with 6269 additions and 654 deletions
|
|
@ -57,12 +57,13 @@ Or you can set it up manually.
|
|||
permissions:
|
||||
id-token: write
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
fetch-depth: 1
|
||||
persist-credentials: false
|
||||
|
||||
- name: Run OpenCode
|
||||
- name: Run OpenCode
|
||||
uses: anomalyco/opencode/github@latest
|
||||
env:
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
|
|
@ -135,6 +136,8 @@ jobs:
|
|||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- name: Run OpenCode
|
||||
uses: anomalyco/opencode/github@latest
|
||||
|
|
@ -172,6 +175,8 @@ jobs:
|
|||
issues: read
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
with:
|
||||
persist-credentials: false
|
||||
- uses: anomalyco/opencode/github@latest
|
||||
env:
|
||||
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
||||
|
|
@ -223,6 +228,8 @@ jobs:
|
|||
|
||||
- uses: actions/checkout@v6
|
||||
if: steps.check.outputs.result == 'true'
|
||||
with:
|
||||
persist-credentials: false
|
||||
|
||||
- uses: anomalyco/opencode/github@latest
|
||||
if: steps.check.outputs.result == 'true'
|
||||
|
|
|
|||
|
|
@ -34,7 +34,7 @@ Build is the **default** mode with all tools enabled. This is the standard mode
|
|||
A restricted mode designed for planning and analysis. In plan mode, the following tools are disabled by default:
|
||||
|
||||
- `write` - Cannot create new files
|
||||
- `edit` - Cannot modify existing files
|
||||
- `edit` - Cannot modify existing files, except for files located at `.opencode/plans/*.md` to detail the plan itself
|
||||
- `patch` - Cannot apply patches
|
||||
- `bash` - Cannot execute shell commands
|
||||
|
||||
|
|
|
|||
|
|
@ -95,6 +95,33 @@ Don't see a provider here? Submit a PR.
|
|||
|
||||
---
|
||||
|
||||
### 302.AI
|
||||
|
||||
1. Head over to the [302.AI console](https://302.ai/), create an account, and generate an API key.
|
||||
|
||||
2. Run the `/connect` command and search for **302.AI**.
|
||||
|
||||
```txt
|
||||
/connect
|
||||
```
|
||||
|
||||
3. Enter your 302.AI API key.
|
||||
|
||||
```txt
|
||||
┌ API key
|
||||
│
|
||||
│
|
||||
└ enter
|
||||
```
|
||||
|
||||
4. Run the `/models` command to select a model.
|
||||
|
||||
```txt
|
||||
/models
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
### Amazon Bedrock
|
||||
|
||||
To use Amazon Bedrock with OpenCode:
|
||||
|
|
@ -557,6 +584,99 @@ Cloudflare AI Gateway lets you access models from OpenAI, Anthropic, Workers AI,
|
|||
|
||||
---
|
||||
|
||||
### GitLab Duo
|
||||
|
||||
GitLab Duo provides AI-powered agentic chat with native tool calling capabilities through GitLab's Anthropic proxy.
|
||||
|
||||
1. Run the `/connect` command and select GitLab.
|
||||
|
||||
```txt
|
||||
/connect
|
||||
```
|
||||
|
||||
2. Choose your authentication method:
|
||||
|
||||
```txt
|
||||
┌ Select auth method
|
||||
│
|
||||
│ OAuth (Recommended)
|
||||
│ Personal Access Token
|
||||
└
|
||||
```
|
||||
|
||||
#### Using OAuth (Recommended)
|
||||
|
||||
Select **OAuth** and your browser will open for authorization.
|
||||
|
||||
#### Using Personal Access Token
|
||||
1. Go to [GitLab User Settings > Access Tokens](https://gitlab.com/-/user_settings/personal_access_tokens)
|
||||
2. Click **Add new token**
|
||||
3. Name: `OpenCode`, Scopes: `api`
|
||||
4. Copy the token (starts with `glpat-`)
|
||||
5. Enter it in the terminal
|
||||
|
||||
3. Run the `/models` command to see available models.
|
||||
|
||||
```txt
|
||||
/models
|
||||
```
|
||||
|
||||
Three Claude-based models are available:
|
||||
- **duo-chat-haiku-4-5** (Default) - Fast responses for quick tasks
|
||||
- **duo-chat-sonnet-4-5** - Balanced performance for most workflows
|
||||
- **duo-chat-opus-4-5** - Most capable for complex analysis
|
||||
|
||||
##### Self-Hosted GitLab
|
||||
|
||||
For self-hosted GitLab instances:
|
||||
|
||||
```bash
|
||||
GITLAB_INSTANCE_URL=https://gitlab.company.com GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx opencode
|
||||
```
|
||||
|
||||
Or add to your bash profile:
|
||||
|
||||
```bash title="~/.bash_profile"
|
||||
export GITLAB_INSTANCE_URL=https://gitlab.company.com
|
||||
export GITLAB_TOKEN=glpat-xxxxxxxxxxxxxxxxxxxx
|
||||
```
|
||||
|
||||
##### Configuration
|
||||
|
||||
Customize through `opencode.json`:
|
||||
|
||||
```json title="opencode.json"
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"provider": {
|
||||
"gitlab": {
|
||||
"options": {
|
||||
"instanceUrl": "https://gitlab.com",
|
||||
"featureFlags": {
|
||||
"duo_agent_platform_agentic_chat": true,
|
||||
"duo_agent_platform": true
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
##### GitLab API Tools (Optional)
|
||||
|
||||
To access GitLab tools (merge requests, issues, pipelines, CI/CD, etc.):
|
||||
|
||||
```json title="opencode.json"
|
||||
{
|
||||
"$schema": "https://opencode.ai/config.json",
|
||||
"plugin": ["@gitlab/opencode-gitlab-plugin"]
|
||||
}
|
||||
```
|
||||
|
||||
This plugin provides comprehensive GitLab repository management capabilities including MR reviews, issue tracking, pipeline monitoring, and more.
|
||||
|
||||
---
|
||||
|
||||
### GitHub Copilot
|
||||
|
||||
To use your GitHub Copilot subscription with opencode:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,7 @@ title: Rules
|
|||
description: Set custom instructions for opencode.
|
||||
---
|
||||
|
||||
You can provide custom instructions to opencode by creating an `AGENTS.md` file. This is similar to `CLAUDE.md` or Cursor's rules. It contains instructions that will be included in the LLM's context to customize its behavior for your specific project.
|
||||
You can provide custom instructions to opencode by creating an `AGENTS.md` file. This is similar to Cursor's rules. It contains instructions that will be included in the LLM's context to customize its behavior for your specific project.
|
||||
|
||||
---
|
||||
|
||||
|
|
@ -58,7 +58,7 @@ opencode also supports reading the `AGENTS.md` file from multiple locations. And
|
|||
|
||||
### Project
|
||||
|
||||
The ones we have seen above, where the `AGENTS.md` is placed in the project root, are project-specific rules. These only apply when you are working in this directory or its sub-directories.
|
||||
Place an `AGENTS.md` in your project root for project-specific rules. These only apply when you are working in this directory or its sub-directories.
|
||||
|
||||
### Global
|
||||
|
||||
|
|
@ -66,16 +66,33 @@ You can also have global rules in a `~/.config/opencode/AGENTS.md` file. This ge
|
|||
|
||||
Since this isn't committed to Git or shared with your team, we recommend using this to specify any personal rules that the LLM should follow.
|
||||
|
||||
### Claude Code Compatibility
|
||||
|
||||
For users migrating from Claude Code, OpenCode supports Claude Code's file conventions as fallbacks:
|
||||
|
||||
- **Project rules**: `CLAUDE.md` in your project directory (used if no `AGENTS.md` exists)
|
||||
- **Global rules**: `~/.claude/CLAUDE.md` (used if no `~/.config/opencode/AGENTS.md` exists)
|
||||
- **Skills**: `~/.claude/skills/` — see [Agent Skills](/docs/skills/) for details
|
||||
|
||||
To disable Claude Code compatibility, set one of these environment variables:
|
||||
|
||||
```bash
|
||||
export OPENCODE_DISABLE_CLAUDE_CODE=1 # Disable all .claude support
|
||||
export OPENCODE_DISABLE_CLAUDE_CODE_PROMPT=1 # Disable only ~/.claude/CLAUDE.md
|
||||
export OPENCODE_DISABLE_CLAUDE_CODE_SKILLS=1 # Disable only .claude/skills
|
||||
```
|
||||
|
||||
---
|
||||
|
||||
## Precedence
|
||||
|
||||
So when opencode starts, it looks for:
|
||||
When opencode starts, it looks for rule files in this order:
|
||||
|
||||
1. **Local files** by traversing up from the current directory
|
||||
2. **Global file** by checking `~/.config/opencode/AGENTS.md`
|
||||
1. **Local files** by traversing up from the current directory (`AGENTS.md`, `CLAUDE.md`, or `CONTEXT.md`)
|
||||
2. **Global file** at `~/.config/opencode/AGENTS.md`
|
||||
3. **Claude Code file** at `~/.claude/CLAUDE.md` (unless disabled)
|
||||
|
||||
If you have both global and project-specific rules, opencode will combine them together.
|
||||
The first matching file wins in each category. For example, if you have both `AGENTS.md` and `CLAUDE.md`, only `AGENTS.md` is used. Similarly, `~/.config/opencode/AGENTS.md` takes precedence over `~/.claude/CLAUDE.md`.
|
||||
|
||||
---
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue