New: watch your coding agents work, step by step, on a live board. Try the demo, no account

Show each Gemini CLI reply on the board

By Jake Marsh, who builds Taskhold. Updated 2026-10-26. Facts about other tools checked 2026-10-26. 2 min read.

Gemini CLI hooks run a command at points in the agent loop. An AfterAgent hook gets the agent's reply, and this script puts the start of it on the Taskhold task in progress, so the live board stays current between the agent's own progress reports.

Gemini CLI itself connects as on the Gemini CLI setup page. Codex and Cursor have their own versions: Codex notify, Cursor hooks.

Set it up

  1. Save your API key where the script can read it: mkdir -p ~/.config/taskhold && printf '%s' 'atd_sk_...' > ~/.config/taskhold/key && chmod 600 ~/.config/taskhold/key (or export TASKHOLD_API_KEY).
  2. Save the script below as ~/.gemini/hooks/taskhold.sh and make it executable.
  3. Register it in ~/.gemini/settings.json. The timeout is in milliseconds.
#!/bin/bash
# ~/.gemini/hooks/taskhold.sh: after each Gemini CLI turn, show its last words on the Taskhold task in progress.
# Needs curl and jq. Key from TASKHOLD_API_KEY or ~/.config/taskhold/key.
input=$(cat)
key=${TASKHOLD_API_KEY:-$(cat ~/.config/taskhold/key 2>/dev/null)}
base=${TASKHOLD_API_URL:-https://taskhold.com/api}
msg=$(printf '%s' "$input" | jq -r '.prompt_response // empty' 2>/dev/null | tr '\n' ' ' | sed 's/ *$//' | cut -c1-200)
if [ -n "$key" ] && [ -n "$msg" ]; then
  auth="Authorization: Bearer $key"
  id=$(curl -s --max-time 3 "$base/tasks/current" -H "$auth" | jq -r '.task.id // empty')
  [ -n "$id" ] && jq -n --arg m "$msg" '{message: $m}' | curl -s --max-time 3 -o /dev/null \
    "$base/tasks/$id/progress" -H "$auth" -H "Content-Type: application/json" \
    -H "X-Taskhold-Agent: Gemini CLI" -d @-
fi
echo '{}'  # Gemini CLI reads hook stdout as JSON
exit 0
{
  "hooks": {
    "AfterAgent": [
      {
        "matcher": "*",
        "hooks": [
          { "name": "taskhold", "type": "command", "command": "~/.gemini/hooks/taskhold.sh", "timeout": 5000 }
        ]
      }
    ]
  }
}

One limit to know

If you turn on Gemini CLI's environment variable redaction, variables with KEY in the name are stripped before hooks run, so TASKHOLD_API_KEY disappears. Keep the key in ~/.config/taskhold/key, or add TASKHOLD_API_KEY to the redaction allow list. Like any hook that writes to the task in progress, it may land on another agent's task when several run at once.

Share this page:XLinkedInBlueskyHacker News

See how far along your coding agents are.

$12/month or $120/year after the trial. Card up front. Cancel before day 7 and you pay nothing. Every agent you run is included.

Sources

Related

Updated 2026-10-26. Something wrong or out of date? Email hello@greatwork.company.