ai-rebase.sh 765 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/bash
  2. set -e
  3. VERSION=1.0
  4. echo "AI-Rebase v$VERSION"
  5. # Check for required Git configuration files
  6. if [ ! -f "$HOME/.gitconfig" ]; then
  7. >&2 echo "Error: Git configuration file not found at $HOME/.gitconfig"
  8. exit 1
  9. fi
  10. if [ ! -f "$HOME/.git-credentials" ]; then
  11. >&2 echo "Error: Git credentials file not found at $HOME/.git-credentials"
  12. exit 1
  13. fi
  14. IFS='/' read -r part1 part2 <<<"$1"
  15. echo git fetch $part1 $part2
  16. git fetch $part1 $part2
  17. docker run --rm -it \
  18. -v "$(pwd):/repo" \
  19. -v "$HOME/.gitconfig:/home/appuser/.gitconfig:ro" \
  20. -v "$HOME/.git-credentials:/home/appuser/.git-credentials:ro" \
  21. -e GEMINI_API_KEY="$GEMINI_API_KEY" \
  22. -e GEMINI_MODEL="${GEMINI_MODEL:-gemini-2.0-flash}" \
  23. -u "$(id -u):$(id -g)" \
  24. "senomas/git-rebase:$VERSION" "$@"