@@ -82,7 +82,68 @@ main() {
8282 sudo mv " $tmp /$binary_name " " $install_dir /$binary_name "
8383 fi
8484
85- log " Installed ${BINARY} ${version} to ${install_dir} /${binary_name} "
85+ # Post-install interactive setup only when we have a usable terminal.
86+ if has_tty; then
87+ post_install " ${install_dir} /${binary_name} " " $version "
88+ else
89+ echo " " >&2
90+ log " Dune CLI ${version} installed successfully!"
91+ echo " " >&2
92+ log " Tip: Run 'npx skills add duneanalytics/skills' to install the Dune AI coding skill."
93+ log " Tip: Run 'dune auth' to authenticate with your Dune account."
94+ fi
95+ }
96+
97+ post_install () {
98+ dune_bin=" $1 "
99+ dune_version=" $2 "
100+ echo " " >&2
101+
102+ # --- Skill install ---
103+ if has npx; then
104+ log " The Dune skill lets AI coding agents (Cursor, Claude Code, etc.) query"
105+ log " blockchain data on your behalf."
106+ printf " Install Dune skill for your AI coding agent? [Y/n] " >&2
107+ read -r answer < /dev/tty || answer=" "
108+ case " $answer " in
109+ [nN]* )
110+ log " Skipped. You can install it later with: npx skills add duneanalytics/skills"
111+ ;;
112+ * )
113+ log " Installing Dune skill..."
114+ npx skills add duneanalytics/skills < /dev/tty || log " Skill installation failed. You can retry with: npx skills add duneanalytics/skills"
115+ ;;
116+ esac
117+ else
118+ log " Tip: Run 'npx skills add duneanalytics/skills' to install the Dune AI coding skill."
119+ log " (requires Node.js / npx)"
120+ fi
121+
122+ echo " " >&2
123+
124+ # --- Authentication ---
125+ log " Authenticate to start running queries and accessing your Dune account."
126+ printf " Authenticate with Dune now? [Y/n] " >&2
127+ read -r answer < /dev/tty || answer=" "
128+ case " $answer " in
129+ [nN]* )
130+ log " Skipped. You can authenticate later with: dune auth"
131+ ;;
132+ * )
133+ echo " " >&2
134+ log " You'll need a Dune API key."
135+ log " Go to https://dune.com and navigate to APIs and Connectors > API Keys."
136+ echo " " >&2
137+ " $dune_bin " auth < /dev/tty || log " Authentication failed. You can retry with: dune auth"
138+ ;;
139+ esac
140+
141+ echo " " >&2
142+ log " Dune CLI ${dune_version} installed successfully!"
143+ }
144+
145+ has_tty () {
146+ [ -t 0 ] || [ -t 1 ] || [ -t 2 ]
86147}
87148
88149# Pick the best install directory by checking user-writable directories
0 commit comments