-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·108 lines (94 loc) · 2.95 KB
/
install.sh
File metadata and controls
executable file
·108 lines (94 loc) · 2.95 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
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
#!/usr/bin/env bash
set -euo pipefail
# Forge installer — auto-detects platform and installs SKILL.md to the right place
# Usage: curl -fsSL https://raw.githubusercontent.com/miles990/forge/main/install.sh | bash
REPO="miles990/forge"
SKILL_URL="https://raw.githubusercontent.com/$REPO/main/skills/forge/SKILL.md"
SKILL_CONTENT=""
fetch_skill() {
SKILL_CONTENT=$(curl -fsSL "$SKILL_URL")
if [ -z "$SKILL_CONTENT" ]; then
echo "Error: Failed to download SKILL.md"
exit 1
fi
}
install_to() {
local dir="$1"
local file="$2"
mkdir -p "$dir"
echo "$SKILL_CONTENT" > "$dir/$file"
echo " Installed: $dir/$file"
}
detect_and_install() {
local installed=0
# Claude Code — requires official plugin commands, not file copy
if command -v claude &>/dev/null; then
echo "[claude-code] Detected."
if claude --help 2>&1 | grep -q "plugin"; then
echo " Plugin system available. Installing..."
claude plugin marketplace add "$REPO" 2>/dev/null || true
if claude plugin install forge 2>/dev/null; then
echo " Installed via claude plugin install"
echo " Use: /forge path/to/plan.md"
else
echo " Auto-install failed. Run manually:"
echo " claude plugin marketplace add $REPO"
echo " claude plugin install forge"
fi
else
echo " Plugin commands not available in this Claude Code version."
echo " Install manually when available:"
echo " claude plugin marketplace add $REPO"
echo " claude plugin install forge"
fi
installed=1
fi
# OpenClaw
if [ -d "$HOME/.openclaw" ]; then
install_to "$HOME/.openclaw/custom_skills" "forge.md"
echo " Use: Tell your agent to 'use the forge skill to execute plan.md'"
installed=1
fi
# Cursor (only if current project uses Cursor)
if [ -d ".cursor" ]; then
install_to ".cursor/rules" "forge.md"
echo " Use: 'Follow the forge workflow in .cursor/rules/forge.md to execute plan.md'"
installed=1
fi
# Windsurf
if [ -d ".windsurfrules" ]; then
install_to ".windsurfrules" "forge.md"
echo " Use: 'Follow the forge workflow to execute plan.md'"
installed=1
fi
# Continue.dev
if [ -d ".continue" ]; then
install_to ".continue/rules" "forge.md"
echo " Use: 'Follow the forge workflow to execute plan.md'"
installed=1
fi
# Aider — just download, user includes manually
if command -v aider &>/dev/null; then
install_to "." "forge.md"
echo " Use: aider --read forge.md"
installed=1
fi
# Fallback: install to current project
if [ "$installed" -eq 0 ]; then
install_to "." "forge.md"
echo " Include this file in your LLM's context to use Forge."
fi
}
main() {
echo "Forge installer"
echo "==============="
echo ""
echo "Downloading SKILL.md..."
fetch_skill
echo "Detecting platforms (installing to all detected)..."
echo ""
detect_and_install
echo ""
echo "Done. Documentation: https://github.com/$REPO"
}
main