~kris/dots

srice

srice/.local/bin/blog-ai-review -rw-r--r-- 693 bytes
e98f3b03 — Kris Yotam chore: sync local state after restore (push updates, no pull) a month 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