Skip to content

Commit d218990

Browse files
Michael YuanMichael Yuan
authored andcommitted
Add bootstrap.sh, rewrite install.md
- bootstrap.sh: clone repo, detect platform, download binary, init config, check required keys - install.md: curl-pipe-bash quick install, manual fallback - No vim references — tells user to edit config manually - Config check warns about missing OpenAI key and exchange credentials
1 parent bd91a56 commit d218990

2 files changed

Lines changed: 120 additions & 78 deletions

File tree

skills/bootstrap.sh

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
#!/bin/bash
2+
set -e
3+
4+
SKILL_DIR="${HOME}/.openclaw/skills/fintool"
5+
REPO_URL="https://github.com/second-state/fintool.git"
6+
RELEASE_BASE="https://github.com/second-state/fintool/releases/latest/download"
7+
8+
echo "📈 Installing fintool skill..."
9+
10+
# 1. Clone skill files
11+
echo "Cloning skill files..."
12+
rm -rf /tmp/fintool-repo
13+
git clone --depth 1 "$REPO_URL" /tmp/fintool-repo
14+
mkdir -p "$SKILL_DIR/scripts"
15+
cp /tmp/fintool-repo/skills/SKILL.md "$SKILL_DIR/SKILL.md"
16+
cp /tmp/fintool-repo/skills/install.md "$SKILL_DIR/install.md"
17+
cp /tmp/fintool-repo/skills/scripts/.gitignore "$SKILL_DIR/scripts/.gitignore"
18+
rm -rf /tmp/fintool-repo
19+
20+
# 2. Detect platform
21+
OS=$(uname -s)
22+
ARCH=$(uname -m)
23+
24+
case "${OS}-${ARCH}" in
25+
Linux-x86_64) ARTIFACT="fintool-linux-x86_64" ;;
26+
Linux-aarch64) ARTIFACT="fintool-linux-aarch64" ;;
27+
Darwin-arm64) ARTIFACT="fintool-macos-aarch64" ;;
28+
*)
29+
echo "❌ Unsupported platform: ${OS}-${ARCH}"
30+
echo "Supported: Linux (x86_64, aarch64), macOS (Apple Silicon)"
31+
exit 1
32+
;;
33+
esac
34+
35+
# 3. Download binary
36+
echo "Downloading ${ARTIFACT}..."
37+
curl -L -o /tmp/fintool.zip "${RELEASE_BASE}/${ARTIFACT}.zip"
38+
unzip -o /tmp/fintool.zip -d /tmp/fintool-extract
39+
cp "/tmp/fintool-extract/${ARTIFACT}/fintool" "$SKILL_DIR/scripts/fintool"
40+
chmod +x "$SKILL_DIR/scripts/fintool"
41+
rm -rf /tmp/fintool.zip /tmp/fintool-extract
42+
43+
# 4. Initialize config (never overwrites existing)
44+
"$SKILL_DIR/scripts/fintool" init
45+
46+
echo ""
47+
echo "✅ fintool installed to $SKILL_DIR/scripts/fintool"
48+
echo ""
49+
50+
# 5. Check config for required keys
51+
CONFIG="$HOME/.fintool/config.toml"
52+
MISSING=()
53+
54+
# Check OpenAI
55+
if ! grep -q '^openai_api_key\s*=' "$CONFIG" 2>/dev/null; then
56+
MISSING+=("openai_api_key (for enriched price quotes with trend analysis)")
57+
fi
58+
59+
# Check exchanges — need at least one
60+
HAS_HL=false
61+
HAS_BINANCE=false
62+
HAS_COINBASE=false
63+
64+
if grep -q '^private_key\s*=' "$CONFIG" 2>/dev/null || grep -q '^wallet_json\s*=' "$CONFIG" 2>/dev/null; then
65+
HAS_HL=true
66+
fi
67+
if grep -q '^binance_api_key\s*=' "$CONFIG" 2>/dev/null; then
68+
HAS_BINANCE=true
69+
fi
70+
if grep -q '^coinbase_api_key\s*=' "$CONFIG" 2>/dev/null; then
71+
HAS_COINBASE=true
72+
fi
73+
74+
if [ "$HAS_HL" = false ] && [ "$HAS_BINANCE" = false ] && [ "$HAS_COINBASE" = false ]; then
75+
MISSING+=("At least one exchange (Hyperliquid wallet, Binance API keys, or Coinbase API keys)")
76+
fi
77+
78+
if [ ${#MISSING[@]} -gt 0 ]; then
79+
echo "⚠️ Configuration needed in ~/.fintool/config.toml:"
80+
echo ""
81+
for item in "${MISSING[@]}"; do
82+
echo "$item"
83+
done
84+
echo ""
85+
echo "Edit ~/.fintool/config.toml to add the missing credentials."
86+
echo ""
87+
echo "Exchange capabilities:"
88+
echo " • Hyperliquid (wallet): spot + perps"
89+
echo " • Binance (API key): spot + perps + options"
90+
echo " • Coinbase (API key): spot only"
91+
else
92+
echo "✅ Configuration looks good!"
93+
fi

skills/install.md

Lines changed: 27 additions & 78 deletions
Original file line numberDiff line numberDiff line change
@@ -4,68 +4,48 @@ Install the fintool skill for financial trading and market intelligence.
44

55
## Prerequisites
66

7-
- `curl` (for downloading)
8-
- `unzip` (for extraction)
9-
- `bash` (shell)
7+
- `curl`, `unzip`, `git`, `bash`
108

119
## Quick Install (Recommended)
1210

1311
```bash
14-
SKILL_DIR="${HOME}/.openclaw/skills/fintool"
15-
mkdir -p "$SKILL_DIR"
12+
curl -sSL https://raw.githubusercontent.com/second-state/fintool/main/skills/bootstrap.sh | bash
13+
```
14+
15+
Or clone and run locally:
1616

17-
# Clone the skill files
17+
```bash
1818
git clone --depth 1 https://github.com/second-state/fintool.git /tmp/fintool-repo
19-
cp -r /tmp/fintool-repo/skills/* "$SKILL_DIR/"
19+
bash /tmp/fintool-repo/skills/bootstrap.sh
2020
rm -rf /tmp/fintool-repo
21-
22-
# Detect platform and download binary
23-
OS=$(uname -s)
24-
ARCH=$(uname -m)
25-
26-
case "${OS}-${ARCH}" in
27-
Linux-x86_64) ARTIFACT="fintool-linux-x86_64" ;;
28-
Linux-aarch64) ARTIFACT="fintool-linux-aarch64" ;;
29-
Darwin-arm64) ARTIFACT="fintool-macos-aarch64" ;;
30-
*)
31-
echo "Unsupported platform: ${OS}-${ARCH}"
32-
echo "Supported: Linux (x86_64, aarch64), macOS (Apple Silicon)"
33-
exit 1
34-
;;
35-
esac
36-
37-
# Download latest release
38-
RELEASE_URL="https://github.com/second-state/fintool/releases/latest/download/${ARTIFACT}.zip"
39-
echo "Downloading ${ARTIFACT}..."
40-
curl -L -o /tmp/fintool.zip "$RELEASE_URL"
41-
unzip -o /tmp/fintool.zip -d /tmp/fintool-extract
42-
cp "/tmp/fintool-extract/${ARTIFACT}/fintool" "$SKILL_DIR/scripts/fintool"
43-
chmod +x "$SKILL_DIR/scripts/fintool"
44-
rm -rf /tmp/fintool.zip /tmp/fintool-extract
45-
46-
# Initialize config (will NOT overwrite existing config)
47-
"$SKILL_DIR/scripts/fintool" init
48-
49-
echo ""
50-
echo "✅ fintool installed to $SKILL_DIR/scripts/fintool"
51-
echo "📝 Edit ~/.fintool/config.toml to add your API keys and exchange credentials."
5221
```
5322

54-
After installation, configure your exchanges and API keys:
23+
The bootstrap script will:
24+
1. Clone skill files to `~/.openclaw/skills/fintool/`
25+
2. Detect your platform (Linux x86_64/aarch64, macOS Apple Silicon)
26+
3. Download the correct binary from the latest GitHub release
27+
4. Run `fintool init` to create `~/.fintool/config.toml` (never overwrites existing)
28+
5. Check config for required keys and tell you what's missing
5529

56-
```bash
57-
vim ~/.fintool/config.toml
58-
```
30+
After installation, edit `~/.fintool/config.toml` to add your credentials:
31+
32+
**Required:**
33+
- `openai_api_key` — for enriched price quotes with trend/momentum analysis
34+
35+
**At least one exchange:**
36+
- **Hyperliquid**`private_key` or `wallet_json` + `wallet_passcode` in `[wallet]` (spot + perps)
37+
- **Binance**`binance_api_key` + `binance_api_secret` in `[api_keys]` (spot + perps + options)
38+
- **Coinbase**`coinbase_api_key` + `coinbase_api_secret` in `[api_keys]` (spot only)
5939

60-
Then verify it works:
40+
Verify installation:
6141

6242
```bash
6343
~/.openclaw/skills/fintool/scripts/fintool quote BTC
6444
```
6545

6646
## Manual Installation
6747

68-
If the automatic download fails:
48+
If the bootstrap script fails:
6949

7050
1. Go to https://github.com/second-state/fintool/releases/latest
7151
2. Download the zip for your platform:
@@ -80,7 +60,7 @@ If the automatic download fails:
8060
cp fintool-<platform>/fintool ~/.openclaw/skills/fintool/scripts/fintool
8161
chmod +x ~/.openclaw/skills/fintool/scripts/fintool
8262
```
83-
4. Copy the skill files:
63+
4. Copy the skill definition:
8464
```bash
8565
git clone --depth 1 https://github.com/second-state/fintool.git /tmp/fintool-repo
8666
cp /tmp/fintool-repo/skills/SKILL.md ~/.openclaw/skills/fintool/SKILL.md
@@ -90,41 +70,12 @@ If the automatic download fails:
9070
```bash
9171
~/.openclaw/skills/fintool/scripts/fintool init
9272
```
93-
94-
## Configuration
95-
96-
Edit `~/.fintool/config.toml` with your credentials:
97-
98-
```toml
99-
[wallet]
100-
# Hyperliquid — spot and perp trading
101-
# private_key = "0x..."
102-
103-
[network]
104-
testnet = false
105-
106-
[api_keys]
107-
# OpenAI — enriched quote analysis (trend, momentum, summary)
108-
# openai_api_key = "sk-..."
109-
# openai_model = "gpt-4.1-mini"
110-
111-
# Binance — spot, perps, and options
112-
# binance_api_key = "..."
113-
# binance_api_secret = "..."
114-
115-
# Coinbase — spot trading
116-
# coinbase_api_key = "..."
117-
# coinbase_api_secret = "..."
118-
```
119-
120-
You need **at least one exchange** configured for trading, and an **OpenAI key** for enriched quotes.
73+
6. Edit `~/.fintool/config.toml` to add your API keys and exchange credentials.
12174

12275
## Troubleshooting
12376

12477
### Download Failed
12578

126-
Check network connectivity:
127-
12879
```bash
12980
curl -I "https://github.com/second-state/fintool/releases/latest"
13081
```
@@ -139,10 +90,8 @@ Supported: Linux (x86_64, aarch64), macOS (Apple Silicon arm64), Windows (x86_64
13990

14091
### Config Not Found
14192

142-
If commands fail with config errors, ensure `~/.fintool/config.toml` exists:
143-
14493
```bash
14594
~/.openclaw/skills/fintool/scripts/fintool init
14695
```
14796

148-
This will create the config template if it doesn't exist, and never overwrite an existing one.
97+
Creates the config template if it doesn't exist. Never overwrites an existing one.

0 commit comments

Comments
 (0)