Skip to content

Commit c323d0d

Browse files
authored
Merge pull request #9 from second-state/refactor/multi-binary-cli
refactor: split fintool into per-exchange CLIs
2 parents 4962ae4 + 47ea6e5 commit c323d0d

37 files changed

Lines changed: 2880 additions & 2611 deletions

.github/workflows/ci.yml

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,13 @@ jobs:
3333
- name: Run tests
3434
run: cargo test --release
3535

36-
- name: Smoke test - help
37-
run: ./target/release/fintool --help
36+
- name: Smoke test - all binaries show help
37+
run: |
38+
./target/release/fintool --help
39+
./target/release/hyperliquid --help
40+
./target/release/binance --help
41+
./target/release/coinbase --help
42+
./target/release/polymarket --help
3843
3944
- name: Smoke test - init
4045
run: |
@@ -63,18 +68,18 @@ jobs:
6368
6469
- name: Perp quote - crypto
6570
run: |
66-
./target/release/fintool perp quote BTC
67-
./target/release/fintool perp quote ETH
71+
./target/release/hyperliquid perp quote BTC
72+
./target/release/hyperliquid perp quote ETH
6873
6974
- name: Perp quote - commodity
7075
run: |
71-
./target/release/fintool perp quote GOLD
72-
./target/release/fintool perp quote SILVER
76+
./target/release/hyperliquid perp quote GOLD
77+
./target/release/hyperliquid perp quote SILVER
7378
7479
- name: Perp quote - stock
7580
run: |
76-
./target/release/fintool perp quote TSLA
77-
./target/release/fintool perp quote NVDA
81+
./target/release/hyperliquid perp quote TSLA
82+
./target/release/hyperliquid perp quote NVDA
7883
7984
- name: News - crypto
8085
run: ./target/release/fintool news BTC

.github/workflows/release.yml

Lines changed: 38 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,9 @@ on:
88
permissions:
99
contents: write
1010

11+
env:
12+
BINARIES: fintool hyperliquid binance coinbase polymarket
13+
1114
jobs:
1215
build:
1316
strategy:
@@ -24,7 +27,7 @@ jobs:
2427
artifact: fintool-macos-aarch64
2528
- target: x86_64-pc-windows-gnu
2629
os: ubuntu-latest
27-
artifact: fintool-windows-x86_64.exe
30+
artifact: fintool-windows-x86_64
2831

2932
runs-on: ${{ matrix.os }}
3033

@@ -75,41 +78,45 @@ jobs:
7578

7679
- name: Verify static linking
7780
run: |
78-
bin="target/${{ matrix.target }}/release/fintool"
79-
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
80-
bin="${bin}.exe"
81-
fi
82-
echo "=== Binary info ==="
83-
file "$bin"
84-
if [[ "${{ matrix.target }}" == *"linux-musl"* ]]; then
85-
# musl binaries should be statically linked
86-
if ldd "$bin" 2>&1 | grep -q "not a dynamic executable\|statically linked"; then
87-
echo "✅ Static binary confirmed"
88-
else
89-
echo "❌ Binary is dynamically linked!"
90-
ldd "$bin"
91-
exit 1
81+
for name in $BINARIES; do
82+
bin="target/${{ matrix.target }}/release/${name}"
83+
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
84+
bin="${bin}.exe"
9285
fi
93-
elif [[ "${{ matrix.target }}" == *"apple-darwin"* ]]; then
94-
# macOS: check no non-system dylibs
95-
echo "Dynamic libraries:"
96-
otool -L "$bin" || true
97-
elif [[ "${{ matrix.target }}" == *"windows"* ]]; then
98-
echo "Windows binary — static check via file output above"
99-
fi
86+
echo "=== ${name} ==="
87+
file "$bin"
88+
if [[ "${{ matrix.target }}" == *"linux-musl"* ]]; then
89+
# musl binaries should be statically linked
90+
if ldd "$bin" 2>&1 | grep -q "not a dynamic executable\|statically linked"; then
91+
echo "✅ Static binary confirmed"
92+
else
93+
echo "❌ Binary is dynamically linked!"
94+
ldd "$bin"
95+
exit 1
96+
fi
97+
elif [[ "${{ matrix.target }}" == *"apple-darwin"* ]]; then
98+
# macOS: check no non-system dylibs
99+
echo "Dynamic libraries:"
100+
otool -L "$bin" || true
101+
elif [[ "${{ matrix.target }}" == *"windows"* ]]; then
102+
echo "Windows binary — static check via file output above"
103+
fi
104+
done
100105
101106
- name: Package zip
102107
run: |
103108
dir="${{ matrix.artifact }}"
104109
mkdir -p "$dir"
105-
src="target/${{ matrix.target }}/release/fintool"
106-
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
107-
cp "${src}.exe" "$dir/fintool.exe"
108-
else
109-
cp "$src" "$dir/fintool"
110-
chmod +x "$dir/fintool"
111-
fi
112-
cp config.toml.default "$dir/"
110+
for name in $BINARIES; do
111+
src="target/${{ matrix.target }}/release/${name}"
112+
if [[ "${{ matrix.target }}" == *"windows"* ]]; then
113+
cp "${src}.exe" "$dir/${name}.exe"
114+
else
115+
cp "$src" "$dir/${name}"
116+
chmod +x "$dir/${name}"
117+
fi
118+
done
119+
cp config.toml.default "$dir/" 2>/dev/null || true
113120
zip -r "${{ matrix.artifact }}.zip" "$dir"
114121
115122
- name: Upload artifact
@@ -147,5 +154,5 @@ jobs:
147154
artifacts/fintool-linux-x86_64/fintool-linux-x86_64.zip
148155
artifacts/fintool-linux-aarch64/fintool-linux-aarch64.zip
149156
artifacts/fintool-macos-aarch64/fintool-macos-aarch64.zip
150-
artifacts/fintool-windows-x86_64.exe/fintool-windows-x86_64.exe.zip
157+
artifacts/fintool-windows-x86_64/fintool-windows-x86_64.zip
151158
checksums.txt

Cargo.toml

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,36 @@
11
[package]
22
name = "fintool"
3-
version = "0.1.2"
3+
version = "0.2.0"
44
edition = "2021"
5-
description = "Agentic trading CLI for crypto and stocks — spot/perp/options on Hyperliquid, Unit, Binance, and Coinbase"
5+
description = "Agentic trading CLIs for crypto, stocks, and prediction markets — Hyperliquid, Binance, Coinbase, and Polymarket"
66
license = "MIT"
77
repository = "https://github.com/second-state/fintool"
88
homepage = "https://github.com/second-state/fintool"
99

10+
[lib]
11+
name = "fintool_lib"
12+
path = "src/lib.rs"
13+
14+
[[bin]]
15+
name = "fintool"
16+
path = "src/bin/fintool.rs"
17+
18+
[[bin]]
19+
name = "hyperliquid"
20+
path = "src/bin/hyperliquid.rs"
21+
22+
[[bin]]
23+
name = "binance"
24+
path = "src/bin/binance.rs"
25+
26+
[[bin]]
27+
name = "coinbase"
28+
path = "src/bin/coinbase.rs"
29+
30+
[[bin]]
31+
name = "polymarket"
32+
path = "src/bin/polymarket.rs"
33+
1034
[dependencies]
1135
clap = { version = "4", features = ["derive"] }
1236
reqwest = { version = "0.12", default-features = false, features = ["json", "rustls-tls"] }

0 commit comments

Comments
 (0)