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.2.tar.gz (38.2 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.2-py3-none-any.whl (23.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: httpgo_cli-0.1.2.tar.gz
  • Upload date:
  • Size: 38.2 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.2.tar.gz
Algorithm Hash digest
SHA256 4d46d5cca8d54430340549156f7625840b320b5af55136e1785f9b48785be148
MD5 da133cb1f511bbb4b0f2338fbfddbe82
BLAKE2b-256 0b398b9e5cc7718dee1b8e0e38b44b7d9f875c8adec1c082e08b068dc70b8ee6

See more details on using hashes here.

File details

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

File metadata

  • Download URL: httpgo_cli-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 23.1 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 2579274768064805fc4520c32416bde3321968dabf03e7a126a62fa284dd89d0
MD5 3584b1773381e30c0329463fad204cbf
BLAKE2b-256 977ecdd1b31bf52aec8248b541875b9368f575ce38283d7df50524fc3178948c

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