# opencode **Repository Path**: beyond-prototype/opencode ## Basic Information - **Project Name**: opencode - **Description**: No description available - **Primary Language**: Unknown - **License**: Not specified - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-13 - **Last Updated**: 2026-03-23 ## Categories & Tags **Categories**: Uncategorized **Tags**: None ## README ## OpenCode Setup ### 1. Clone this repo to your workspace ```sh mkdir ~/workplace cd ~/workplace && git clone https://gitee.com/beyond-prototype/opencode.git ``` ### 2. Update [Dockerfile](Dockerfile) to install tools required ```Dockerfile FROM ghcr.io/anomalyco/opencode RUN alpine_version=$(cat /etc/alpine-release | cut -d. -f1-2) && \ sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories && \ echo "https://mirrors.aliyun.com/alpine/v${alpine_version}/community" >> /etc/apk/repositories RUN apk update && \ apk add --no-cache git bash docker-cli openjdk21 nodejs npm jq curl postgresql-client maven && \ rm -rf /var/cache/apk/* RUN npm config set registry https://registry.npmmirror.com COPY setup.sh /usr/local/bin/setup.sh RUN chmod +x /usr/local/bin/setup.sh ENTRYPOINT ["/bin/sh", "-c", "setup.sh && /bin/sh"] ``` ### 3. Build your own opencode image ```sh docker build -t opencode-mine . ``` ### 4. Create alias for opencode.sh ```sh chmod +x ~/workplace/opencode/opencode.sh echo "alias opencode=~/workplace/opencode/opencode.sh" >> ~/.zprofile source ~/.zprofile ``` ### 5. Opencode Configuration Create a `.env` for environment variables such as user credentials ```sh mkdir -p $HOME/.config/opencode touch $HOME/.config/opencode/.env ``` The `.env` will be used by opencode container using `--env-file "$HOME/.config/opencode/.env"` **Git Configuration** Configure your git credentials in the .env to be used the by opencode container ```sh cat > ${HOME}/.config/opencode/.env << EOF GIT_USER_NAME=xxx GIT_USER_EMAIL=xxx GIT_PASSWORD=xxx GIT_TOKEN=xxx EOF ``` opencode container will execute [setup.sh](setup.sh) to configure git crendential ```sh git config --global user.name "${GIT_USER_NAME}" git config --global user.email "${GIT_USER_EMAIL}" git config --global credential.helper 'store --file=/tmp/git-credentials' echo "https://${GIT_USER_NAME}:${GIT_TOKEN}@gitee.com" >> /tmp/git-credentials ``` Verify git config in opencode container ```sh /workspace # git config --show-origin --list file:/root/.gitconfig user.name=xxx file:/root/.gitconfig user.email=xxx file:/root/.gitconfig credential.helper=store --file=/tmp/git-credentials file:.git/config core.repositoryformatversion=0 file:.git/config core.filemode=true file:.git/config core.bare=false file:.git/config core.logallrefupdates=true file:.git/config core.ignorecase=true file:.git/config core.precomposeunicode=true file:.git/config remote.origin.url=https://gitee.com/beyond-prototype/opencode.git file:.git/config remote.origin.fetch=+refs/heads/*:refs/remotes/origin/* file:.git/config branch.master.remote=origin file:.git/config branch.master.merge=refs/heads/master file:.git/config branch.master.vscode-merge-base=origin/master ``` ### 5. Start opencode Use command `opencode` in any project root folder to start opencode ```sh opencode % opencode Container 'opencode-opencode' already exists. 1) Replace (remove and create new) 2) Start existing container (if stopped) 3) Remove existing container Choose option [1/2/3]: 1 Removing existing container: opencode-opencode Starting container: opencode-opencode Starting configuration ... Complete Configuration You can use command "opencode" to start opencode /workspace # opencode ``` ### 6. Use Ollama Local model Check ollama model such as qwen3:4b below ```sh % docker start ollama % docker exec -it ollama bash root@96469b53f1a0:/# ollama pull qwen3:4b root@96469b53f1a0:/# ollama list NAME ID SIZE MODIFIED qwen3:4b 359d7dd4bcda 2.5 GB 21 seconds ago ``` Create `opencode.json` if it does not exist ```sh touch ${HOME}/.config/opencode/opencode.json ``` Add `ollama` as a provider and `qwen3:4b` as one of models ```json { "$schema": "https://opencode.ai/config.json", "provider": { "ollama": { "npm": "@ai-sdk/openai-compatible", "name": "Ollama (Local)", "options": { "baseURL": "http://localhost:11434/v1" }, "models": { "qwen3:4b": { "name": "qwen3:4b (Local)" } } } } } ``` Replace existing container by creating a new one ```sh opencode % opencode Container 'opencode-opencode' already exists. 1) Replace (remove and create new) 2) Start existing container (if stopped) 3) Remove existing container Choose option [1/2/3]: 1 Removing existing container: opencode-opencode Starting container: opencode-opencode Starting configuration ... Complete Configuration You can use command "opencode" to start opencode /workspace # opencode models ollama/qwen3:4b /workspace # opencode --model ollama/qwen3:4b ``` ### 7. Install Oh-my-opencode plugin - Open your terminal and start OpenCode by typing opencode. - Switch to Build Mode (you may need to select a capable model like MiniMax). - Copy and paste the following prompt to the AI: >> Install and configure oh-my-opencode by following the instructions here: https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/refs/heads/master/docs/guide/installation.md - The AI agent will read the official guide and execute the installation steps for you, prompting you for your subscription details as needed . ```log Installation complete! - OpenCode version: 1.2.27 - Plugin added: oh-my-opencode@3.7.4 in opencode.json - Config created: ~/.config/opencode/oh-my-opencode.json Note: Without Claude or other subscriptions, all agents are configured to use opencode/big-pickle as fallback. For optimal performance, consider subscribing to Claude Pro/Max. Run opencode to start! ``` **Restart opencode to use `Sisyphus (Ultraworker)`** After installation, check the Opencode config, you should see plugin oh-my-opencode ```sh open -a "Visual Studio Code" $HOME/.config/opencode/opencode.json ``` ```json { ... "plugin": [ "oh-my-opencode@3.7.4" ] } ``` Check the Oh-my-opencode config ```sh open -a "Visual Studio Code" $HOME/.config/opencode/oh-my-opencode.json ``` ```json { "$schema": "https://raw.githubusercontent.com/code-yeongyu/oh-my-opencode/master/assets/oh-my-opencode.schema.json", "agents": { "hephaestus": { "model": "opencode/big-pickle" }, "oracle": { "model": "opencode/big-pickle" }, "librarian": { "model": "opencode/big-pickle" }, "explore": { "model": "opencode/big-pickle" }, "multimodal-looker": { "model": "opencode/big-pickle" }, "prometheus": { "model": "opencode/big-pickle" }, "metis": { "model": "opencode/big-pickle" }, "momus": { "model": "opencode/big-pickle" }, "atlas": { "model": "opencode/big-pickle" } }, "categories": { "visual-engineering": { "model": "opencode/big-pickle" }, "ultrabrain": { "model": "opencode/big-pickle" }, "deep": { "model": "opencode/big-pickle" }, "artistry": { "model": "opencode/big-pickle" }, "quick": { "model": "opencode/big-pickle" }, "unspecified-low": { "model": "opencode/big-pickle" }, "unspecified-high": { "model": "opencode/big-pickle" }, "writing": { "model": "opencode/big-pickle" } } } ``` ## Opencode Commands ```sh / # opencode -v 1.1.64 / # opencode debug paths home /root data /root/.local/share/opencode bin /root/.local/share/opencode/bin log /root/.local/share/opencode/log cache /root/.cache/opencode config /root/.config/opencode state /root/.local/state/opencode ```