Initial commit
This commit is contained in:
77
install.sh
Normal file
77
install.sh
Normal file
@@ -0,0 +1,77 @@
|
||||
#!/usr/bin/env bash
|
||||
# Klaus installer — installs the Klaus skill for Claude Code and/or the Codex prompt.
|
||||
#
|
||||
# Usage:
|
||||
# curl -fsSL https://git.epod.dev/erhan/klaus/raw/branch/main/install.sh | bash
|
||||
# curl -fsSL https://git.epod.dev/erhan/klaus/raw/branch/main/install.sh | bash -s -- --claude-only
|
||||
# curl -fsSL https://git.epod.dev/erhan/klaus/raw/branch/main/install.sh | bash -s -- --codex-only
|
||||
|
||||
set -euo pipefail
|
||||
|
||||
# Defaults: install both.
|
||||
INSTALL_CLAUDE=1
|
||||
INSTALL_CODEX=1
|
||||
|
||||
for arg in "$@"; do
|
||||
case "$arg" in
|
||||
--claude-only) INSTALL_CODEX=0 ;;
|
||||
--codex-only) INSTALL_CLAUDE=0 ;;
|
||||
-h|--help)
|
||||
cat <<'EOF'
|
||||
Klaus installer
|
||||
|
||||
Options:
|
||||
--claude-only Install only the Claude Code skill
|
||||
--codex-only Install only the Codex prompt
|
||||
-h, --help Show this help
|
||||
|
||||
Without flags, installs for both.
|
||||
EOF
|
||||
exit 0
|
||||
;;
|
||||
*)
|
||||
echo "Unknown argument: $arg" >&2
|
||||
exit 1
|
||||
;;
|
||||
esac
|
||||
done
|
||||
|
||||
# Source. Override with KLAUS_RAW_BASE for forks / mirrors.
|
||||
RAW_BASE="${KLAUS_RAW_BASE:-https://git.epod.dev/erhan/klaus/raw/branch/main}"
|
||||
|
||||
fetch() {
|
||||
local url="$1"
|
||||
local dest="$2"
|
||||
mkdir -p "$(dirname "$dest")"
|
||||
if command -v curl >/dev/null 2>&1; then
|
||||
curl -fsSL "$url" -o "$dest"
|
||||
elif command -v wget >/dev/null 2>&1; then
|
||||
wget -q "$url" -O "$dest"
|
||||
else
|
||||
echo "Need curl or wget to install." >&2
|
||||
exit 1
|
||||
fi
|
||||
}
|
||||
|
||||
if [[ "$INSTALL_CLAUDE" -eq 1 ]]; then
|
||||
CLAUDE_DIR="$HOME/.claude/skills/klaus"
|
||||
echo "Installing Claude Code skill -> $CLAUDE_DIR/SKILL.md"
|
||||
fetch "$RAW_BASE/SKILL.md" "$CLAUDE_DIR/SKILL.md"
|
||||
fi
|
||||
|
||||
if [[ "$INSTALL_CODEX" -eq 1 ]]; then
|
||||
CODEX_DIR="$HOME/.codex/prompts"
|
||||
echo "Installing Codex prompt -> $CODEX_DIR/klaus.md"
|
||||
fetch "$RAW_BASE/codex/klaus.md" "$CODEX_DIR/klaus.md"
|
||||
fi
|
||||
|
||||
cat <<'EOF'
|
||||
|
||||
Done.
|
||||
|
||||
Claude Code: restart your session once so the new skill is picked up,
|
||||
then address Klaus by name — "klaus, write tests for this method".
|
||||
Codex: type /klaus in a session.
|
||||
|
||||
Klaus does not say hello. Klaus has work.
|
||||
EOF
|
||||
Reference in New Issue
Block a user