Crates.io | asterisk-cli |
lib.rs | asterisk-cli |
version | 1.0.0 |
source | src |
created_at | 2024-12-04 01:41:03.492863 |
updated_at | 2024-12-04 02:21:24.357798 |
description | A lightweight command-line tool for rapidly testing API endpoints |
homepage | |
repository | |
max_upload_size | |
id | 1470901 |
size | 84,739 |
A lightweight, cross-platform command-line tool for rapidly testing API endpoints across different project structures and frameworks.
cargo install asterisk-cli
asterisk <server-file> <endpoint> <method> [options]
server-file
: Path to your server/API definition file (navigate to server directory and it accepts file name)endpoint
: Endpoint name or path (e.g., "users" or "api/users")method
: HTTP method (GET, POST, PUT, DELETE, PATCH)--body <json>
: Request body as JSON string--headers <headers>
: Custom headers (format: "key1:value1,key2:value2")--bearer <token>
: Bearer token for authentication--base-url <url>
: Base URL (default: http://localhost:3000)--timing
: Show request timing information--test
: Test mode (no actual request sent)# Basic GET request
asterisk server.js users GET
# POST with JSON body
asterisk server.js users POST --body '{"name":"John","email":"john@example.com"}'
# Authenticated request
asterisk server.js protected GET --bearer "your-token-here"
# Custom headers and base URL
asterisk server.js users GET --headers "Accept:application/json,API-Key:123" --base-url "http://api.example.com"