asterisk-cli

Crates.ioasterisk-cli
lib.rsasterisk-cli
version1.0.0
sourcesrc
created_at2024-12-04 01:41:03.492863
updated_at2024-12-04 02:21:24.357798
descriptionA lightweight command-line tool for rapidly testing API endpoints
homepage
repository
max_upload_size
id1470901
size84,739
saint (saint0x)

documentation

README

Asterisk: Universal API Testing CLI

A lightweight, cross-platform command-line tool for rapidly testing API endpoints across different project structures and frameworks.

Installation

cargo install asterisk-cli

Usage

asterisk <server-file> <endpoint> <method> [options]

Arguments

  • 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)

Options

  • --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)

Examples

# 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"

Features

  • 🔍 Intelligent endpoint matching
  • 🚀 Framework-agnostic route detection
  • 📝 Support for JSON payloads
  • 🔒 Authentication handling
  • ⚡ Request timing information
  • 🎯 Fuzzy matching for endpoints

Supported Frameworks

  • Express.js
  • Fastify
  • NestJS
  • Spring Boot
  • Flask
  • And more...
Commit count: 0

cargo fmt