This is currently in pre-alpha state with no error handling, but can get the job done
Installation
npm i -g dune-client
Then set your env variables (todo: better auth for cli):
# Your session cookie from browser export SESSION=# The client needs one of your queries to use as a workspace export QUERY_ID=
Usage
# table mode $ dune-cli --table 'select block_number, block_time from ethereum.traces limit 5'submitting: waitingsubmitting: doneexecuting: waitingexecuting: donefetching resultsfetched 5 rows┌─────────┬──────────────┬────────────────────────┐│ │ block_number │ block_time │├─────────┼──────────────┼────────────────────────┤│ 0 │ 46147 │ '2015-08-07T03:30:33Z' ││ 1 │ 46169 │ '2015-08-07T03:36:53Z' ││ 2 │ 46170 │ '2015-08-07T03:37:10Z' ││ 3 │ 46194 │ '2015-08-07T03:43:03Z' ││ 4 │ 46205 │ '2015-08-07T03:46:15Z' │└─────────┴──────────────┴────────────────────────┘ # JSON mode $ dune-cli 'select block_number, block_time from ethereum.traces limit 5'submitting: waitingsubmitting: doneexecuting: waitingexecuting: donefetching resultsfetched 5 rows[
Use as a package
const DuneClient = { const dune = session queryId const rows = await dune console}