Skip to content

ideaspaper/restclient

Repository files navigation

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
    # @name createUser
    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.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

No packages published