Skip to content

Conversation

pranavkonde
Copy link
Contributor

Add Pipe Command for Command Chaining

Overview

Introduced a powerful pipe command that allows chaining multiple CLI commands together, enabling automated blockchain workflows where the output of one command automatically becomes the input for the next command.

Features Added

Core Pipe Functionality

  • Command Chaining: Chain multiple commands using Unix-style pipe syntax (|)
  • Automatic Data Passing: Seamless data flow between commands
  • Sequential Execution: Commands execute in order with proper error handling
  • Progress Feedback: Clear status updates for each command in the chain

Supported Commands

  • transfer → Transfer RBTC or ERC20 tokens
  • tx → Check transaction status
  • deploy → Deploy smart contracts
  • verify → Verify contracts on explorer
  • balance → Check wallet balance

Supported Workflows

  • Transfer → Status Check: transfer | tx
  • Deploy → Verify: deploy | verify
  • Transfer → Status → Balance: transfer | tx | balance
  • Custom Chains: Any combination of supported commands

Key Benefits

Automation

# Before: Manual workflow
rsk-cli transfer --testnet --address 0x... --value 0.001
# Copy transaction hash manually
rsk-cli tx --testnet --txid 0xabc123...

# After: Automated workflow
rsk-cli pipe "transfer --testnet --address 0x... --value 0.001 | tx --testnet"

Data Flow

  • transfer outputs: transactionHash, from, to, amount, token, network
  • deploy outputs: contractAddress, transactionHash, network
  • tx accepts: transactionHash from previous command
  • verify accepts: contractAddress from previous command

Basic Transfer Workflow

rsk-cli pipe "transfer --testnet --address 0x8A0d290b2EE35eFde47810CA8fF057e109e4190B --value 0.001 | tx --testnet"

Deploy and Verify Contract

rsk-cli pipe "deploy --abi contract.abi --bytecode contract.bin --testnet --args 'TestContract' 100 | verify --json input.json --name MyContract --testnet"

Complex Multi-Command Chain

rsk-cli pipe "transfer --testnet --address 0x... --value 0.001 | tx --testnet | balance --testnet"

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.

1 participant