docs: sync

This commit is contained in:
Dax Raad
2025-07-31 19:50:51 -04:00
parent 0bbd7ea17b
commit 33d613a470
3 changed files with 27 additions and 31 deletions

View File

@@ -230,6 +230,12 @@ You can also define agents using markdown files in `~/.config/opencode/agent/` o
You can disable providers that are loaded automatically through the `disabled_providers` option. This is useful when you want to prevent certain providers from being loaded even if their credentials are available. You can disable providers that are loaded automatically through the `disabled_providers` option. This is useful when you want to prevent certain providers from being loaded even if their credentials are available.
---
### Formatters
You can configure code formatters through the `formatter` option. See [Formatters documentation](/docs/formatters) for more details.
```json title="opencode.json" ```json title="opencode.json"
{ {
"$schema": "https://opencode.ai/config.json", "$schema": "https://opencode.ai/config.json",

View File

@@ -18,6 +18,7 @@ Let's get started.
To use opencode, you'll need: To use opencode, you'll need:
1. A modern terminal emulator like: 1. A modern terminal emulator like:
- [WezTerm](https://wezterm.org), cross-platform - [WezTerm](https://wezterm.org), cross-platform
- [Alacritty](https://alacritty.org), cross-platform - [Alacritty](https://alacritty.org), cross-platform
- [Ghostty](https://ghostty.org), Linux and macOS - [Ghostty](https://ghostty.org), Linux and macOS
@@ -40,26 +41,10 @@ You can also install it with the following:
- **Using Node.js** - **Using Node.js**
<Tabs> <Tabs>
<TabItem label="npm"> <TabItem label="npm">```bash npm install -g opencode-ai ```</TabItem>
```bash <TabItem label="Bun">```bash bun install -g opencode-ai ```</TabItem>
npm install -g opencode-ai <TabItem label="pnpm">```bash pnpm install -g opencode-ai ```</TabItem>
``` <TabItem label="Yarn">```bash yarn global add opencode-ai ```</TabItem>
</TabItem>
<TabItem label="Bun">
```bash
bun install -g opencode-ai
```
</TabItem>
<TabItem label="pnpm">
```bash
pnpm install -g opencode-ai
```
</TabItem>
<TabItem label="Yarn">
```bash
yarn global add opencode-ai
```
</TabItem>
</Tabs> </Tabs>
- **Using Homebrew on macOS** - **Using Homebrew on macOS**
@@ -138,7 +123,7 @@ You should commit your project's `AGENTS.md` file to Git.
::: :::
This helps opencode understand the project structure and the coding patterns This helps opencode understand the project structure and the coding patterns
used. used.
--- ---
@@ -178,22 +163,22 @@ You can ask opencode to add new features to your project. Though we first recomm
instead suggest _how_ it'll implement the feature. instead suggest _how_ it'll implement the feature.
Switch to it using the **Tab** key. You'll see an indicator for this in the lower right corner. Switch to it using the **Tab** key. You'll see an indicator for this in the lower right corner.
```bash frame="none" title="Switch to Plan mode" ```bash frame="none" title="Switch to Plan mode"
<TAB> <TAB>
``` ```
Now let's describe what we want it to do. Now let's describe what we want it to do.
```txt frame="none" ```txt frame="none"
When a user deletes a note, we'd like to flag it as deleted in the database. When a user deletes a note, we'd like to flag it as deleted in the database.
Then create a screen that shows all the recently deleted notes. Then create a screen that shows all the recently deleted notes.
From this screen, the user can undelete a note or permanently delete it. From this screen, the user can undelete a note or permanently delete it.
``` ```
You want to give opencode enough details to understand what you want. It helps You want to give opencode enough details to understand what you want. It helps
to talk to it like you are talking to a junior developer on your team. to talk to it like you are talking to a junior developer on your team.
:::tip :::tip
Give opencode plenty of context and examples to help it understand what you Give opencode plenty of context and examples to help it understand what you
want. want.
@@ -202,7 +187,7 @@ You can ask opencode to add new features to your project. Though we first recomm
2. **Iterate on the plan** 2. **Iterate on the plan**
Once it gives you a plan, you can give it feedback or add more details. Once it gives you a plan, you can give it feedback or add more details.
```txt frame="none" ```txt frame="none"
We'd like to design this new screen using a design I've used before. We'd like to design this new screen using a design I've used before.
[Image #1] Take a look at this image and use it as a reference. [Image #1] Take a look at this image and use it as a reference.
@@ -216,16 +201,16 @@ You can ask opencode to add new features to your project. Though we first recomm
do this by dragging and dropping an image into the terminal. do this by dragging and dropping an image into the terminal.
3. **Build the feature** 3. **Build the feature**
Once you feel comfortable with the plan, switch back to _Build mode_ by Once you feel comfortable with the plan, switch back to _Build mode_ by
hitting the **Tab** key again. hitting the **Tab** key again.
```bash frame="none" ```bash frame="none"
<TAB> <TAB>
``` ```
And asking it to make the changes. And asking it to make the changes.
```bash frame="none" ```bash frame="none"
Sounds good! Go ahead and make the changes. Sounds good! Go ahead and make the changes.
``` ```
@@ -271,4 +256,4 @@ Here's an [example conversation](https://opencode.ai/s/4XP1fce5) with opencode.
And that's it! You are now a pro at using opencode. And that's it! You are now a pro at using opencode.
To make it your own, we recommend [picking a theme](/docs/themes), [customizing the keybinds](/docs/keybinds), or playing around with the [opencode config](/docs/config). To make it your own, we recommend [picking a theme](/docs/themes), [customizing the keybinds](/docs/keybinds), [configuring code formatters](/docs/formatters), or playing around with the [opencode config](/docs/config).

View File

@@ -46,6 +46,8 @@ This mode is useful when you want the AI to analyze code, suggest changes, or cr
You can switch between modes during a session using the _Tab_ key. Or your configured `switch_mode` keybind. You can switch between modes during a session using the _Tab_ key. Or your configured `switch_mode` keybind.
See also: [Formatters](/docs/formatters) for information about code formatting configuration.
--- ---
## Configure ## Configure
@@ -99,6 +101,7 @@ tools:
--- ---
You are in code review mode. Focus on: You are in code review mode. Focus on:
- Code quality and best practices - Code quality and best practices
- Potential bugs and edge cases - Potential bugs and edge cases
- Performance implications - Performance implications
@@ -281,6 +284,7 @@ tools:
You are in debug mode. Your primary goal is to help investigate and diagnose issues. You are in debug mode. Your primary goal is to help investigate and diagnose issues.
Focus on: Focus on:
- Understanding the problem through careful analysis - Understanding the problem through careful analysis
- Using bash commands to inspect system state - Using bash commands to inspect system state
- Reading relevant files and logs - Reading relevant files and logs
@@ -304,6 +308,7 @@ tools:
You are in refactoring mode. Focus on improving code quality without changing functionality. You are in refactoring mode. Focus on improving code quality without changing functionality.
Priorities: Priorities:
- Improve code readability and maintainability - Improve code readability and maintainability
- Apply consistent naming conventions - Apply consistent naming conventions
- Reduce code duplication - Reduce code duplication