-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·60 lines (52 loc) · 1.7 KB
/
Copy pathinstall.sh
File metadata and controls
executable file
·60 lines (52 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
#!/usr/bin/env bash
# install.sh — register redink as a Claude Code plugin
#
# Usage:
# ./install.sh # symlink into ~/.claude/plugins (user scope)
# ./install.sh --project # use as a project-local plugin (no symlink)
#
# Requires: Claude Code 2.1+
set -euo pipefail
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
PLUGIN_NAME="redink"
SCOPE="user"
for arg in "$@"; do
case "$arg" in
--project) SCOPE="project" ;;
--user) SCOPE="user" ;;
-h|--help)
grep -E '^# ' "$0" | sed 's/^# //'
exit 0
;;
*)
echo "Unknown flag: $arg" >&2
exit 1
;;
esac
done
if [ "$SCOPE" = "project" ]; then
echo "[install] Using project scope — no symlink needed."
echo "[install] Open Claude Code from this directory; it will pick up .claude/ automatically."
exit 0
fi
PLUGIN_DIR="$HOME/.claude/plugins/$PLUGIN_NAME"
mkdir -p "$HOME/.claude/plugins"
if [ -e "$PLUGIN_DIR" ] && [ ! -L "$PLUGIN_DIR" ]; then
echo "[install] ERROR: $PLUGIN_DIR exists and is not a symlink. Refusing to overwrite." >&2
echo "[install] Move or remove it first, then re-run." >&2
exit 1
fi
if [ -L "$PLUGIN_DIR" ]; then
echo "[install] Removing existing symlink: $PLUGIN_DIR"
rm "$PLUGIN_DIR"
fi
ln -s "$REPO_DIR" "$PLUGIN_DIR"
echo "[install] Linked: $PLUGIN_DIR -> $REPO_DIR"
echo
echo "[install] Python deps (for assembler + recipe picker):"
echo " pip install python-docx pyyaml"
echo
echo "[install] Done."
echo " Claude Code users: open Claude Code anywhere, then /redink-recipe and /redink-build"
echo " Codex / Cursor / Gemini / Aider / Kimi users: see AGENTS.md, use python3 scripts/recipe.py + assemble_docx.py"
echo " (To uninstall: rm $PLUGIN_DIR)"