You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Enrich command and flag descriptions for AI agent consumption
Merge the detailed flag descriptions from PR #15 (max lengths, type format
hints, behavioral details, category explanations) with the examples and
Long descriptions from the search_by_contract work. Every Short, Long,
and flag help string is now maximally descriptive so AI agents can
select the right commands and flags without ambiguity.
cmd.Flags().Int("limit", 0, "maximum number of result rows to return (0 = all)")
38
-
cmd.Flags().Int("offset", 0, "number of rows to skip before returning results, used for pagination")
39
-
cmd.Flags().Bool("no-wait", false, "return the current execution state immediately without waiting for completion")
40
-
cmd.Flags().Int("timeout", 300, "maximum seconds to wait for the execution to complete before timing out")
41
+
cmd.Flags().Int("limit", 0, "maximum number of result rows to return (0 = all); use with --offset to paginate large result sets")
42
+
cmd.Flags().Int("offset", 0, "number of rows to skip before starting to return results; use with --limit for pagination through large result sets")
43
+
cmd.Flags().Bool("no-wait", false, "return the current execution state immediately without waiting for completion; useful for checking status of long-running queries")
44
+
cmd.Flags().Int("timeout", 300, "maximum seconds to wait for the execution to complete before timing out (default 300s = 5 minutes)")
Copy file name to clipboardExpand all lines: cmd/query/run.go
+17-10Lines changed: 17 additions & 10 deletions
Original file line number
Diff line number
Diff line change
@@ -13,24 +13,31 @@ import (
13
13
funcnewRunCmd() *cobra.Command {
14
14
cmd:=&cobra.Command{
15
15
Use: "run <query-id>",
16
-
Short: "Execute a saved query and display results",
17
-
Long: "Execute a saved DuneSQL query by its numeric ID and display results.\n\n"+
18
-
"By default, polls every 5 seconds for up to ~5 minutes waiting for completion.\n"+
19
-
"Use --no-wait to submit the execution and exit immediately; then fetch\n"+
20
-
"results later with 'dune execution results <execution-id>'.\n\n"+
16
+
Short: "Execute a saved Dune query by its ID and display results",
17
+
Long: "Execute a saved Dune query by its numeric ID. By default, waits for the\n"+
18
+
"execution to complete (polling every 2 seconds) and displays the result rows.\n"+
19
+
"Use --no-wait to submit the execution and exit immediately with just the\n"+
20
+
"execution ID; then fetch results later with 'dune execution results <execution-id>'.\n\n"+
21
+
"Credits are consumed based on actual compute resources used. Use --performance\n"+
22
+
"to select the engine size (medium or large).\n\n"+
23
+
"Important: if the query targets tables with known partition columns (returned by\n"+
24
+
"'dune dataset search' or 'dune dataset search-by-contract'), ensure the SQL includes\n"+
25
+
"a WHERE filter on those partition columns (e.g. WHERE block_date >= CURRENT_DATE -\n"+
26
+
"INTERVAL '7' DAY). This enables partition pruning and significantly reduces query cost.\n\n"+
21
27
"Examples:\n"+
22
28
" dune query run 12345\n"+
23
29
" dune query run 12345 --param wallet=0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 --param days=30\n"+
24
30
" dune query run 12345 --performance large --limit 100\n"+
25
-
" dune query run 12345 --no-wait",
31
+
" dune query run 12345 --no-wait\n"+
32
+
" dune query run 12345 --timeout 600",
26
33
Args: cobra.ExactArgs(1),
27
34
RunE: runRun,
28
35
}
29
36
30
-
cmd.Flags().StringArray("param", nil, "query parameter in key=value format (repeatable)")
31
-
cmd.Flags().String("performance", "medium", `performance tier: "medium" (default) or "large" for higher compute resources`)
32
-
cmd.Flags().Int("limit", 0, "maximum number of rows to display (0 = all)")
33
-
cmd.Flags().Bool("no-wait", false, "submit execution and exit without waiting for results")
37
+
cmd.Flags().StringArray("param", nil, "typed query parameter in key=value format (repeatable); supported types: text, number (stringified, e.g. '30'), datetime (YYYY-MM-DD HH:mm:ss), enum")
38
+
cmd.Flags().String("performance", "medium", `engine size for the execution: "medium" (default) or "large"; credits are consumed based on actual compute resources used`)
39
+
cmd.Flags().Int("limit", 0, "maximum number of result rows to return (0 = all available rows)")
40
+
cmd.Flags().Bool("no-wait", false, "submit the execution and exit immediately, printing only the execution ID and state")
34
41
cmd.Flags().Int("timeout", 300, "maximum seconds to wait for the execution to complete before timing out")
cmd.Flags().String("sql", "", "DuneSQL query to execute (required)")
32
+
cmd.Flags().String("sql", "", "the SQL query text in DuneSQL dialect (required)")
27
33
_=cmd.MarkFlagRequired("sql")
28
-
cmd.Flags().StringArray("param", nil, "query parameter in key=value format (repeatable)")
29
-
cmd.Flags().String("performance", "medium", `performance tier: "medium" (default) or "large" for higher compute resources`)
30
-
cmd.Flags().Int("limit", 0, "maximum number of rows to display (0 = all)")
31
-
cmd.Flags().Bool("no-wait", false, "submit execution and exit without waiting for results")
34
+
cmd.Flags().StringArray("param", nil, "typed query parameter in key=value format (repeatable); supported types: text, number (stringified, e.g. '30'), datetime (YYYY-MM-DD HH:mm:ss), enum")
35
+
cmd.Flags().String("performance", "medium", `engine size for the execution: "medium" (default) or "large"; credits are consumed based on actual compute resources used`)
36
+
cmd.Flags().Int("limit", 0, "maximum number of result rows to return (0 = all available rows)")
37
+
cmd.Flags().Bool("no-wait", false, "submit the execution and exit immediately, printing only the execution ID and state")
32
38
cmd.Flags().Int("timeout", 300, "maximum seconds to wait for the execution to complete before timing out")
0 commit comments