~kris/dots

srice

ref: e9b48d06a8541f3eda5c4db90382ab3c77183afb srice/.local/bin/blog-ai-review -rwxr-xr-x 693 bytes
e9b48d06 — Kris Yotam xprofile: systemd-aware pipewire start + blueman-applet; sb-internet: tolerate missing /proc/net/wireless 2 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env sh
set -eu

prompt='You are a severe but fair editor. Review this blog draft. Return: unclear thesis, unsupported claims, missing citations, structure problems, title ideas, and concrete edits. Do not rewrite the whole piece.'

if [ "$#" -eq 0 ]; then
  input=$(cat)
else
  input=$(cat "$@")
fi

if command -v llm >/dev/null 2>&1; then
  printf '%s\n' "$input" | llm -s "$prompt"
elif command -v aichat >/dev/null 2>&1; then
  printf '%s\n' "$input" | aichat "$prompt"
elif command -v mods >/dev/null 2>&1; then
  printf '%s\n' "$input" | mods "$prompt"
else
  printf 'No llm, aichat, or mods command found. Draft word count:\n' >&2
  printf '%s\n' "$input" | wc -w
  exit 1
fi