Files
claude-his-agent/bin/claude-his-fetch
T
marfrit a144f57e1b v0.2.0: split — public framework only, runbook fetched from private host
The agent and skill prose used to ship inside this package, which exposed
home-infra topology (hosts, IPs, AINs, container layout, /opt/herding cred
paths) to anyone with the public package URL.

This release moves to a fetcher model:
- Public package ships only the plumbing: claude-his-fetch + claude-his-install.
- Runbook content lives on a private host at $HIS_CONTEXT_HOST:/opt/his-context/.
- claude-his-fetch (rsync over SSH) populates ~/.cache/claude-his-agent/.
- claude-his-install symlinks ~/.claude/agents/his.md + ~/.claude/skills/his
  into the cache.

History rewritten — the previous tree contained sensitive operational details.
A bundle of the pre-rewrite tree is preserved out-of-band by the maintainer.
2026-05-02 11:23:34 +00:00

32 lines
1.3 KiB
Bash
Executable File

#!/usr/bin/env bash
# claude-his-fetch — pull current His context from a private host over SSH.
# The public package ships zero infrastructure context; the runbook lives on a
# host you control and is fetched into a per-user cache that ~/.claude/ symlinks
# to. Re-run periodically (cron, or on demand) to refresh.
set -euo pipefail
HOST="${HIS_CONTEXT_HOST:-hertz}"
SRC="${HIS_CONTEXT_PATH:-/opt/his-context/}"
CACHE="${HIS_CONTEXT_CACHE:-${HOME}/.cache/claude-his-agent}"
mkdir -p "${CACHE}"
echo "claude-his-fetch: ${HOST}:${SRC} -> ${CACHE}"
if ! command -v rsync >/dev/null 2>&1; then
echo "claude-his-fetch: rsync not found; install rsync (apt/pacman) and retry" >&2
exit 3
fi
# Reuses the user's existing SSH credentials; trust boundary is whatever
# already authorises the user on $HIS_CONTEXT_HOST.
rsync -a --delete -e ssh "${HOST}:${SRC}" "${CACHE}/"
# Sanity — these are the two files ~/.claude symlinks expect to exist.
test -r "${CACHE}/agent.md" || { echo "fetch failed: missing agent.md" >&2; exit 2; }
test -r "${CACHE}/skill/SKILL.md" || { echo "fetch failed: missing skill/SKILL.md" >&2; exit 2; }
agent_bytes=$(wc -c <"${CACHE}/agent.md")
skill_bytes=$(wc -c <"${CACHE}/skill/SKILL.md")
echo "claude-his-fetch: OK (${agent_bytes}B agent, ${skill_bytes}B skill)"