restclient

command module
v0.2.21 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 9, 2025 License: MIT Imports: 1 Imported by: 0

README

restclient

A powerful command-line HTTP client inspired by the VS Code REST Client extension. Send HTTP requests directly from .http and .rest files, manage environments, and more.

Features

  • Parse and execute requests from .http and .rest files
  • Interactive fuzzy-search selector for choosing requests from multi-request files or history
  • JavaScript scripting for testing responses and chaining requests (like Postman)
  • Postman Collection v2.1.0 import/export - full compatibility with Postman
  • Multiple environments with variable support
  • System variables (UUID, timestamps, random values, etc.)
  • File variables and .env file support
  • Request history with replay
  • Multipart form data and file uploads
  • GraphQL support (queries, mutations, subscriptions)
  • Basic, Digest, and AWS Signature v4 authentication
  • Cookie jar for subsequent requests within a session
  • Colored output with syntax highlighting for JSON and XML
  • Shell completion for bash, zsh, fish, and PowerShell

Documentation

  • Commands - Usage of send, env, history, session, completion, postman
  • HTTP File Format - Syntax guide, request metadata, query params, form data, GraphQL
  • Variables - File, environment, system, and user input variables
  • Scripting - Pre-request/post-response scripts, API reference, utility functions
  • Authentication - Basic, Digest, AWS Signature v4
  • Configuration - Global/session config, SSL/TLS, Proxy
  • Troubleshooting - Common errors and solutions

Installation

Using Homebrew
brew tap ideaspaper/tap
brew install --cask restclient
Using go install
go install github.com/ideaspaper/restclient@latest
From Source
git clone https://github.com/ideaspaper/restclient.git
cd restclient
go build -o restclient .

Quick Start

  1. Create a request file (api.http):

    @baseUrl = https://api.example.com
    
    ### Get users
    # @name getUsers
    GET {{baseUrl}}/users
    Authorization: Bearer {{token}}
    
    ### Create user
    POST {{baseUrl}}/users
    Content-Type: application/json
    
    {
        "name": "John Doe"
    }
    
  2. Send a request:

    # Interactive selection
    restclient send api.http
    
    # Send by name
    restclient send api.http --name getUsers
    

License

MIT License - see LICENSE file for details.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
internal
constants
Package constants provides common constants used throughout the application.
Package constants provides common constants used throughout the application.
filesystem
Package filesystem provides a file system abstraction for testability.
Package filesystem provides a file system abstraction for testability.
httputil
Package httputil provides HTTP-related utility functions.
Package httputil provides HTTP-related utility functions.
paths
Package paths provides common path utilities for the application.
Package paths provides common path utilities for the application.
stringutil
Package stringutil provides common string manipulation utilities.
Package stringutil provides common string manipulation utilities.
pkg
auth
Package auth provides authentication handlers for HTTP requests.
Package auth provides authentication handlers for HTTP requests.
client
Package client provides an HTTP client with support for various authentication schemes, cookies, proxies, TLS certificates, and response timing.
Package client provides an HTTP client with support for various authentication schemes, cookies, proxies, TLS certificates, and response timing.
config
Package config provides global application configuration management.
Package config provides global application configuration management.
errors
Package errors provides custom error types and utilities for the REST client.
Package errors provides custom error types and utilities for the REST client.
executor
Package executor provides request execution functionality.
Package executor provides request execution functionality.
history
Package history provides request history management with persistence, filtering, and display formatting capabilities.
Package history provides request history management with persistence, filtering, and display formatting capabilities.
lastfile
Package lastfile provides functionality to persist and retrieve the last used .http/.rest file path.
Package lastfile provides functionality to persist and retrieve the last used .http/.rest file path.
models
Package models defines the core data structures for HTTP requests, responses, and their associated metadata used throughout the application.
Package models defines the core data structures for HTTP requests, responses, and their associated metadata used throughout the application.
output
Package output provides response formatting with syntax highlighting and colorization for HTTP responses, JSON, and XML content.
Package output provides response formatting with syntax highlighting and colorization for HTTP responses, JSON, and XML content.
parser
Package parser provides functionality for parsing .http and .rest files into structured HTTP request models with support for variables, multipart forms, and embedded scripts.
Package parser provides functionality for parsing .http and .rest files into structured HTTP request models with support for variables, multipart forms, and embedded scripts.
postman
Package postman provides import and export functionality for Postman Collection v2.1.0 format.
Package postman provides import and export functionality for Postman Collection v2.1.0 format.
scripting
Package scripting provides a JavaScript execution engine for pre-request and post-response scripts, with built-in utilities for assertions, crypto, and variable management.
Package scripting provides a JavaScript execution engine for pre-request and post-response scripts, with built-in utilities for assertions, crypto, and variable management.
secrets
Package secrets provides secure storage for environment variables and secrets.
Package secrets provides secure storage for environment variables and secrets.
session
Package session provides session management for persisting cookies and variables across HTTP requests, supporting both directory-scoped and named session modes.
Package session provides session management for persisting cookies and variables across HTTP requests, supporting both directory-scoped and named session modes.
tui
Package tui provides terminal user interface components including a fuzzy-search selector for selecting items from lists.
Package tui provides terminal user interface components including a fuzzy-search selector for selecting items from lists.
userinput
Package userinput handles detection and processing of user input variables in HTTP request URLs using the {{:paramName}} syntax.
Package userinput handles detection and processing of user input variables in HTTP request URLs using the {{:paramName}} syntax.
variables
Package variables provides variable resolution and substitution for HTTP request templates, supporting environment variables, system functions, file variables, and user prompts.
Package variables provides variable resolution and substitution for HTTP request templates, supporting environment variables, system functions, file variables, and user prompts.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL