-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathinstall.sh
More file actions
executable file
·124 lines (109 loc) · 3.32 KB
/
install.sh
File metadata and controls
executable file
·124 lines (109 loc) · 3.32 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
#!/bin/sh
: <<'DOCSTRING'
Steel CLI — browser automation for AI agents
https://github.com/steel-dev/cli
This script installs the Steel CLI binary. After installation, agents should
install the steel-browser skill to unlock full browser automation capabilities.
REQUIRES: curl
INSTALLS TO: ~/.steel/bin
After install, PATH is NOT updated in the current process.
Fix: export PATH="$HOME/.steel/bin:$PATH"
POST-INSTALL:
steel login # authenticate
steel browser start # start automation session
SKILL SETUP (recommended for agents):
npx skills add https://github.com/steel-dev/cli --skill steel-browser
DOCSTRING
set -eu
echo "Steel CLI — browser automation for AI agents"
echo "https://github.com/steel-dev/cli"
echo ""
if ! command -v curl > /dev/null; then
echo "error: curl is required but not installed."
exit 1
fi
if command -v steel > /dev/null 2>&1; then
existing=$(command -v steel)
if [ -L "$existing" ]; then
real=$(readlink -f "$existing" 2>/dev/null || readlink "$existing")
else
real="$existing"
fi
is_node=false
case "$real" in
*/node_modules/*) is_node=true ;;
esac
if [ "$is_node" = false ] && head -1 "$real" 2>/dev/null | grep -q "node\|nodejs"; then
is_node=true
fi
if [ "$is_node" = true ]; then
echo "Detected old Node.js Steel CLI at: $existing"
echo "Removing it automatically..."
echo ""
if npm uninstall -g @steel-dev/cli 2>/dev/null; then
echo "Old Node.js CLI removed successfully."
else
echo "Warning: could not auto-remove. Please run manually:"
echo " npm uninstall -g @steel-dev/cli"
echo ""
exit 1
fi
echo ""
fi
fi
echo "Installing steel binary..."
STEEL_CLI_NO_MODIFY_PATH=1 curl --proto '=https' --tlsv1.2 -LsSf https://github.com/steel-dev/cli/releases/latest/download/steel-cli-installer.sh | STEEL_CLI_NO_MODIFY_PATH=1 sh > /dev/null 2>&1
INSTALL_DIR="$HOME/.steel/bin"
_added=false
if [ -n "${SHELL:-}" ]; then
case "$SHELL" in
*/zsh)
_rc="$HOME/.zshrc"
;;
*/bash)
if [ "$(uname)" = "Darwin" ]; then
_rc="$HOME/.bash_profile"
else
_rc="$HOME/.bashrc"
fi
;;
*/fish)
_rc="$HOME/.config/fish/conf.d/steel.fish"
;;
*)
_rc="$HOME/.profile"
;;
esac
_line="export PATH=\"$INSTALL_DIR:\$PATH\""
if [ "${SHELL##*/}" = "fish" ]; then
_line="fish_add_path $INSTALL_DIR"
fi
if [ -f "$_rc" ] && grep -qF "$INSTALL_DIR" "$_rc" 2>/dev/null; then
_added=true
elif [ -n "$_rc" ]; then
mkdir -p "$(dirname "$_rc")"
echo "$_line" >> "$_rc"
_added=true
fi
fi
echo ""
echo "Setup complete!"
if [ "$_added" = true ]; then
echo "Added $INSTALL_DIR to PATH in $_rc"
echo ""
echo "Restart your shell or run:"
echo " source $_rc"
else
echo "Add this to your shell config:"
echo " export PATH=\"$INSTALL_DIR:\$PATH\""
fi
echo ""
echo "Then try it out:"
echo ""
echo " steel --help"
echo " steel login"
echo " steel browser start"
echo ""
echo "SKILL SETUP (recommended for agents):"
echo " npx skills add https://github.com/steel-dev/cli --skill steel-browser"
echo ""