Skip to content

A lightweight HTTP testing tool that reads `.hit` files and executes HTTP requests with support for variables, comments, parallel execution, and comprehensive reporting.

Notifications You must be signed in to change notification settings

Mahmoud-Emad/hitman-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

15 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Hitman 🎯

VS Code Extension Crates.io GitHub Release

A lightweight, fast, and intuitive HTTP testing tool that reads .hit files and executes HTTP requests with support for variables, comments, and parallel execution.

✨ Features

  • πŸš€ Simple Syntax: Easy-to-read .hit file format
  • πŸ”§ Variable Support: Define and reuse variables with {{variable}} syntax
  • πŸ“ Multiple Comment Styles: #, //, and /* */ comments
  • ⚑ Parallel Execution: Run requests concurrently for faster testing
  • 🎨 Rich CLI: Comprehensive command-line interface with colored output
  • πŸ“Š JSON Reports: Generate detailed execution reports
  • πŸ” Dry Run Mode: Validate syntax without sending requests
  • 🌐 Cross-Platform: Available for Linux, macOS, and Windows
  • 🎯 VS Code Extension: Official extension with syntax highlighting and IntelliSense

πŸ“¦ Installation

Pre-built Binaries

Download from GitHub Releases β†’

  • Linux (x86_64): hitman-linux-x86_64.tar.gz
  • Linux (ARM64): hitman-linux-aarch64.tar.gz
  • macOS (Intel): hitman-macos-x86_64.tar.gz
  • macOS (Apple Silicon): hitman-macos-aarch64.tar.gz
  • Windows (x86_64): hitman-windows-x86_64.zip

Package Managers

# Rust/Cargo
cargo install hitman

# Homebrew (coming soon)
brew install hitman

πŸš€ Quick Start

1. Create a .hit file

# Define variables
DEFINE baseUrl="https://jsonplaceholder.typicode.com"
DEFINE userId=1

# Simple GET request
GET {{baseUrl}}/users/{{userId}}

# POST request with data
POST {{baseUrl}}/posts
    WITH HEADER {
        "Content-Type": "application/json"
    }
    WITH DATA {
        "title": "My Post",
        "body": "This is the post content",
        "userId": {{userId}}
    }

2. Run it

# Execute requests
hitman example.hit

# Dry run (validate without sending)
hitman example.hit --dry-run

# Verbose output
hitman example.hit --verbose

# Parallel execution
hitman example.hit --parallel

🎨 VS Code Extension

Enhance your .hit file editing experience:

Install from VS Code Marketplace β†’

Features:

  • 🎨 Syntax highlighting
  • πŸ“ IntelliSense and autocomplete
  • ❌ Error detection and validation
  • πŸ”§ Code formatting
  • πŸ“‹ Snippets and templates

πŸ”§ Key Features

Variables and Substitution

DEFINE token="abc123"
DEFINE user={"name": "John", "age": 30}

GET https://api.example.com/profile
    WITH HEADER {"Authorization": "Bearer {{token}}"}
    WITH DATA {{user}}

Multiple HTTP Methods

GET https://api.example.com/users
POST https://api.example.com/users
PUT https://api.example.com/users/1
DELETE https://api.example.com/users/1

Flexible Comments

# Hash comments
// Double slash comments
/* Block comments */

GET https://api.example.com/users  # Inline comments

πŸ› οΈ CLI Options

# Basic usage
hitman requests.hit

# Common options
hitman requests.hit --dry-run          # Validate without sending
hitman requests.hit --verbose          # Detailed output
hitman requests.hit --parallel         # Concurrent execution
hitman requests.hit --quiet            # Minimal output

# Variable overrides
hitman requests.hit --define baseUrl="https://staging.api.com"
hitman requests.hit --env staging.env

# Reporting
hitman requests.hit --report results.json

πŸ“š Examples

Explore comprehensive examples in the examples/ directory:

Quick Example Run

# Try the real-world example
hitman examples/real-world-api-testing.hit

# Test authentication patterns
hitman examples/authentication-patterns.hit --dry-run

# Run CRUD operations
hitman examples/rest-api-crud.hit --parallel

πŸ“– Documentation

🀝 Contributing

We welcome contributions! Please see our Contributing Guide for details.

Development Setup

# Clone the repository
git clone https://github.com/Mahmoud-Emad/hitman-cli.git
cd hitman-cli

# Build and test
cargo build
cargo test

# Run locally
cargo run -- example.hit --dry-run

πŸ“„ License

This project is licensed under the MIT OR Apache-2.0 license.

πŸ”— Links


Made with ❀️ for developers who love simple, powerful HTTP testing tools.

About

A lightweight HTTP testing tool that reads `.hit` files and executes HTTP requests with support for variables, comments, parallel execution, and comprehensive reporting.

Resources

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors