{"modulePath":"github.com/duneanalytics/cli","version":"v0.1.25","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package cmdutil\n\n## Functions\n\n```go\nfunc CallTool(cmd *cobra.Command, tool string, args map[string]any, view any) (json.RawMessage, error)\n```\nCallTool calls a Dune MCP tool and, when view is not nil, decodes the result into it. It returns the result as the tool sent it, for JSON output.\n\n```go\nfunc CallToolWithImages(cmd *cobra.Command, tool string, args map[string]any, view any) (json.RawMessage, [][]byte, error)\n```\nCallToolWithImages calls a Dune MCP tool like CallTool and also returns the images the tool sent.\n\n```go\nfunc ClientFromCmd(cmd *cobra.Command) dune.DuneClient\n```\nClientFromCmd extracts the DuneClient stored in the command's context.\n\n```go\nfunc FileFlag(cmd *cobra.Command, name string) ([]byte, error)\n```\nFileFlag returns the value of a string flag. A value that starts with @ names a file to read the value from, and @- reads standard input.\n\n```go\nfunc JSONFlag(cmd *cobra.Command, name string, v any) error\n```\nJSONFlag decodes a flag that holds JSON, read as FileFlag reads it.\n\n```go\nfunc MCPFromCmd(cmd *cobra.Command) dunemcp.Caller\n```\nMCPFromCmd extracts the Dune MCP caller stored in the command's context.\n\n```go\nfunc PlanHint(err error) string\n```\nPlanHint returns the next steps for an error caused by the account's plan: running out of credits, reaching the extra credits limit, a rate limit, or unpaid invoices. It returns \"\" for any other error.\n\nUnlike the Dune MCP server, which plugin directories keep from promoting upgrades, the CLI links straight to the plan settings and pricing pages.\n\n```go\nfunc SetClient(cmd *cobra.Command, client dune.DuneClient)\n```\nSetClient stores a DuneClient in the command's context.\n\n```go\nfunc SetMCP(cmd *cobra.Command, c dunemcp.Caller)\n```\nSetMCP stores a Dune MCP caller in the command's context.\n\n```go\nfunc SetStartTime(cmd *cobra.Command, t time.Time)\n```\nSetStartTime stores the command start time in the command's context.\n\n```go\nfunc SetTracker(cmd *cobra.Command, t *tracking.Tracker)\n```\nSetTracker stores a Tracker in the command's context.\n\n```go\nfunc StartTimeFromCmd(cmd *cobra.Command) time.Time\n```\nStartTimeFromCmd extracts the command start time from the command's context.\n\n```go\nfunc ToolArgs(cmd *cobra.Command, names map[string]string) map[string]any\n```\nToolArgs returns Dune MCP tool arguments for the flags the user set, so the server applies its own defaults to the rest. names maps flag names to the argument each one fills.\n\n```go\nfunc TrackerFromCmd(cmd *cobra.Command) *tracking.Tracker\n```\nTrackerFromCmd extracts the Tracker stored in the command's context.\n\n","path":"github.com/duneanalytics/cli/cmdutil","name":"cmdutil","synopsis":"","isRedistributable":true}
