AI Code With

Open Code

Windows

1. Install OpenCode

In PowerShell run:

Install OpenCode (Windows)
1npm i -g opencode-ai
image

After the installation is complete,close and reopen PowerShelland then verify the installation:

verify-opencode-windows.ps1
1opencode --version
image

Script execution policy issue

If you encounter the error "Running scripts is disabled on this system":

  1. As administrator run PowerShell
  2. Execute:Set-ExecutionPolicy Unrestricted
  3. Enter Y and confirm, then retry the installation command

2. Create a configuration file

First run the opencode command once; this will create the configuration folder.

image

Then create opencode.json under ~/.config/opencode with the following content

Create configuration
1{
2 "$schema": "https://opencode.ai/config.json",
3 "mcp": {},
4 "plugin": [
5 "oh-my-opencode",
6 "opencode-aicodewith-auth"
7 ]
8}

3. Enter authentication information

Enter the following command in PowerShell to start the authentication process:

bash
1opencode auth login
image

4. Verify the installation

Reopen PowerShell or your IDE and run:

run-opencode-windows.ps1
1opencode

Then enter /models . If the providers are displayed correctly, the configuration is successful.

image

Enter in the dialog box:Hello!If you receive a normal reply and can see the call record on the AICodeWith platform, the configuration is successful.

MacOS/Linux

1. Install OpenCode

In the terminal run:

Install OpenCode (macOS)
1npm i -g opencode-ai

Enter the following command in the terminal to verify the installation:

verify-opencode-macos.sh
1opencode --version
image

2. Create a configuration file

First run the opencode command once; this will create the configuration folder.

Then create opencode.json under ~/.config/opencode with the following contents

Create configuration
1{
2 "$schema": "https://opencode.ai/config.json",
3 "mcp": {},
4 "plugin": [
5 "oh-my-opencode",
6 "opencode-aicodewith-auth"
7 ]
8}

If you’ve used it before and already have your own configuration, you just need to add plugin to the list and fill in the name opencode-aicodewith-auth, and it’s recommended to add one more plugin, oh-my-opencode, which is also very useful.

image

3. Enter authentication information

Enter the following command in the terminal to start the authentication process:

bash
1opencode auth login
image

4. Verify the installation

Reopen the terminal or IDE and run:

run-opencode-macos.sh
1opencode

In the dialog box, enter:Hello!If you receive a normal reply and can see the call record on the AICodeWith platform, the configuration is successful.

image

How to use

opencode has three main agents that talk to us directly and handle the integration

They are respectively: Sisyphus (西西弗斯)

e628bb8424654083e3dfbeedb239d0bd
65219ade1fa2c634d8c011a7eb3ffc8b
f92e68ff586ea8b332c185df7c9c9691
62598932f9d9011d5cd7dc8f6e98a7c5
a0cb29bbb3064c2c7b76079291dd0ec1

Frequently Asked Questions

  1. BunInstallFailedError
image

This error occurs because the oh my opencode plugin needs to pull the models.dev part from a remote source, and if it can’t fetch it, it will throw this error.

The solution is to enable TUN mode. If TUN mode is already enabled, just toggle it off and on again.

On this page