← All tools

ain

Popularity 85 Updated Development & Build

HTTP API client for the terminal

homebrewauto-collected

Installation

Homebrew
brew install ain

Install with Homebrew.

<img src="assets/logo.svg" height=200 style="margin-bottom: 20px"

Introduction

Ain is a terminal HTTP API client. It's an alternative to postman, paw or insomnia.

  • Flexible organization of API:s using files and folders (examples).
  • Use shell-scripts and executables for common tasks.
  • Put things that change in environment variables or .env-files.
  • Handles url-encoding.
  • Share the resulting curl, wget or httpie command-line.
  • Pipe the API output for further processing.
  • Tries hard to be helpful when there are errors.

Ain was built to enable scripting of input and further processing of output via pipes. It targets users who work with many API:s using a simple file format. It uses curl, wget or httpie to make the actual calls.

⭐ Please leave a star if you find it useful! ⭐

Table of contents

  • Pre-requisites
  • Installation
  • If you have go installed
  • Via homebrew
  • Via scoop
  • Via the AUR (Arch Linux)
  • Download binaries yourself
  • Syntax highlight
  • Vim plug
  • Quick start
  • Important concepts
  • Template files
  • Running ain
  • Supported sections
  • [[Host]](#host)
  • [[Query]](#query)
  • [[Headers]](#headers)
  • [[Method]](#method)
  • [[Body]](#body)
  • [[Config]](#config)
  • [[Backend]](#backend)
  • [[BackendOptions]](#backendoptions)
  • Variables
  • Executables
  • Fatals
  • Quoting
  • Escaping
  • URL-encoding
  • Sharing is caring
  • Handling line endings
  • Troubleshooting
  • Ain in a bigger context
  • Contributing
  • Commit messages
  • Testing

Pre-requisites

You need curl, wget or httpie installed and available on your $PATH. To test this run ain -b. This will generate a basic starter template listing what backends are available on your system in the [[Backend]](#backend) section. It will select one and leave the others commented out.

You can also check manually what backends you have installed by opening a shell and type curl, wget or http (add the suffix .exe to those commands if you're on windows). Any output from the command means it's installed.

On linux or mac one of the three is likely to already be installed. The others are available in your package manager or homebrew.