Skip to content

Conversation

@aelmanaa
Copy link
Collaborator

This pull request introduces a major redesign of the CLI argument structure for the ccip-cli tool, aligning it with industry-standard CLI conventions and improving usability and safety. The changes affect both the documentation and the implementation of several commands, notably send, getSupportedTokens, and token. The update replaces positional arguments with named arguments for commands with multiple or similar-type parameters, clarifies alias usage, and updates help texts and examples throughout the codebase and documentation.

CLI Argument Standardization and Usability Improvements:

  • Converted major commands (send, getSupportedTokens, token) to use named arguments (e.g., --source, --dest, --router) instead of positionals, preventing argument order mistakes and improving clarity. This includes updating aliases and help texts for all relevant options. [1] [2] [3] [4] [5] [6] [7]

  • Updated CLI documentation in README.md and CONTRIBUTING.md to reflect new argument conventions, provide rationale for argument design, and add detailed guidelines and examples for contributors and users. [1] [2] [3] [4] [5] [6]

  • Changed the global RPC option from -r/--rpcs to --rpc/--rpcs to avoid conflicts; -r is now reserved for command-specific options like --router. Updated all relevant documentation and tests. [1] [2] [3] [4]

Command-Specific Enhancements:

  • send command: Now uses named arguments for source, destination, and router; improved help descriptions and added usage examples. [1] [2] [3]

  • getSupportedTokens command: Now uses named arguments for network and address, with optional token; updated documentation and examples. [1] [2] [3]

  • Introduced a new token command for querying native and token balances, using named arguments for network and holder, with optional token address. [1] [2]

SDK and Internal Improvements:

  • Added NetworkType enum and networkType property to NetworkInfo in the SDK, and improved selector generation script validation.

These changes collectively make the CLI safer, more intuitive, and easier to maintain, while also aligning with best practices from other major CLI tools.

@aelmanaa aelmanaa requested a review from a team as a code owner January 27, 2026 15:46
@vercel
Copy link

vercel bot commented Jan 27, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
ccip-tools-ts Error Error Jan 27, 2026 10:47pm

Request Review

@github-actions
Copy link

👋 aelmanaa, thanks for creating this pull request!

To help reviewers, please consider creating future PRs as drafts first. This allows you to self-review and make any final changes before notifying the team.

Once you're ready, you can mark it as "Ready for review" to request feedback. Thanks!

@github-actions
Copy link

github-actions bot commented Jan 27, 2026

Coverage Report

ℹ tests 639
ℹ suites 195
ℹ pass 639
ℹ fail 0
ℹ cancelled 0
ℹ skipped 0
ℹ todo 0
ℹ duration_ms 67523.414346
-------------------------------|---------|----------|---------|---------|---------------------------
File                           | % Stmts | % Branch | % Funcs | % Lines | Uncovered Line #s         
-------------------------------|---------|----------|---------|---------|---------------------------
All files                      |   65.43 |    79.16 |   53.87 |   65.43 |                           
 ccip-cli/src                  |   86.45 |    83.33 |      50 |   86.45 |                           
  index.ts                     |   86.45 |    83.33 |      50 |   86.45 | 72-76,82-83,88-93         
 ccip-cli/src/commands         |    51.3 |    78.21 |   52.08 |    51.3 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  lane-latency.ts              |   67.74 |     87.5 |   33.33 |   67.74 | 23-37,44-51,85-91         
  manual-exec.ts               |   19.73 |      100 |       0 |   19.73 | 37-101,108-118,120-226    
  parse.ts                     |   41.79 |      100 |       0 |   41.79 | 22-26,33-40,42-67         
  send.ts                      |   11.42 |      100 |       0 |   11.42 | 30-131,138-145,147-315    
  show.ts                      |   90.35 |    63.82 |      60 |   90.35 | ...20-126,132-134,143-144 
  supported-tokens.ts          |   22.48 |      100 |       0 |   22.48 | ...94-186,188-243,245-258 
  token.ts                     |   22.72 |      100 |       0 |   22.72 | 24-53,60-67,69-132        
  types.ts                     |     100 |      100 |     100 |     100 |                           
  utils.ts                     |   86.59 |    82.05 |    91.3 |   86.59 | ...99-517,524-532,542-548 
 ccip-cli/src/providers        |   53.63 |       75 |   17.39 |   53.63 |                           
  aptos.ts                     |   53.65 |      100 |       0 |   53.65 | ...70,78-85,91-92,101-123 
  evm.ts                       |   46.03 |      100 |       0 |   46.03 | 20,31-63                  
  index.ts                     |   81.49 |    72.09 |      80 |   81.49 | 49-50,188-227             
  solana.ts                    |   50.42 |      100 |       0 |   50.42 | ...-71,79-85,89-90,99-117 
  sui.ts                       |   64.28 |      100 |       0 |   64.28 | 10-14                     
  ton.ts                       |   14.58 |      100 |       0 |   14.58 | 22-144                    
 ccip-sdk/src                  |   93.48 |    86.79 |   91.93 |   93.48 |                           
  chain.ts                     |   91.48 |    78.78 |      70 |   91.48 | ...46,358-363,633,691-700 
  commits.ts                   |     100 |    88.88 |     100 |     100 | 35,52                     
  execution.ts                 |   84.61 |      100 |      75 |   84.61 | 122-143                   
  explorer.ts                  |     100 |      100 |     100 |     100 |                           
  extra-args.ts                |     100 |    85.71 |     100 |     100 | 71,90                     
  gas.ts                       |   90.75 |       50 |     100 |   90.75 | 73-78,100-104             
  http-status.ts               |     100 |      100 |     100 |     100 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  offchain.ts                  |     100 |      100 |     100 |     100 |                           
  requests.ts                  |   86.38 |    82.22 |    87.5 |   86.38 | ...16,324,349-350,354-355 
  supported-chains.ts          |     100 |      100 |     100 |     100 |                           
  types.ts                     |     100 |      100 |     100 |     100 |                           
  utils.ts                     |   95.13 |    89.39 |     100 |   95.13 | ...74,538-539,555,620-628 
 ccip-sdk/src/api              |   97.92 |    79.24 |     100 |   97.92 |                           
  index.ts                     |   97.92 |    79.24 |     100 |   97.92 | ...05-206,286-287,351-352 
 ccip-sdk/src/aptos            |   57.65 |    69.93 |   59.37 |   57.65 |                           
  exec.ts                      |   29.31 |      100 |       0 |   29.31 | 18-58                     
  hasher.ts                    |   76.31 |       80 |   66.66 |   76.31 | 19-38,52-58               
  index.ts                     |   58.45 |    74.07 |   61.36 |   58.45 | ...04-739,743-836,840-851 
  logs.ts                      |   78.52 |    57.44 |      75 |   78.52 | ...90-196,200-233,264-268 
  send.ts                      |    25.2 |      100 |       0 |    25.2 | 10-51,62-79,92-123        
  token.ts                     |   23.75 |       75 |     100 |   23.75 | 35-156                    
  types.ts                     |   69.72 |      100 |       0 |   69.72 | 25-32,77-101              
  utils.ts                     |     100 |      100 |     100 |     100 |                           
 ccip-sdk/src/errors           |   79.29 |    77.22 |   47.05 |   79.29 |                           
  CCIPError.ts                 |     100 |      100 |     100 |     100 |                           
  codes.ts                     |     100 |      100 |     100 |     100 |                           
  index.ts                     |     100 |      100 |     100 |     100 |                           
  recovery.ts                  |     100 |      100 |     100 |     100 |                           
  specialized.ts               |   71.18 |    72.78 |   44.24 |   71.18 | ...36,1744-1753,1761-1770 
  utils.ts                     |   94.52 |    77.77 |     100 |   94.52 | 16,18,23,25               
 ccip-sdk/src/evm              |   66.39 |    78.12 |    62.5 |   66.39 |                           
  const.ts                     |     100 |      100 |     100 |     100 |                           
  errors.ts                    |   82.48 |    78.46 |     100 |   82.48 | ...55-157,188-195,198-216 
  gas.ts                       |   97.98 |    53.84 |     100 |   97.98 | 71-72,74                  
  hasher.ts                    |     100 |     87.5 |     100 |     100 | 122                       
  index.ts                     |   57.92 |    85.16 |    56.6 |   57.92 | ...04,1408-1457,1494-1501 
  logs.ts                      |   33.99 |    46.66 |      25 |   33.99 | ...13-214,229-258,274-302 
  messages.ts                  |     100 |      100 |     100 |     100 |                           
  offchain.ts                  |   80.97 |    53.33 |      75 |   80.97 | ...51-153,157-171,197-202 
 ccip-sdk/src/evm/viem         |   77.72 |       92 |   69.23 |   77.72 |                           
  client-adapter.ts            |     100 |     92.3 |     100 |     100 | 48                        
  index.ts                     |     100 |      100 |     100 |     100 |                           
  wallet-adapter.ts            |   63.09 |     90.9 |   55.55 |   63.09 | ...6,53-73,91-124,131-157 
 ccip-sdk/src/hasher           |   94.29 |    78.94 |     100 |   94.29 |                           
  common.ts                    |     100 |      100 |     100 |     100 |                           
  hasher.ts                    |     100 |    66.66 |     100 |     100 | 19                        
  index.ts                     |     100 |      100 |     100 |     100 |                           
  merklemulti.ts               |   93.43 |       78 |     100 |   93.43 | ...59-260,306-307,315-316 
 ccip-sdk/src/solana           |   52.34 |    69.82 |   55.17 |   52.34 |                           
  cleanup.ts                   |   12.22 |      100 |       0 |   12.22 | 29-229                    
  exec.ts                      |    9.43 |      100 |       0 |    9.43 | ...68-343,345-384,386-498 
  hasher.ts                    |   96.58 |    81.81 |     100 |   96.58 | 67-70                     
  index.ts                     |   70.78 |    75.89 |   64.15 |   70.78 | ...37,1441-1465,1469-1490 
  logs.ts                      |   74.19 |    27.27 |     100 |   74.19 | ...,50-51,53-54,56-88,119 
  offchain.ts                  |   78.87 |     64.7 |      50 |   78.87 | ...,96-97,110-111,126-142 
  patchBorsh.ts                |   65.06 |    57.14 |      75 |   65.06 | 30-49,65-66,72-78         
  send.ts                      |   13.93 |      100 |       0 |   13.93 | ...57-246,259-325,327-366 
  types.ts                     |   74.46 |      100 |       0 |   74.46 | 36-47                     
  utils.ts                     |   54.62 |    77.77 |   54.54 |   54.62 | ...37-350,392-455,461-476 
 ccip-sdk/src/sui              |   31.61 |    90.38 |   17.24 |   31.61 |                           
  discovery.ts                 |   13.02 |      100 |       0 |   13.02 | 18-36,46-182,185-215      
  events.ts                    |   30.21 |      100 |       0 |   30.21 | ...83-154,199-288,296-321 
  hasher.ts                    |   98.16 |    66.66 |     100 |   98.16 | 33,49                     
  index.ts                     |   36.05 |       95 |   16.27 |   36.05 | ...33-834,838-839,843-844 
  objects.ts                   |   12.77 |      100 |       0 |   12.77 | ...05-146,157-207,218-360 
 ccip-sdk/src/sui/manuallyExec |   39.46 |      100 |       0 |   39.46 |                           
  encoder.ts                   |   47.67 |      100 |       0 |   47.67 | 42-86                     
  index.ts                     |    34.3 |      100 |       0 |    34.3 | 48-137                    
 ccip-sdk/src/ton              |   71.57 |    83.33 |   54.41 |   71.57 |                           
  exec.ts                      |     100 |      100 |     100 |     100 |                           
  hasher.ts                    |   77.95 |    77.77 |      75 |   77.95 | 99-107,155-186            
  index.ts                     |   68.94 |    75.47 |    41.3 |   68.94 | ...55,1059-1060,1064-1065 
  logs.ts                      |     100 |    98.43 |     100 |     100 | 56                        
  types.ts                     |   78.41 |    69.23 |   66.66 |   78.41 | ...-76,94,121-134,136-139 
  utils.ts                     |   60.88 |    83.72 |    87.5 |   60.88 | ...55-261,269-327,329-332 
-------------------------------|---------|----------|---------|---------|---------------------------

andrevmatos
andrevmatos previously approved these changes Jan 27, 2026
@andrevmatos andrevmatos merged commit a18ad38 into main Jan 27, 2026
10 of 11 checks passed
@andrevmatos andrevmatos deleted the cli-send-params branch January 27, 2026 23:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants