Sign inSign up

0xspica/opencode-oh-my-openagent

By 0xspica

•Updated 3 months ago

Auto-updating the OpenCode Web image, with oh-my-openagent installed and integrated automatically.

Image
0

10K+

0xspica/opencode-oh-my-openagent repository overview

⁠opencode-oh-my-openagent

opencode-oh-my-openagent is a Docker image for running OpenCode Web. Fetch the latest OpenCode and Oh My OpenAgent at any time, and have them plugin integrated automatically.

On every container start/restart, it can automatically:

  • install/update the latest OpenCode
  • install/update the latest Oh My OpenAgent
  • auto-assemble integration by ensuring the oh-my-openagent plugin is present in OpenCode config

This gives you a reproducible, persistent, and low-maintenance runtime.


⁠Key Features

  • Auto-update on restart
    • OpenCode update/install at startup (OPENCODE_AUTO_UPDATE=true)
    • Oh My OpenAgent update/install at startup (OMO_AUTO_INSTALL=true)
  • Automatic assembly
    • Initializes config if missing
    • Ensures plugin registration (oh-my-openagent) in opencode.json
  • Persistent data
    • The config, data, state, and cache directories, along with the OpenCode binary, are volume-mounted.
  • Headless-friendly bootstrap
    • Non-interactive install args by default, suitable for server environments

⁠Startup Workflow

At container startup (entrypoint.sh), the image:

  1. Creates required OpenCode directories
  2. Installs/Updates OpenCode
  3. Creates opencode.json if it does not exist
  4. Installs/updates oh-my-openagent (or force reinstalls if enabled)
  5. Injects plugin entry (oh-my-openagent) into config if missing
  6. Starts OpenCode Web with configured host/port and optional flags

⁠Configuration

⁠Environment Variables
VariableDefaultDescriptionExample
OPENCODE_AUTO_UPDATEtrueAuto install/update OpenCode on startup.true
OMO_AUTO_INSTALLtrueAuto install/update Oh My OpenAgent on startup.true
OMO_FORCE_REINSTALLfalseForce reinstall Oh My OpenAgent on every startup.false
OMO_INSTALL_ARGS--no-tui --claude=no --openai=no --gemini=no --copilot=no --opencode-zen=no --zai-coding-plan=no --opencode-go=no --kimi-for-coding=no --vercel-ai-gateway=no --skip-authInstaller arguments passed to bunx oh-my-opencode@latest install.--no-tui --skip-auth
OPENCODE_HOSTNAME0.0.0.0Host address for opencode web.0.0.0.0
OPENCODE_PORT4096Port for opencode web and container mapping.4096
OPENCODE_MDNSfalseEnable mDNS announcement (--mdns).true
OPENCODE_MDNS_DOMAIN(empty)Custom mDNS domain (--mdns-domain).local
OPENCODE_CORS(empty)Comma-separated CORS origins; converted to multiple --cors flags.https://a.com,https://b.com
OPENCODE_LOG_LEVEL(empty)Set runtime log level (--log-level).info
OPENCODE_PRINT_LOGSfalsePrint logs to stdout (--print-logs).true
OPENCODE_SERVER_USERNAME(empty)Optional server auth username (if supported by runtime/env wiring).admin
OPENCODE_SERVER_PASSWORD(empty)Optional server auth password (if supported by runtime/env wiring).strong-password
⁠Persistent Volumes
  • ./opencode-config → /root/.config/opencode
  • ./opencode-data → /root/.local/share/opencode
  • ./omo → /root/.omo

Options:

  • ./opencode-state → /root/.local/state/opencode
  • ./opencode-cache → /root/.cache/opencode
  • ./opencode-bin → /root/.opencode/bin
  • ./workspace → /workspace

⁠Binary Persistent

/root/.opencode/bin is where the binary files are stored. When this directory is persisted, the behavior depends on environment OPENCODE_AUTO_UPDATE:

  • If OPENCODE_AUTO_UPDATE is true: it automatically checks for the latest opencode version, and updates if your local version differs.
  • If OPENCODE_AUTO_UPDATE is false: it does not check versions, does not download opencode, and always uses the local version. You can remain on a specific version and manually import the binary.

If this directory is NOT persisted, the container will download the opencode binary every time it starts.

⁠Oh My OpenAgent Configuration

Oh My OpenAgent uses OpenCode Zen’s free GPT-5-Nano model by default. The model ID is: opencode/gpt-5-nano.

The configuration file for Oh My OpenAgent is located at:

./omo/omo.jsonc

Inside the container, the path is:

/root/omo/omo.jsonc

⁠Quick Start (Docker Compose)

services:
  opencode-oh-my-openagent:
    image: 0xspica/opencode-oh-my-openagent
    container_name: opencode-oh-my-openagent
    restart: unless-stopped
    ports:
      - "4096:4096"
    environment:
      OPENCODE_AUTO_UPDATE: "true"
      OMO_AUTO_INSTALL: "true"
      OMO_FORCE_REINSTALL: "false"
    volumes:
      - ./opencode-config:/root/.config/opencode
      - ./opencode-data:/root/.local/share/opencode
      - ./omo:/root/.omo
      - ./workspace:/workspace

Tag summary

Content type

Image

Digest

sha256:9fb58581c…

Size

120.6 MB

Last updated

3 months ago

docker pull 0xspica/opencode-oh-my-openagent