The x402 CLI is a professional command-line tool that enables seamless integration with the cutting-edge x402 payment protocol for instant internet payments over HTTP. Leveraging blockchain technology, this tool allows developers to simulate, test, and facilitate Solana-based micropayments quickly and securely. The x402 CLI simplifies the process of managing permissionless stablecoin payments, ideal for monetizing APIs, pay-per-use services, or premium content with minimal friction.
What is x402 CLI?
The x402 CLI, especially through the @solwarrior/x402-cli package, is designed to interact with the Solana blockchain’s implementation of the x402 standard. It allows sending SOL token payments, verifying transaction signatures, and managing persistent CLI configurations. This tool supports Solana devnet, testnet, and mainnet-beta networks with intuitive commands and colorful, user-friendly output, making blockchain payment integration accessible even for developers new to Solana.
Features and Benefits
- Send SOL Payments: Transfer SOL tokens on Solana devnet, mainnet-beta, or testnet with ease.
- Signature Verification: Confirm transaction authenticity, payment amounts, memos, and recipient addresses.
- Configuration Management: Persistent CLI settings that you can initialize and manage with
initcommands. - Wallet Integration: Secure, file-based keypair management for development and testing purposes.
- Beautiful CLI Output: Color-coded logs and progress indicators enhance the developer experience.
- Transaction Transparency: Direct links to Solana Explorer for easy verification of payments.
- Future Enhancements: Mock API servers, agent payment workflows, and facilitator services integration are planned features.
How to Get Started with @solwarrior/x402-cli
Install the CLI globally via npm:
bashnpm install -g @solwarrior/x402-cli
Or run without installation using npx:
bashnpx @solwarrior/x402-cli --help
A simple example to initialize configuration:
bashx402-cli init --network devnet --rpc-url https://api.devnet.solana.com
Send a payment command example:
bashx402-cli pay --recipient <RECIPIENT_ADDRESS> --amount 0.1 --from ~/.config/solana/id.json --network devnet
Verify transactions easily:
bashx402-cli verify <signature> --network devnet
For developers interested in contributions or advanced usage, the full source code and documentation are available on GitHub: sol-warrior/x402-cli GitHub Repository
Explore More on x402 Payments
For a comprehensive understanding of the x402 payment protocol and how to implement instant internet payments, visit the detailed resource: x402 Payment Protocol Instant Internet Payments.
Use it to send SOL payments on your chosen Solana network and verify transactions as part of your application’s payment workflow. This package complements middleware tools and other x402 ecosystem components, making paywall and instant payment integration straightforward.