Skip to content

Instantly share code, notes, and snippets.

@scarf005
Created February 25, 2026 16:52
Show Gist options
  • Select an option

  • Save scarf005/92177ab62e3b4a9903c19fef59f1a973 to your computer and use it in GitHub Desktop.

Select an option

Save scarf005/92177ab62e3b4a9903c19fef59f1a973 to your computer and use it in GitHub Desktop.
when you hate oh-my-opencode style footer but still want to mark commit as AI generated
#!/usr/bin/env bash
set -euo pipefail
if [ "$#" -lt 1 ]; then
echo "usage: assisted-by <model-name>" >&2
exit 1
fi
model_raw="$(printf '%s' "$1" | sed -E "s/^[[:space:]]+//; s/[[:space:]]+$//; s/^(['\"])(.*)\\1$/\\2/")"
model="$(printf '%s' "$model_raw" | tr '[:upper:]' '[:lower:]')"
co_author=""
case "$model" in
gpt-*|o*|codex*|chatgpt*|openai/*)
co_author="chatgpt-codex-connector[bot] <199175422+chatgpt-codex-connector[bot]@users.noreply.github.com>"
;;
gemini*|google/gemini*)
co_author="gemini-code-assist[bot] <176961590+gemini-code-assist[bot]@users.noreply.github.com>"
;;
esac
if [[ -z "$co_author" && "$model" =~ ^claude-([0-9]+\.?[0-9]*)-(opus|sonnet|haiku)$ ]]; then
version="${BASH_REMATCH[1]}"
family="${BASH_REMATCH[2]}"
family_title="${family^}"
co_author="Claude ${family_title} ${version} <noreply@anthropic.com>"
fi
if [[ -z "$co_author" && "$model" =~ ^claude-(opus|sonnet|haiku)-([0-9]+)-([0-9]+)$ ]]; then
family="${BASH_REMATCH[1]}"
major="${BASH_REMATCH[2]}"
minor="${BASH_REMATCH[3]}"
family_title="${family^}"
co_author="Claude ${family_title} ${major}.${minor} <noreply@anthropic.com>"
fi
if [[ -z "$co_author" && "$model" =~ ^claude-(opus|sonnet|haiku)$ ]]; then
family="${BASH_REMATCH[1]}"
family_title="${family^}"
co_author="Claude ${family_title} <noreply@anthropic.com>"
fi
printf '%s\n' "Assisted-by: ${model_raw} on opencode"
if [ -n "$co_author" ]; then
printf '%s\n' "Co-authored-by: ${co_author}"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment