Files

23 lines
691 B
Bash

#!/bin/sh
set -eu
: "${HERMES_HOME:=/home/hermes/.hermes}"
: "${CODEX_HOME:=/home/hermes/.codex}"
: "${CLAUDE_CONFIG_DIR:=/home/hermes/.claude}"
: "${GEMINI_CONFIG_DIR:=/home/hermes/.gemini}"
: "${HERMES_EXE:=/opt/hermes-agent/venv/bin/hermes}"
: "${HERMES_DEFAULT_CONFIG:=/opt/hermes-agent/cli-config.yaml.example}"
mkdir -p "$HERMES_HOME" "$CODEX_HOME" "$CLAUDE_CONFIG_DIR" "$GEMINI_CONFIG_DIR"
if [ ! -x "$HERMES_EXE" ]; then
echo "startup failed: baked Hermes executable is missing or not executable: $HERMES_EXE" >&2
exit 1
fi
if [ ! -f "$HERMES_HOME/config.yaml" ] && [ -f "$HERMES_DEFAULT_CONFIG" ]; then
cp "$HERMES_DEFAULT_CONFIG" "$HERMES_HOME/config.yaml"
fi
exec "$@"