๐Ÿ”ง Where my dotfiles lives in harmony and peace, most of the time

๐Ÿ”ฅ Remove ai-gcm wrapper script

+1 -85
-84
scripts/ai-gcm
··· 1 - #!/usr/bin/env bash 2 - set -euo pipefail 3 - 4 - script_path="$(realpath -- "${BASH_SOURCE[0]}")" 5 - dotfiles_dir="$(cd -- "$(dirname -- "${script_path}")/.." && pwd)" 6 - prompt_file="${dotfiles_dir}/codex/prompts/commit.md" 7 - 8 - worker() { 9 - local session=$1 10 - local prompt_file=$2 11 - local repo_root=$3 12 - 13 - local head_before 14 - head_before="$(git rev-parse HEAD 2>/dev/null || true)" 15 - 16 - local codex_status 17 - if codex -a never exec -C "${repo_root}" - < "${prompt_file}"; then 18 - codex_status=0 19 - else 20 - codex_status=$? 21 - fi 22 - 23 - local head_after 24 - head_after="$(git rev-parse HEAD 2>/dev/null || true)" 25 - 26 - echo 27 - printf "Repo: %s\n" "${repo_root}" 28 - printf "Codex exit: %s\n" "${codex_status}" 29 - echo 30 - 31 - local new_commits=0 32 - local notify_body="Codex finished. No new commits." 33 - if [[ -n ${head_before} && -n ${head_after} && ${head_before} != "${head_after}" ]]; then 34 - new_commits=1 35 - notify_body="Commits ready. Review & push?" 36 - 37 - echo "New commits:" 38 - git --no-pager log --oneline --decorate "${head_before}..${head_after}" 39 - echo 40 - fi 41 - 42 - if command -v notify-send >/dev/null 2>&1; then 43 - notify-send "aigcm" "${notify_body}" || true 44 - fi 45 - 46 - if command -v uwsm >/dev/null 2>&1; then 47 - uwsm app -- alacritty --hold --working-directory "${repo_root}" --command tmux attach -t "${session}" >/dev/null 2>&1 & 48 - else 49 - alacritty --hold --working-directory "${repo_root}" --command tmux attach -t "${session}" >/dev/null 2>&1 & 50 - fi 51 - 52 - if ((new_commits)); then 53 - local confirm 54 - read -r -p "Commit messages OK? Press Enter to push (anything else to skip): " confirm 55 - if [[ -z ${confirm} ]]; then 56 - git push 57 - else 58 - echo "Skipping push." 59 - fi 60 - else 61 - echo "No new commits created." 62 - fi 63 - 64 - echo 65 - read -r -p "Press Enter to close... " _ 66 - } 67 - 68 - main() { 69 - if [[ ${1:-} == "--worker" ]]; then 70 - shift 71 - worker "$@" 72 - return 0 73 - fi 74 - 75 - local repo_root 76 - repo_root="$(git rev-parse --show-toplevel)" 77 - 78 - local session 79 - session="aigcm-$(date +%s)" 80 - tmux new-session -d -s "${session}" -c "${repo_root}" "${script_path}" --worker "${session}" "${prompt_file}" "${repo_root}" 81 - printf "Started %s (tmux). You will be prompted to push when Codex finishes.\n" "${session}" 82 - } 83 - 84 - main "$@"
+1 -1
terminal/zshrc
··· 66 66 67 67 # Functions 68 68 aigcm() { 69 - ai-gcm "$@" 69 + tmux new-session -d -s "aigcm-$(date +%s)" "codex exec - < $HOME/projects/dotfiles/codex/prompts/commit.md" 70 70 } 71 71 72 72 qgs() {