Files
hermes-skills/ask-claude/scripts/ask_claude.sh

30 lines
947 B
Bash
Raw Normal View History

2026-07-02 13:49:45 -05:00
#!/usr/bin/env bash
# ask_claude.sh - Hermes-side wrapper for ask-claude skill
# Delegates to the deployed ask.sh on 10.0.0.28
# Source of truth: ~/claude/hermes_support/ask.sh + merge.py on 10.0.0.28
#
# Usage: ask_claude.sh "question" [session_id]
#
# This is a thin caller. The real logic lives in:
# ssh n8n@10.0.0.28 ~/claude/hermes_support/ask.sh --qfile <file> [--resume SID]
set -euo pipefail
Q=$1
SID=${2:-}
# Write question to temp file
QFILE=$(mktemp /tmp/ask-claude-q-XXXXXX.txt)
trap "rm -f $QFILE" EXIT
echo "$Q" > "$QFILE"
# Delegate to deployed ask.sh on 10.0.0.28
if [ -n "$SID" ]; then
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 n8n@10.0.0.28 \
"~/claude/hermes_support/ask.sh --resume $SID --qfile $QFILE"
else
ssh -i ~/.ssh/id_ed25519 -o StrictHostKeyChecking=accept-new -o ServerAliveInterval=30 n8n@10.0.0.28 \
"~/claude/hermes_support/ask.sh --qfile $QFILE"
fi