Skip to content

Commit 4c696c0

Browse files
committed
AI friendly sim cli descriptions
1 parent 3d18cf2 commit 4c696c0

16 files changed

Lines changed: 319 additions & 100 deletions

cmd/sim/auth.go

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,13 +15,24 @@ import (
1515
func NewAuthCmd() *cobra.Command {
1616
cmd := &cobra.Command{
1717
Use: "auth",
18-
Short: "Authenticate with the Sim API",
19-
Long: "Save your Sim API key so you don't need to pass --sim-api-key or set DUNE_SIM_API_KEY every time.",
18+
Short: "Save your Sim API key to the local configuration file",
19+
Long: "Persist your Sim API key to ~/.config/dune/config.yaml so subsequent\n" +
20+
"'dune sim' commands authenticate automatically without requiring\n" +
21+
"--sim-api-key or the DUNE_SIM_API_KEY environment variable.\n\n" +
22+
"The key can be provided via:\n" +
23+
" 1. --api-key flag\n" +
24+
" 2. DUNE_SIM_API_KEY environment variable\n" +
25+
" 3. Interactive prompt (if neither of the above is set)\n\n" +
26+
"The saved key is used as the lowest-priority fallback; --sim-api-key and\n" +
27+
"DUNE_SIM_API_KEY always take precedence when set.\n\n" +
28+
"Examples:\n" +
29+
" dune sim auth\n" +
30+
" dune sim auth --api-key sim_abc123...",
2031
Annotations: map[string]string{"skipSimAuth": "true"},
2132
RunE: runSimAuth,
2233
}
2334

24-
cmd.Flags().String("api-key", "", "Sim API key to save")
35+
cmd.Flags().String("api-key", "", "Sim API key to save (prefixed 'sim_'); if omitted, reads from DUNE_SIM_API_KEY or prompts interactively")
2536

2637
return cmd
2738
}

cmd/sim/evm/activity.go

Lines changed: 31 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,44 @@ import (
1414
func NewActivityCmd() *cobra.Command {
1515
cmd := &cobra.Command{
1616
Use: "activity <address>",
17-
Short: "Get EVM activity feed for a wallet address",
18-
Long: "Return a chronological feed of on-chain activity for the given wallet address\n" +
19-
"including native transfers, ERC20 movements, NFT transfers, swaps, and contract calls.\n\n" +
17+
Short: "Get a decoded activity feed for a wallet address across EVM chains",
18+
Long: "Return a reverse-chronological feed of human-readable on-chain activity for\n" +
19+
"the given wallet address. Unlike raw transactions, activity entries are decoded\n" +
20+
"and classified into semantic types: sends, receives, mints, burns, token swaps,\n" +
21+
"approvals, and contract calls.\n\n" +
22+
"Activity types:\n" +
23+
" - send/receive: native or token transfers to/from the wallet\n" +
24+
" - mint/burn: token creation or destruction involving the wallet\n" +
25+
" - swap: DEX token exchanges (includes from/to token details)\n" +
26+
" - approve: ERC20/ERC721 spending approvals\n" +
27+
" - call: contract interactions with decoded function name and inputs\n\n" +
28+
"Asset types: native, erc20, erc721, erc1155.\n\n" +
29+
"Response fields per activity item:\n" +
30+
" - chain_id, block_number, block_time, tx_hash: transaction context\n" +
31+
" - type: activity classification (send, receive, swap, etc.)\n" +
32+
" - asset_type: token standard (native, erc20, erc721, erc1155)\n" +
33+
" - value, value_usd: transfer amount and USD value at time of transaction\n" +
34+
" - token_metadata: symbol, decimals, name, logo, price_usd\n" +
35+
" - For swaps: from_token_*, to_token_* fields with both sides of the trade\n" +
36+
" - For calls: function signature, name, and decoded inputs\n\n" +
37+
"By default, returns all activity types across all default chains.\n" +
38+
"Run 'dune sim evm supported-chains' to see which chains support activity.\n\n" +
39+
"For raw transaction data (hashes, gas, calldata), use 'dune sim evm transactions'.\n\n" +
2040
"Examples:\n" +
2141
" dune sim evm activity 0xd8da6bf26964af9d7eed9e03e53415d37aa96045\n" +
2242
" dune sim evm activity 0xd8da... --activity-type send,receive --chain-ids 1\n" +
23-
" dune sim evm activity 0xd8da... --asset-type erc20 --limit 50 -o json",
43+
" dune sim evm activity 0xd8da... --asset-type erc20 --limit 50 -o json\n" +
44+
" dune sim evm activity 0xd8da... --token-address 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
2445
Args: cobra.ExactArgs(1),
2546
RunE: runActivity,
2647
}
2748

28-
cmd.Flags().String("chain-ids", "", "Comma-separated chain IDs or tags (default: all default chains)")
29-
cmd.Flags().String("token-address", "", "Filter by token contract address (comma-separated for multiple)")
30-
cmd.Flags().String("activity-type", "", "Filter by type: send,receive,mint,burn,swap,approve,call")
31-
cmd.Flags().String("asset-type", "", "Filter by asset standard: native,erc20,erc721,erc1155")
32-
cmd.Flags().Int("limit", 0, "Max results (1-100)")
33-
cmd.Flags().String("offset", "", "Pagination cursor from previous response")
49+
cmd.Flags().String("chain-ids", "", "Restrict to specific chains by numeric ID or tag name (comma-separated, e.g. '1,8453' or 'default'); defaults to all chains tagged 'default'")
50+
cmd.Flags().String("token-address", "", "Filter activities involving specific token contracts (comma-separated ERC20/ERC721/ERC1155 addresses)")
51+
cmd.Flags().String("activity-type", "", "Filter by activity classification (comma-separated): send, receive, mint, burn, swap, approve, call; defaults to all types")
52+
cmd.Flags().String("asset-type", "", "Filter by token standard (comma-separated): native, erc20, erc721, erc1155; defaults to all standards")
53+
cmd.Flags().Int("limit", 0, "Maximum number of activity items to return per page (1-100, default: server-determined)")
54+
cmd.Flags().String("offset", "", "Pagination cursor returned as next_offset in a previous response; use to fetch the next page of results")
3455
output.AddFormatFlag(cmd, "text")
3556

3657
return cmd

cmd/sim/evm/balance.go

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,31 @@ import (
1414
func NewBalanceCmd() *cobra.Command {
1515
cmd := &cobra.Command{
1616
Use: "balance <wallet_address>",
17-
Short: "Get balance for a single token",
18-
Long: "Return the balance of a single token for the given wallet address on one chain.\n" +
19-
"Use \"native\" as the --token value to query the native asset (e.g. ETH).\n\n" +
17+
Short: "Get the balance of a single token for a wallet on one chain",
18+
Long: "Return the balance of a specific token for the given wallet address on a\n" +
19+
"single EVM chain. This is a targeted lookup that returns exactly one balance\n" +
20+
"entry, unlike 'dune sim evm balances' which returns all tokens across chains.\n\n" +
21+
"Both --token and --chain-ids are required. Use the literal string 'native'\n" +
22+
"as the --token value to query the chain's native asset (e.g. ETH on Ethereum,\n" +
23+
"MATIC on Polygon), or pass an ERC20 contract address.\n\n" +
24+
"Response fields:\n" +
25+
" - chain, chain_id: network name and numeric ID\n" +
26+
" - address, symbol, name, decimals: token identity\n" +
27+
" - amount: raw balance (divide by 10^decimals for human-readable)\n" +
28+
" - price_usd, value_usd: current pricing and total value\n\n" +
29+
"For multi-token or multi-chain lookups, use 'dune sim evm balances' instead.\n\n" +
2030
"Examples:\n" +
2131
" dune sim evm balance 0xd8da... --token native --chain-ids 1\n" +
22-
" dune sim evm balance 0xd8da... --token 0xa0b8...eb48 --chain-ids 8453\n" +
23-
" dune sim evm balance 0xd8da... --token native --chain-ids 1 -o json",
32+
" dune sim evm balance 0xd8da... --token 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 --chain-ids 8453\n" +
33+
" dune sim evm balance 0xd8da... --token native --chain-ids 1 --historical-prices 168,24 -o json",
2434
Args: cobra.ExactArgs(1),
2535
RunE: runBalance,
2636
}
2737

28-
cmd.Flags().String("token", "", "Token contract address or \"native\" (required)")
29-
cmd.Flags().String("chain-ids", "", "Chain ID (required)")
30-
cmd.Flags().String("metadata", "", "Extra metadata fields: logo,url,pools")
31-
cmd.Flags().String("historical-prices", "", "Hour offsets for historical prices (e.g. 720,168,24)")
38+
cmd.Flags().String("token", "", "Token to query: an ERC20 contract address (0x...) or the literal string 'native' for the chain's native asset (required)")
39+
cmd.Flags().String("chain-ids", "", "Numeric EVM chain ID to query (required, single value, e.g. '1' for Ethereum, '8453' for Base)")
40+
cmd.Flags().String("metadata", "", "Request additional metadata fields in the response (comma-separated): 'logo' (token icon URL), 'url' (project website), 'pools' (liquidity pool details)")
41+
cmd.Flags().String("historical-prices", "", "Include historical USD prices at the specified hour offsets from now (comma-separated, e.g. '720,168,24' for 30d, 7d, 1d ago)")
3242
_ = cmd.MarkFlagRequired("token")
3343
_ = cmd.MarkFlagRequired("chain-ids")
3444
output.AddFormatFlag(cmd, "text")

cmd/sim/evm/balances.go

Lines changed: 28 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,35 @@ import (
1515
func NewBalancesCmd() *cobra.Command {
1616
cmd := &cobra.Command{
1717
Use: "balances <address>",
18-
Short: "Get EVM token balances for a wallet address",
19-
Long: "Return native and ERC20 token balances for the given wallet address\n" +
20-
"across supported EVM chains, including USD valuations.\n\n" +
18+
Short: "Get EVM token balances for a wallet address across multiple chains",
19+
Long: "Return native and ERC20 token balances for the given wallet address across\n" +
20+
"supported EVM chains. Each balance entry includes the token amount, current\n" +
21+
"USD price, and total USD value. Data comes from Dune's real-time index.\n\n" +
22+
"Response fields per balance:\n" +
23+
" - chain, chain_id: network name and numeric ID\n" +
24+
" - address: token contract address (or native asset identifier)\n" +
25+
" - symbol, name, decimals: token identity and precision\n" +
26+
" - amount: raw token balance (divide by 10^decimals for human-readable)\n" +
27+
" - price_usd, value_usd: current token price and total holding value\n" +
28+
" - low_liquidity: true if on-chain liquidity is thin (price may be unreliable)\n" +
29+
" - pool_size: USD liquidity depth of the pricing pool\n\n" +
30+
"By default, queries all chains tagged 'default'. Use --chain-ids to restrict\n" +
31+
"to specific networks. Run 'dune sim evm supported-chains' to see valid IDs.\n\n" +
32+
"For a single-token balance lookup, use 'dune sim evm balance' instead.\n" +
33+
"For stablecoin-only balances, use 'dune sim evm stablecoins'.\n\n" +
34+
"Results are paginated; use --offset with the next_offset value from a\n" +
35+
"previous response to retrieve additional pages.\n\n" +
2136
"Examples:\n" +
2237
" dune sim evm balances 0xd8da6bf26964af9d7eed9e03e53415d37aa96045\n" +
2338
" dune sim evm balances 0xd8da... --chain-ids 1,8453 --exclude-spam\n" +
24-
" dune sim evm balances 0xd8da... --historical-prices 168 -o json",
39+
" dune sim evm balances 0xd8da... --filters erc20 --metadata logo,url\n" +
40+
" dune sim evm balances 0xd8da... --historical-prices 720,168,24 -o json",
2541
Args: cobra.ExactArgs(1),
2642
RunE: runBalances,
2743
}
2844

2945
addBalanceFlags(cmd)
30-
cmd.Flags().String("asset-class", "", "Asset class filter: stablecoin")
46+
cmd.Flags().String("asset-class", "", "Filter by asset classification: 'stablecoin' (returns only stablecoins like USDC, USDT, DAI); prefer 'dune sim evm stablecoins' as a shorthand")
3147

3248
return cmd
3349
}
@@ -103,13 +119,13 @@ func runBalances(cmd *cobra.Command, args []string) error {
103119
// addBalanceFlags registers the common flags shared by the balances and
104120
// stablecoins commands.
105121
func addBalanceFlags(cmd *cobra.Command) {
106-
cmd.Flags().String("chain-ids", "", "Comma-separated chain IDs or tags (default: all default chains)")
107-
cmd.Flags().String("filters", "", "Token filter: erc20 or native")
108-
cmd.Flags().String("metadata", "", "Extra metadata fields: logo,url,pools")
109-
cmd.Flags().Bool("exclude-spam", false, "Exclude tokens with <100 USD liquidity")
110-
cmd.Flags().String("historical-prices", "", "Hour offsets for historical prices (e.g. 720,168,24)")
111-
cmd.Flags().Int("limit", 0, "Max results (1-1000)")
112-
cmd.Flags().String("offset", "", "Pagination cursor from previous response")
122+
cmd.Flags().String("chain-ids", "", "Restrict to specific chains by numeric ID or tag name (comma-separated, e.g. '1,8453' or 'default'); defaults to all chains tagged 'default'. Run 'dune sim evm supported-chains' for valid values")
123+
cmd.Flags().String("filters", "", "Filter by token standard: 'erc20' (only ERC20 tokens) or 'native' (only native chain assets like ETH)")
124+
cmd.Flags().String("metadata", "", "Request additional metadata fields in the response (comma-separated): 'logo' (token icon URL), 'url' (project website), 'pools' (liquidity pool details)")
125+
cmd.Flags().Bool("exclude-spam", false, "Exclude low-liquidity tokens (less than $100 USD pool size) commonly associated with spam airdrops")
126+
cmd.Flags().String("historical-prices", "", "Include historical USD prices at the specified hour offsets from now (comma-separated, e.g. '720,168,24' for 30d, 7d, 1d ago)")
127+
cmd.Flags().Int("limit", 0, "Maximum number of balance entries to return per page (1-1000, default: server-determined)")
128+
cmd.Flags().String("offset", "", "Pagination cursor returned as next_offset in a previous response; use to fetch the next page of results")
113129
output.AddFormatFlag(cmd, "text")
114130
}
115131

cmd/sim/evm/collectibles.go

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,40 @@ import (
1414
func NewCollectiblesCmd() *cobra.Command {
1515
cmd := &cobra.Command{
1616
Use: "collectibles <address>",
17-
Short: "Get NFT collectibles for a wallet address",
18-
Long: "Return ERC721 and ERC1155 collectibles (NFTs) held by the given wallet address\n" +
19-
"across supported EVM chains. Spam filtering is enabled by default.\n\n" +
17+
Short: "Get NFT collectibles (ERC721/ERC1155) held by a wallet address",
18+
Long: "Return ERC721 and ERC1155 collectibles (NFTs) held by the given wallet\n" +
19+
"address across supported EVM chains. Results include token metadata, images,\n" +
20+
"and acquisition timestamps. Spam filtering is enabled by default to hide\n" +
21+
"airdropped junk NFTs.\n\n" +
22+
"Response fields per collectible:\n" +
23+
" - contract_address: NFT collection contract\n" +
24+
" - token_id: unique token identifier within the collection\n" +
25+
" - token_standard: 'erc721' or 'erc1155'\n" +
26+
" - chain, chain_id: network name and numeric ID\n" +
27+
" - name, symbol, description: collection metadata\n" +
28+
" - image_url: token image (may be IPFS, HTTP, or data URI)\n" +
29+
" - balance: quantity held (always '1' for ERC721, may be >1 for ERC1155)\n" +
30+
" - last_acquired: timestamp of most recent acquisition\n" +
31+
" - is_spam, spam_score: spam classification (visible with --show-spam-scores)\n\n" +
32+
"Spam filtering uses a scoring model based on collection traits (holder count,\n" +
33+
"transfer patterns, metadata quality). Disable with --filter-spam=false to see\n" +
34+
"all NFTs including suspected spam.\n\n" +
35+
"By default, queries all chains tagged 'default'. Run 'dune sim evm\n" +
36+
"supported-chains' to see which chains support collectibles.\n\n" +
2037
"Examples:\n" +
2138
" dune sim evm collectibles 0xd8da6bf26964af9d7eed9e03e53415d37aa96045\n" +
2239
" dune sim evm collectibles 0xd8da... --chain-ids 1\n" +
23-
" dune sim evm collectibles 0xd8da... --filter-spam=false --show-spam-scores -o json",
40+
" dune sim evm collectibles 0xd8da... --filter-spam=false --show-spam-scores -o json\n" +
41+
" dune sim evm collectibles 0xd8da... --limit 100 -o json",
2442
Args: cobra.ExactArgs(1),
2543
RunE: runCollectibles,
2644
}
2745

28-
cmd.Flags().String("chain-ids", "", "Comma-separated chain IDs or tags (default: all default chains)")
29-
cmd.Flags().Bool("filter-spam", true, "Hide collectibles identified as spam")
30-
cmd.Flags().Bool("show-spam-scores", false, "Include spam scoring details")
31-
cmd.Flags().Int("limit", 0, "Max results per page (1-2500, default 250)")
32-
cmd.Flags().String("offset", "", "Pagination cursor from previous response")
46+
cmd.Flags().String("chain-ids", "", "Restrict to specific chains by numeric ID or tag name (comma-separated, e.g. '1,8453' or 'default'); defaults to all chains tagged 'default'")
47+
cmd.Flags().Bool("filter-spam", true, "Hide collectibles identified as spam by the scoring model (default: true); set --filter-spam=false to include all NFTs")
48+
cmd.Flags().Bool("show-spam-scores", false, "Include spam classification details in the response: is_spam flag, numeric spam_score, and per-feature explanations with weights")
49+
cmd.Flags().Int("limit", 0, "Maximum number of collectibles to return per page (1-2500, default: 250)")
50+
cmd.Flags().String("offset", "", "Pagination cursor returned as next_offset in a previous response; use to fetch the next page of results")
3351
output.AddFormatFlag(cmd, "text")
3452

3553
return cmd

cmd/sim/evm/defi_positions.go

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,30 @@ import (
1818
func NewDefiPositionsCmd() *cobra.Command {
1919
cmd := &cobra.Command{
2020
Use: "defi-positions <address>",
21-
Short: "Get DeFi positions for a wallet address",
22-
Long: "Return DeFi positions for the given wallet address including USD values,\n" +
23-
"position-specific metadata, and aggregation summaries across supported protocols.\n\n" +
24-
"Supported position types: Erc4626 (vaults), Tokenized (lending, e.g. aTokens),\n" +
25-
"UniswapV2 (AMM LP), Nft (Uniswap V3 NFT), NftV4 (Uniswap V4 NFT).\n\n" +
21+
Short: "Get DeFi positions (lending, LPs, vaults) for a wallet address",
22+
Long: "Return DeFi positions for the given wallet address across supported EVM\n" +
23+
"chains and protocols. Each position includes USD valuation and protocol-\n" +
24+
"specific metadata. The response also includes aggregation summaries with\n" +
25+
"total USD value and per-chain breakdowns.\n\n" +
26+
"Note: This endpoint is in beta (served under /beta/evm/defi/positions/*).\n\n" +
27+
"Supported position types:\n" +
28+
" - Erc4626: ERC-4626 vault positions (e.g. yield vaults, staking wrappers)\n" +
29+
" - Tokenized: lending protocol positions with receipt tokens (e.g. Aave\n" +
30+
" aTokens, Compound cTokens)\n" +
31+
" - UniswapV2: AMM liquidity provider positions (Uniswap V2 and forks)\n" +
32+
" - Nft: Uniswap V3 concentrated liquidity positions (NFT-based)\n" +
33+
" - NftV4: Uniswap V4 concentrated liquidity positions (NFT-based)\n\n" +
34+
"Response fields per position:\n" +
35+
" - type: position type discriminator (see above)\n" +
36+
" - chain_id: numeric EVM chain ID\n" +
37+
" - usd_value: total USD value of the position\n" +
38+
" - protocol: protocol name (e.g. 'uniswap_v3', 'aave_v3')\n" +
39+
" - Type-specific fields: token symbols, underlying assets, pool info,\n" +
40+
" calculated balances, tick ranges (for concentrated liquidity)\n\n" +
41+
"Aggregations (in JSON output):\n" +
42+
" - total_usd_value: sum of all position values\n" +
43+
" - total_by_chain: USD value grouped by chain ID\n\n" +
44+
"Run 'dune sim evm supported-chains' to see which chains support defi-positions.\n\n" +
2645
"Examples:\n" +
2746
" dune sim evm defi-positions 0xd8da6bf26964af9d7eed9e03e53415d37aa96045\n" +
2847
" dune sim evm defi-positions 0xd8da... --chain-ids 1,8453\n" +
@@ -31,7 +50,7 @@ func NewDefiPositionsCmd() *cobra.Command {
3150
RunE: runDefiPositions,
3251
}
3352

34-
cmd.Flags().String("chain-ids", "", "Comma-separated chain IDs or tags (default: all default chains)")
53+
cmd.Flags().String("chain-ids", "", "Restrict to specific chains by numeric ID or tag name (comma-separated, e.g. '1,8453' or 'default'); defaults to all chains tagged 'default'")
3554
output.AddFormatFlag(cmd, "text")
3655

3756
return cmd

0 commit comments

Comments
 (0)