Let Supermarket use Hermes' Anthropic key and model

Hermes is already set up with an Anthropic key, so AI needn't be set up
twice. `supermarket hermes` asks once, then it and update.sh copy just
the key and model to hermes-ai.json in the data folder (0600). The app
uses them when it has no key of its own, re-reading the file on each use.

Generation still calls the model directly rather than through Hermes'
API: post writing feeds it text from the web, which must not reach an
agent with a terminal, a browser and write access to the CRM.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-20 14:58:06 -07:00
co-authored by Claude Opus 5.5
parent 434a9093b0
commit 81a7d0596c
10 changed files with 175 additions and 5 deletions
+15
View File
@@ -203,6 +203,21 @@ if ! "${HERMES[@]}" config get mcp_servers.supermarket.args 2> /dev/null | grep
echo "Warning: $HERMES_CONFIG doesn't point Hermes at $MCP_SOCKET as expected; check its mcp_servers section."
fi
# --- Sharing Hermes' AI key with Supermarket ---
if [ -n "$(hermes_ai_key)" ] && [ "$(hermes_config model.provider)" = anthropic ]; then
if [ ! -f "$HERMES_AI_CHOICE" ] || [ "${1:-}" = "--reconfigure" ]; then
echo
echo "Hermes uses an Anthropic key and $(hermes_config model.default)."
echo "Supermarket can use them too (it calls the model directly, without Hermes' tools)."
if confirm_yes "Use Hermes' Anthropic key and model for Supermarket?"; then
echo yes > "$HERMES_AI_CHOICE"
else
echo no > "$HERMES_AI_CHOICE"
fi
fi
sync_hermes_ai -v
fi
# --- Hermes' sandbox ---
need=()
for host in $hub_host; do