Skip to main content

A powerful HTTP CLI that supports .http files, variables, and multiple authentication methods

Project description

httpgo

A powerful HTTP command-line tool that supports .http files, inspired by httpie.

Built with Typer for a great CLI experience.

Features

  • 📁 .http file support - Parse and execute requests from .http/.rest files (VS Code REST Client format)
  • 🔄 Multiple requests - Execute single or all requests from a file
  • 📝 Variables - Support for file variables, environment variables, and dynamic variables
  • 🔐 Authentication - Basic, Bearer, API Key, and Digest authentication
  • 🎨 Beautiful output - Colorized, httpie-style output with syntax highlighting
  • Fast - Built on httpx for high performance
  • 🐚 Shell completion - Auto-completion for Bash, Zsh, Fish, and PowerShell

Installation

# Install with pip
pip install -e .

# Or using uv
uv pip install -e .

Usage

Running .http files

# Run first request in file
httpgo run api.http

# Run all requests
httpgo run api.http --all

# Run specific request by name
httpgo run api.http --name "Get User"

# Run specific request by index
httpgo run api.http --index 2

# With variables
httpgo run api.http -v baseUrl=http://localhost:3000 -v token=abc123

# With environment file
httpgo run api.http --env .env.local

Direct HTTP requests (httpie-style)

# GET request
httpgo get https://httpbin.org/get

# POST with JSON data
httpgo post https://httpbin.org/post name=John age:=30

# POST with form data
httpgo post https://httpbin.org/post --form name=John email=john@example.com

# With headers
httpgo get https://api.example.com/data -H "Authorization: Bearer token123"

# With authentication
httpgo get https://api.example.com/data -a user:password
httpgo get https://api.example.com/data -a mytoken --auth-type bearer

List requests in a file

httpgo list api.http

.http File Format

# Variables
@baseUrl = https://api.example.com
@token = your-api-token

### Get all users
GET {{baseUrl}}/users
Authorization: Bearer {{token}}

### Create a user
POST {{baseUrl}}/users
Content-Type: application/json
Authorization: Bearer {{token}}

{
    "name": "John Doe",
    "email": "john@example.com"
}

### Get user by ID
GET {{baseUrl}}/users/{{$uuid}}

Variable Types

  1. File Variables: Defined with @name = value
  2. Environment Variables: From system environment or .env file
  3. Dynamic Variables:
    • {{$uuid}} / {{$guid}} - Random UUID
    • {{$timestamp}} - Unix timestamp
    • {{$isoTimestamp}} - ISO 8601 timestamp
    • {{$randomInt}} - Random integer (0-1000)
    • {{$randomString}} - Random 10-character string

Environment Files

httpgo supports http-client.env.json (VS Code REST Client format):

{
    "$shared": {
        "apiVersion": "v1"
    },
    "dev": {
        "baseUrl": "http://localhost:3000",
        "token": "dev-token"
    },
    "prod": {
        "baseUrl": "https://api.example.com",
        "token": "prod-token"
    }
}

Output Options

# Verbose mode (show request details)
httpgo run api.http --verbose

# Quiet mode (only show response body)
httpgo run api.http --quiet

# Show only headers
httpgo run api.http --headers

# Show only body
httpgo run api.http --body

# Disable colors
httpgo run api.http --no-color

Authentication

Basic Auth

GET https://api.example.com/data
Authorization: Basic dXNlcjpwYXNz

Or via CLI:

httpgo get https://api.example.com/data -a user:password

Bearer Token

GET https://api.example.com/data
Authorization: Bearer your-token-here

Or via CLI:

httpgo get https://api.example.com/data -a your-token --auth-type bearer

API Key

GET https://api.example.com/data
X-API-Key: your-api-key

Options

Option Description
--verbose Show request details
--quiet, -q Only show response body
--no-color Disable colored output
--timeout, -t Request timeout in seconds (default: 30)
--insecure, -k Disable SSL verification
--env, -e Path to .env file
--var, -v Set variable: name=value

Shell Completion

httpgo supports auto-completion for Bash, Zsh, Fish, and PowerShell.

# Install completion for your current shell
httpgo --install-completion

# Show completion script (to customize)
httpgo --show-completion

After installing, restart your shell or source the completion script.

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

httpgo_cli-0.1.0.tar.gz (25.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

httpgo_cli-0.1.0-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file httpgo_cli-0.1.0.tar.gz.

File metadata

  • Download URL: httpgo_cli-0.1.0.tar.gz
  • Upload date:
  • Size: 25.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for httpgo_cli-0.1.0.tar.gz
Algorithm Hash digest
SHA256 8f51e0f5d85962cd66944e36be7278c7faa84b7fed4fe60f7c9d9701ec2b4131
MD5 64305af9ed06868425aea1bbbcfb93e8
BLAKE2b-256 d193e6c27333295a1df00a4395ebcb4370614539026d08f60dfd764ca72a34cb

See more details on using hashes here.

File details

Details for the file httpgo_cli-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: httpgo_cli-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.9 {"installer":{"name":"uv","version":"0.9.9"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for httpgo_cli-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9d098749f01579a0edbfaa0ca199a61f32cc45a09359f2849e01d77b2ee35fca
MD5 068d852385247d6f7cb1936416560c6f
BLAKE2b-256 cc8259823a6e3d82536eae4fe7c35bc44a67aa29310ef9f6166cdc440554f546

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page