Add optional oh-my-opencode-slim multi-agent orchestration support
Integrate oh-my-opencode-slim as an opt-in feature via INSTALL_OMOS build arg. A single build arg installs Bun, tmux, and the plugin; runtime activation is controlled by ENABLE_OMOS and related env vars in the entrypoint.
This commit is contained in:
@@ -68,5 +68,54 @@ EOF
|
||||
esac
|
||||
fi
|
||||
|
||||
# ── oh-my-opencode-slim setup (multi-agent orchestration) ────────────
|
||||
# Activated by ENABLE_OMOS=true. Requires the image to be built with
|
||||
# INSTALL_OMOS=true (which installs bun + the oh-my-opencode-slim package).
|
||||
OMOS_CONFIG="$CONFIG_DIR/oh-my-opencode-slim.json"
|
||||
|
||||
if [ "${ENABLE_OMOS:-false}" = "true" ]; then
|
||||
if ! command -v bunx &>/dev/null; then
|
||||
echo "WARNING: ENABLE_OMOS=true but bun is not installed."
|
||||
echo "Rebuild with: docker compose build --build-arg INSTALL_OMOS=true"
|
||||
elif [ ! -f "$OMOS_CONFIG" ]; then
|
||||
echo "Setting up oh-my-opencode-slim agents..."
|
||||
|
||||
# Determine installer flags
|
||||
OMOS_TMUX_FLAG="no"
|
||||
if [ "${OMOS_TMUX:-false}" = "true" ]; then
|
||||
OMOS_TMUX_FLAG="yes"
|
||||
fi
|
||||
|
||||
OMOS_SKILLS_FLAG="yes"
|
||||
if [ "${OMOS_SKILLS:-true}" = "false" ]; then
|
||||
OMOS_SKILLS_FLAG="no"
|
||||
fi
|
||||
|
||||
bunx oh-my-opencode-slim@latest install \
|
||||
--no-tui \
|
||||
--tmux="${OMOS_TMUX_FLAG}" \
|
||||
--skills="${OMOS_SKILLS_FLAG}"
|
||||
|
||||
echo "oh-my-opencode-slim configured successfully."
|
||||
else
|
||||
echo "oh-my-opencode-slim config found at $OMOS_CONFIG (use OMOS_RESET=true to overwrite)."
|
||||
|
||||
# Allow reset via env var (creates backup automatically)
|
||||
if [ "${OMOS_RESET:-false}" = "true" ]; then
|
||||
echo "OMOS_RESET=true — regenerating oh-my-opencode-slim config..."
|
||||
OMOS_TMUX_FLAG="no"
|
||||
[ "${OMOS_TMUX:-false}" = "true" ] && OMOS_TMUX_FLAG="yes"
|
||||
OMOS_SKILLS_FLAG="yes"
|
||||
[ "${OMOS_SKILLS:-true}" = "false" ] && OMOS_SKILLS_FLAG="no"
|
||||
|
||||
bunx oh-my-opencode-slim@latest install \
|
||||
--no-tui \
|
||||
--tmux="${OMOS_TMUX_FLAG}" \
|
||||
--skills="${OMOS_SKILLS_FLAG}" \
|
||||
--reset
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
# ── Execute command ──────────────────────────────────────────────────
|
||||
exec "$@"
|
||||
|
||||
Reference in New Issue
Block a user