Skip to content

Add optional sample query to dune auth onboarding#40

Open
arein wants to merge 1 commit intoduneanalytics:mainfrom
arein:feat/auth-sample-query
Open

Add optional sample query to dune auth onboarding#40
arein wants to merge 1 commit intoduneanalytics:mainfrom
arein:feat/auth-sample-query

Conversation

@arein
Copy link

@arein arein commented Mar 15, 2026

Screenshot 2026-03-15 at 3 17 57 PM

Summary

  • After dune auth saves the API key, offers to run a sample DuneSQL query (latest 5 Ethereum blocks) to verify the setup works
  • Only triggers in interactive terminals; skips silently in CI/scripts/pipes
  • Defaults to yes ([Y/n]) for frictionless onboarding
  • Sample query failure is non-fatal — prints error to stderr without failing auth

Test plan

  • All existing tests pass (go test ./...)
  • TestAuthWithPrompt now exercises the full sample query path (gets expected 401 with fake key)
  • Manual test: dune auth in a real terminal with a valid API key — should prompt and display 5 Ethereum blocks
  • Manual test: dune auth --api-key <key> — should still offer the sample query
  • Manual test: echo "key" | dune auth — should skip sample query (non-interactive)

🤖 Generated with Claude Code

After saving the API key, prompt the user to run a sample DuneSQL
query (latest 5 Ethereum blocks) to verify their setup works.

- Only triggers in interactive terminals; skips silently in CI/scripts
- Defaults to yes ([Y/n]) for frictionless onboarding
- Uses a shared bufio.Reader for both the key and confirmation prompts
  to avoid stdin buffering issues
- Sample query failure is non-fatal (prints to stderr, doesn't fail auth)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant