skills/sync.sh
Symbiont 1c7288edce Initial skills repo: cortex-server, symbiont
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-19 20:01:03 +00:00

38 lines
840 B
Bash
Executable File

#!/usr/bin/env bash
set -e
CORTEX_SKILLS="root@cortex.hydrascale.net:/data/skills/"
SSH_KEY="$HOME/.ssh/cortex"
# Auto-detect local skills dir
detect_skills_dir() {
for candidate in \
"$HOME/.claude/cowork/skills" \
"$HOME/Library/Application Support/Claude/skills" \
"$HOME/.config/claude/skills"; do
if [ -d "$candidate" ]; then
echo "$candidate"
return 0
fi
done
return 1
}
LOCAL_DIR="${1:-$(detect_skills_dir || echo '')}"
if [ -z "$LOCAL_DIR" ]; then
echo "ERROR: Could not auto-detect Cowork skills directory."
echo "Pass it explicitly: $0 /path/to/skills"
exit 1
fi
echo "Syncing skills from cortex → $LOCAL_DIR"
mkdir -p "$LOCAL_DIR"
rsync -av --exclude='sync.sh' \
-e "ssh -i $SSH_KEY" \
"$CORTEX_SKILLS" \
"$LOCAL_DIR/"
echo "Done. Restart Cowork to pick up new skills."