#!/bin/bash set -e # 1. Inject Git Credentials for seamless GitHub pushing if [ -n "$GITHUB_TOKEN" ] && [ -n "$GITHUB_USER" ]; then git config --global credential.helper store git config --global user.name "$GITHUB_USER" git config --global user.email "$GITHUB_USER@users.noreply.github.com" echo "https://${GITHUB_USER}:${GITHUB_TOKEN}@github.com" > ~/.git-credentials echo "Git credentials configured." fi # 2. Link OpenCode config to our persistent directory export XDG_CONFIG_HOME="/workspace/config" export OPENCODE_CONFIG_DIR="/workspace/config/opencode" mkdir -p $OPENCODE_CONFIG_DIR # 3. Start background config sync to HF Dataset if [ -n "$HF_TOKEN" ] && [ -n "$HF_DATASET_REPO" ]; then python /sync_config.py & fi # 4. Launch OpenChamber echo "Starting OpenChamber on port 7860..." PORT=7860 openchamber --host 0.0.0.0 --workspace /workspace/projects