Skip to content

Commit fd7afb6

Browse files
authored
AI friendly sim cli descriptions (#43)
* AI friendly sim cli descriptions * update install.sh to include sim too * simplify response descriptions
1 parent 272151c commit fd7afb6

17 files changed

Lines changed: 280 additions & 102 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: 26 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -14,23 +14,39 @@ 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+
"Each activity item includes the transaction context, transfer amounts with\n" +
30+
"USD values, and token metadata. Swap entries include both sides of the trade.\n" +
31+
"Call entries include the decoded function name and inputs.\n\n" +
32+
"By default, returns all activity types across all default chains.\n" +
33+
"Run 'dune sim evm supported-chains' to see which chains support activity.\n\n" +
34+
"For raw transaction data (hashes, gas, calldata), use 'dune sim evm transactions'.\n\n" +
2035
"Examples:\n" +
2136
" dune sim evm activity 0xd8da6bf26964af9d7eed9e03e53415d37aa96045\n" +
2237
" 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",
38+
" dune sim evm activity 0xd8da... --asset-type erc20 --limit 50 -o json\n" +
39+
" dune sim evm activity 0xd8da... --token-address 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48",
2440
Args: cobra.ExactArgs(1),
2541
RunE: runActivity,
2642
}
2743

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")
44+
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'")
45+
cmd.Flags().String("token-address", "", "Filter activities involving specific token contracts (comma-separated ERC20/ERC721/ERC1155 addresses)")
46+
cmd.Flags().String("activity-type", "", "Filter by activity classification (comma-separated): send, receive, mint, burn, swap, approve, call; defaults to all types")
47+
cmd.Flags().String("asset-type", "", "Filter by token standard (comma-separated): native, erc20, erc721, erc1155; defaults to all standards")
48+
cmd.Flags().Int("limit", 0, "Maximum number of activity items to return per page (1-100, default: server-determined)")
49+
cmd.Flags().String("offset", "", "Pagination cursor returned as next_offset in a previous response; use to fetch the next page of results")
3450
output.AddFormatFlag(cmd, "text")
3551

3652
return cmd

cmd/sim/evm/balance.go

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,21 +14,26 @@ 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+
"For multi-token or multi-chain lookups, use 'dune sim evm balances' instead.\n\n" +
2025
"Examples:\n" +
2126
" 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",
27+
" dune sim evm balance 0xd8da... --token 0xa0b86991c6218b36c1d19d4a2e9eb0ce3606eb48 --chain-ids 8453\n" +
28+
" dune sim evm balance 0xd8da... --token native --chain-ids 1 --historical-prices 168,24 -o json",
2429
Args: cobra.ExactArgs(1),
2530
RunE: runBalance,
2631
}
2732

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)")
33+
cmd.Flags().String("token", "", "Token to query: an ERC20 contract address (0x...) or the literal string 'native' for the chain's native asset (required)")
34+
cmd.Flags().String("chain-ids", "", "Numeric EVM chain ID to query (required, single value, e.g. '1' for Ethereum, '8453' for Base)")
35+
cmd.Flags().String("metadata", "", "Request additional metadata fields in the response (comma-separated): 'logo' (token icon URL), 'url' (project website), 'pools' (liquidity pool details)")
36+
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)")
3237
_ = cmd.MarkFlagRequired("token")
3338
_ = cmd.MarkFlagRequired("chain-ids")
3439
output.AddFormatFlag(cmd, "text")

cmd/sim/evm/balances.go

Lines changed: 21 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -15,19 +15,28 @@ 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 identity, raw\n" +
21+
"balance amount, current USD price, total USD value, and liquidity indicators.\n" +
22+
"Data comes from Dune's real-time index.\n\n" +
23+
"By default, queries all chains tagged 'default'. Use --chain-ids to restrict\n" +
24+
"to specific networks. Run 'dune sim evm supported-chains' to see valid IDs.\n\n" +
25+
"For a single-token balance lookup, use 'dune sim evm balance' instead.\n" +
26+
"For stablecoin-only balances, use 'dune sim evm stablecoins'.\n\n" +
27+
"Results are paginated; use --offset with the next_offset value from a\n" +
28+
"previous response to retrieve additional pages.\n\n" +
2129
"Examples:\n" +
2230
" dune sim evm balances 0xd8da6bf26964af9d7eed9e03e53415d37aa96045\n" +
2331
" dune sim evm balances 0xd8da... --chain-ids 1,8453 --exclude-spam\n" +
24-
" dune sim evm balances 0xd8da... --historical-prices 168 -o json",
32+
" dune sim evm balances 0xd8da... --filters erc20 --metadata logo,url\n" +
33+
" dune sim evm balances 0xd8da... --historical-prices 720,168,24 -o json",
2534
Args: cobra.ExactArgs(1),
2635
RunE: runBalances,
2736
}
2837

2938
addBalanceFlags(cmd)
30-
cmd.Flags().String("asset-class", "", "Asset class filter: stablecoin")
39+
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")
3140

3241
return cmd
3342
}
@@ -103,13 +112,13 @@ func runBalances(cmd *cobra.Command, args []string) error {
103112
// addBalanceFlags registers the common flags shared by the balances and
104113
// stablecoins commands.
105114
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")
115+
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")
116+
cmd.Flags().String("filters", "", "Filter by token standard: 'erc20' (only ERC20 tokens) or 'native' (only native chain assets like ETH)")
117+
cmd.Flags().String("metadata", "", "Request additional metadata fields in the response (comma-separated): 'logo' (token icon URL), 'url' (project website), 'pools' (liquidity pool details)")
118+
cmd.Flags().Bool("exclude-spam", false, "Exclude low-liquidity tokens (less than $100 USD pool size) commonly associated with spam airdrops")
119+
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)")
120+
cmd.Flags().Int("limit", 0, "Maximum number of balance entries to return per page (1-1000, default: server-determined)")
121+
cmd.Flags().String("offset", "", "Pagination cursor returned as next_offset in a previous response; use to fetch the next page of results")
113122
output.AddFormatFlag(cmd, "text")
114123
}
115124

cmd/sim/evm/collectibles.go

Lines changed: 18 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,22 +14,31 @@ 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. Each entry includes the collection and\n" +
20+
"token identity, image URL, quantity held, acquisition timestamp, and spam\n" +
21+
"classification when requested. Spam filtering is enabled by default to hide\n" +
22+
"airdropped junk NFTs.\n\n" +
23+
"Spam filtering uses a scoring model based on collection traits (holder count,\n" +
24+
"transfer patterns, metadata quality). Disable with --filter-spam=false to see\n" +
25+
"all NFTs including suspected spam.\n\n" +
26+
"By default, queries all chains tagged 'default'. Run 'dune sim evm\n" +
27+
"supported-chains' to see which chains support collectibles.\n\n" +
2028
"Examples:\n" +
2129
" dune sim evm collectibles 0xd8da6bf26964af9d7eed9e03e53415d37aa96045\n" +
2230
" dune sim evm collectibles 0xd8da... --chain-ids 1\n" +
23-
" dune sim evm collectibles 0xd8da... --filter-spam=false --show-spam-scores -o json",
31+
" dune sim evm collectibles 0xd8da... --filter-spam=false --show-spam-scores -o json\n" +
32+
" dune sim evm collectibles 0xd8da... --limit 100 -o json",
2433
Args: cobra.ExactArgs(1),
2534
RunE: runCollectibles,
2635
}
2736

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")
37+
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'")
38+
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")
39+
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")
40+
cmd.Flags().Int("limit", 0, "Maximum number of collectibles to return per page (1-2500, default: 250)")
41+
cmd.Flags().String("offset", "", "Pagination cursor returned as next_offset in a previous response; use to fetch the next page of results")
3342
output.AddFormatFlag(cmd, "text")
3443

3544
return cmd

cmd/sim/evm/defi_positions.go

Lines changed: 19 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,24 @@ 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+
"Each position includes the chain, USD value, protocol name, and type-\n" +
35+
"specific details (token identities, pool info, balances). The response\n" +
36+
"also includes aggregation summaries with total value and per-chain\n" +
37+
"breakdowns. Use -o json for the full structured response.\n\n" +
38+
"Run 'dune sim evm supported-chains' to see which chains support defi-positions.\n\n" +
2639
"Examples:\n" +
2740
" dune sim evm defi-positions 0xd8da6bf26964af9d7eed9e03e53415d37aa96045\n" +
2841
" dune sim evm defi-positions 0xd8da... --chain-ids 1,8453\n" +
@@ -31,7 +44,7 @@ func NewDefiPositionsCmd() *cobra.Command {
3144
RunE: runDefiPositions,
3245
}
3346

34-
cmd.Flags().String("chain-ids", "", "Comma-separated chain IDs or tags (default: all default chains)")
47+
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'")
3548
output.AddFormatFlag(cmd, "text")
3649

3750
return cmd

cmd/sim/evm/evm.go

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,25 @@ func SimClientFromCmd(cmd *cobra.Command) SimClient {
3232
func NewEvmCmd() *cobra.Command {
3333
cmd := &cobra.Command{
3434
Use: "evm",
35-
Short: "Query EVM chain data (balances, activity, transactions, etc.)",
36-
Long: "Access real-time EVM blockchain data including token balances, activity feeds,\n" +
37-
"transaction history, NFT collectibles, token metadata, token holders,\n" +
38-
"and DeFi positions.",
35+
Short: "Query EVM chain data (balances, activity, transactions, tokens, NFTs, DeFi)",
36+
Long: "Access real-time, indexed EVM blockchain data. All commands accept an\n" +
37+
"Ethereum-style address (0x...) as the primary argument and return data\n" +
38+
"across multiple EVM chains simultaneously.\n\n" +
39+
"Available subcommands:\n" +
40+
" supported-chains - List all supported EVM chains and endpoint availability (public, no auth)\n" +
41+
" balances - Native + ERC20 token balances with USD valuations\n" +
42+
" balance - Single-token balance lookup on one chain\n" +
43+
" stablecoins - Stablecoin-only balances (USDC, USDT, DAI, etc.)\n" +
44+
" activity - Chronological feed of transfers, swaps, mints, burns, approvals\n" +
45+
" transactions - Raw transaction history with optional ABI decoding\n" +
46+
" collectibles - ERC721 and ERC1155 NFT holdings with spam filtering\n" +
47+
" token-info - Token metadata, pricing, supply, and market cap\n" +
48+
" token-holders - Top holders of an ERC20 token ranked by balance\n" +
49+
" defi-positions - DeFi positions across lending, AMM, and vault protocols (beta)\n\n" +
50+
"Most commands support --chain-ids to restrict results to specific networks.\n" +
51+
"Run 'dune sim evm supported-chains' to discover valid chain IDs, tags, and\n" +
52+
"which endpoints are available per chain.\n\n" +
53+
"All commands except 'supported-chains' require a Sim API key.",
3954
}
4055

4156
cmd.AddCommand(NewSupportedChainsCmd())

cmd/sim/evm/stablecoins.go

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,20 @@ import (
88
func NewStablecoinsCmd() *cobra.Command {
99
cmd := &cobra.Command{
1010
Use: "stablecoins <address>",
11-
Short: "Get stablecoin balances for a wallet address",
12-
Long: "Return stablecoin balances for the given wallet address across supported\n" +
13-
"EVM chains, including USD valuations.\n\n" +
11+
Short: "Get stablecoin balances for a wallet address across multiple chains",
12+
Long: "Return only stablecoin balances (USDC, USDT, DAI, FRAX, etc.) for the given\n" +
13+
"wallet address across supported EVM chains. This is a convenience shorthand\n" +
14+
"for 'dune sim evm balances <address> --asset-class stablecoin'.\n\n" +
15+
"Each balance entry includes the token amount, current USD price, and total\n" +
16+
"USD value. The same response format and pagination as 'dune sim evm balances'\n" +
17+
"applies.\n\n" +
18+
"By default, queries all chains tagged 'default'. Use --chain-ids to restrict\n" +
19+
"to specific networks. Run 'dune sim evm supported-chains' for valid IDs.\n\n" +
20+
"For all token balances (not just stablecoins), use 'dune sim evm balances'.\n\n" +
1421
"Examples:\n" +
1522
" dune sim evm stablecoins 0xd8da6bf26964af9d7eed9e03e53415d37aa96045\n" +
1623
" dune sim evm stablecoins 0xd8da... --chain-ids 1,8453\n" +
17-
" dune sim evm stablecoins 0xd8da... -o json",
24+
" dune sim evm stablecoins 0xd8da... --exclude-spam -o json",
1825
Args: cobra.ExactArgs(1),
1926
RunE: runStablecoins,
2027
}

0 commit comments

Comments
 (0)