Files
supermarket/update.sh
davidandClaude Opus 5.5 81a7d0596c 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>
2026-11-20 14:58:06 -07:00

44 lines
1.3 KiB
Bash
Executable File

#!/bin/bash
#
# Purpose : Keep Supermarket current (run by CoreDesktop's `update` after it
# pulls this repository, and by install.sh). Doesn't prompt.
set -e
SELF="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
# shellcheck source=lib.sh
source "$SELF/lib.sh"
if ! command -v docker > /dev/null || ! docker info > /dev/null 2>&1; then
echo "Supermarket: Docker isn't running, or you can't use it yet; skipping."
echo " Start it with: sudo systemctl start docker (and log out and in once if you were just added to the docker group)."
exit 1
fi
write_compose_env
copy_core_conf
write_ai_servers
sync_hermes_ai
# The `supermarket` command
mkdir -p "$HOME/.local/bin"
if [ -f "$COREDESKTOP/utils.sh" ]; then
# shellcheck source=/dev/null
source "$COREDESKTOP/utils.sh"
install_script "$SELF/bin/supermarket" "$HOME/.local/bin/supermarket"
else
install -m 755 "$SELF/bin/supermarket" "$HOME/.local/bin/supermarket"
fi
echo "Supermarket $(version): building and starting its container..."
compose up -d --build --remove-orphans --quiet-pull
# Drop the image the rebuild replaced.
docker image prune -f --filter label=org.opencontainers.image.title=supermarket > /dev/null
if wait_until_up 60; then
echo "Supermarket is running at $URL"
else
echo "Supermarket didn't start; see: supermarket logs"
exit 1
fi