#!/bin/bash # omarchy:summary=Seed Hermes literally and resume the resulting interactive session # omarchy:args= # omarchy:hidden=true set -euo pipefail prompt=${1:?usage: omarchy-agent-hermes } usage=$(mktemp) trap 'rm -f "$usage"' EXIT # TUI startup queries pass through Hermes' slash, shell, and interpolation # dispatcher. One-shot treats the prompt literally and records its session ID. seed_session() { hermes --yolo --usage-file "$usage" --oneshot="$prompt" } if ! seed_session; then if jq -e '.failed == true and (.failure | strings | startswith("No inference provider configured."))' "$usage" >/dev/null 2>&1; then hermes setup seed_session else exit 1 fi fi session_id=$(jq -er 'select(.completed == true and .failed != true) | .session_id | strings | select(length > 0)' "$usage") rm -f "$usage" trap - EXIT exec hermes chat --yolo --tui --resume "$session_id"