Skip to content

Commit 4d17183

Browse files
committed
update install.sh to include sim too
1 parent 4c696c0 commit 4d17183

1 file changed

Lines changed: 31 additions & 2 deletions

File tree

install.sh

Lines changed: 31 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ main() {
9191
echo "" >&2
9292
log "Tip: Run 'npx skills add duneanalytics/skills' to install the Dune AI coding skill."
9393
log "Tip: Run 'dune auth' to authenticate with your Dune account."
94+
log "Tip: Run 'dune sim auth' to access real-time blockchain data (balances, tokens, NFTs)."
9495
fi
9596
}
9697

@@ -134,14 +135,42 @@ post_install() {
134135
;;
135136
*)
136137
echo "" >&2
137-
log "You'll need a Dune API key."
138-
log "Go to https://dune.com and navigate to APIs and Connectors > API Keys."
138+
log "You'll need a Dune API key. To create one:"
139+
log " 1. Go to https://dune.com and login or create an account"
140+
log " 2. Navigate to 'APIs & Connectors'"
141+
log " 3. Click 'API Keys' and create a new key"
139142
echo "" >&2
140143
"$dune_bin" auth < /dev/tty || log "Authentication failed. You can retry with: dune auth"
141144
;;
142145
esac
143146
fi
144147

148+
echo "" >&2
149+
150+
# --- Sim API Authentication ---
151+
if "$dune_bin" sim evm token-info native --chain-ids 1 > /dev/null 2>&1; then
152+
log "Already authenticated with Sim API."
153+
else
154+
log "Authenticate with the Sim API to access real-time blockchain data"
155+
log "(wallet balances, token prices, NFTs, DeFi positions, etc.)."
156+
printf " Authenticate with Sim API now? [Y/n] " >&2
157+
read -r answer < /dev/tty || answer=""
158+
case "$answer" in
159+
[nN]*)
160+
log "Skipped. You can authenticate later with: dune sim auth"
161+
;;
162+
*)
163+
echo "" >&2
164+
log "You'll need a Sim API key. To create one:"
165+
log " 1. Go to https://sim.dune.com/ and login or create an account"
166+
log " 2. Click 'Keys'"
167+
log " 3. Click 'New' to create a new API key"
168+
echo "" >&2
169+
"$dune_bin" sim auth < /dev/tty || log "Authentication failed. You can retry with: dune sim auth"
170+
;;
171+
esac
172+
fi
173+
145174
echo "" >&2
146175
log "Dune CLI ${dune_version} installed successfully!"
147176
}

0 commit comments

Comments
 (0)