#!/bin/bash cd /workspace/projects case "$1" in clone) if [ -z "$2" ]; then echo "Usage: repo clone "; exit 1; fi git clone "$2" echo "Cloned into $(basename "$2" .git)" ;; save) MSG="${2:-Auto-save from OpenCode}" git add . git commit -m "$MSG" || echo "Nothing to commit." git push echo "Pushed to GitHub." ;; new) if [ -z "$2" ]; then echo "Usage: repo new "; exit 1; fi mkdir "$2" && cd "$2" git init echo "# $2" > README.md git add . && git commit -m "Initial commit" echo "Created local repo. Push to GitHub to deploy." ;; *) echo "Usage: repo [clone|save|new]" ;; esac