beam
A simple cURL clone built with JavaScript that uses the @permaweb/aoconnect package.
Installation
git clone https://github.com/yourusername/beam.git
cd beam
npm install
npm install -g .
Usage
beam [options] <url>
Options
-X, --request <method>: Request method to use (default: "GET")
-H, --header <header>: Pass custom header(s) to server (can be used multiple times)
-d, --data <data>: HTTP POST data
-o, --output <file>: Write to file instead of stdout
-v, --verbose: Make the operation more talkative
-f, --file <file>: Read data from file
--raw: Display raw response data
-h, --help: Display help for command
-V, --version: Output the version number
Examples
beam https://example.com
beam -X POST -H "Content-Type: application/json" -d '{"key":"value"}' https://example.com/api
beam -X POST -H "Content-Type: application/json" -f data.json https://example.com/api
beam https://example.com -o response.txt
beam -v https://example.com
How it works
The beam CLI extracts headers from -H flags and data from -d flag, then uses the @permaweb/aoconnect package's request function to make HTTP requests. It organizes the URL, headers, and other parameters into tags that are compatible with the aoconnect API.
License
MIT