get

A convenient HTTP CLI with expressive inline syntax.

Install

brew install jclem/tap/get

Quick start

# Plain GET
get https://httpbin.org/get

# Add headers
get https://httpbin.org/headers Authorization:Bearer_token

# Query params
get https://httpbin.org/get q==rust page==1

# JSON body (auto-POST)
get https://httpbin.org/anything title=ship-it

Features

Inline syntax

Every argument after the URL is parsed as one of these forms:

FormMeaningExample
Key:ValueHeaderAccept:application/json
name==valueQuery paramq==hello
path=valueBody stringtitle=ship-it
path:=jsonBody JSONcount:=10

When syntax is ambiguous, the parser uses this precedence: :===:=.

Headers

Set headers with Key:Value syntax. Header names allow letters, numbers, -, and _. Values may contain additional : characters.

# Single header
get https://httpbin.org/headers Accept:application/json

# Multiple headers
get https://httpbin.org/headers \
  Authorization:Bearer_sk_live_123 \
  X-Request-Id:req-abc-456

# Content negotiation
get https://httpbin.org/response-headers \
  Accept:text/plain \
  Accept-Language:en-US

Repeating a header name appends to it rather than replacing it.

Query params

Append query parameters with ==. Repeat a key to send multiple values.

# Search with multiple params
get https://httpbin.org/get \
  q==rust \
  sort==stars \
  page==1

# Repeated keys
get https://httpbin.org/get \
  tag==cli \
  tag==http \
  tag==rust

# Empty value
get https://httpbin.org/get filter==

JSON body

Body fields are sent as JSON. When any body input is present and no -X flag is set, the method auto-switches to POST.

String assignment (=)

The = operator always stores a JSON string:

# Simple fields
get https://httpbin.org/anything \
  title=fix-login-redirect \
  status=open

# Nested object via dot notation
get https://httpbin.org/anything \
  user.name=alice \
  user.role=admin

Typed assignment (:=)

The := operator parses the right side as raw JSON—numbers, booleans, arrays, and objects:

# Numbers and booleans
get https://httpbin.org/anything \
  count:=10 \
  is_draft:=false

# Arrays and objects
get https://httpbin.org/anything \
  'labels:=["bug","urgent"]' \
  'owner:={"id":42,"name":"jules"}'

Nested paths

Both = and := support dot notation, bracket keys, and arrays:

# Dot notation for nested objects
get https://httpbin.org/anything \
  project.name=apollo \
  project.version=2.0

# Bracket keys (useful for special characters)
get https://httpbin.org/anything \
  'project[build.version]=v1'

# Array append with []
get https://httpbin.org/anything \
  items[]=first \
  items[]=second \
  items[]=third

# Array by index
get https://httpbin.org/anything \
  items[0]=alpha \
  items[2]=gamma

# Root-level array
get https://httpbin.org/anything \
  []=one \
  []=two

Combining everything

Headers, query params, and body fields can all be mixed in a single command:

get -X POST https://httpbin.org/anything \
  Authorization:Bearer_token \
  X-Request-Id:req-123 \
  expand==owner \
  expand==labels \
  title=write-readme \
  priority:=2 \
  'labels:=["docs","cli"]' \
  owner[id]:=42

Method selection

The HTTP method is chosen automatically:

# Auto POST (body present)
get https://httpbin.org/anything title=hello

# Force PUT
get -X PUT https://httpbin.org/anything title=updated

# Force DELETE
get -X DELETE https://httpbin.org/anything

# Force GET even with body
get -X GET https://httpbin.org/anything title=hello

Verbose mode

Use -v / --verbose to print the full request and response headers alongside the body:

# See request + response headers
get -v https://httpbin.org/get

# Verbose POST with body
get -v https://httpbin.org/anything \
  title=hello \
  count:=5

# Verbose with custom headers
get -v https://httpbin.org/headers \
  Authorization:Bearer_token \
  Accept:application/json

Dry run

Use --dry-run to preview exactly what would be sent without making a network call. Useful for building complex requests:

# Preview a POST request
get --dry-run https://httpbin.org/post \
  Authorization:Bearer_token \
  title=fix-parser \
  priority:=1

# Verify query string construction
get --dry-run https://httpbin.org/get \
  q==hello+world \
  lang==en \
  page==1

Form data

Use --form to send the body as application/x-www-form-urlencoded instead of JSON:

# URL-encoded form submission
get --form https://httpbin.org/post \
  username=alice \
  password=secret

# Form with typed values
get --form https://httpbin.org/post \
  title=hello \
  count:=3

Streaming

Use -s / --stream to print response data as it arrives, rather than waiting for the full response:

# Stream 20 lines from httpbin
get --stream https://httpbin.org/stream/20

# Stream with verbose headers
get -v --stream https://httpbin.org/stream/5

Sessions & profiles

get can persist selected response headers (like auth tokens) per host, and organize them into named profiles.

Session management

# List all saved sessions
get session list

# Show headers stored for a host
get session show api.example.com

# Clear stored headers for a host
get session clear api.example.com

# Delete a session file entirely
get session delete api.example.com

# Edit a session file in $EDITOR
get session edit api.example.com

Profiles

Profiles let you maintain separate sets of sessions—for example, work and personal:

# Switch to a named profile
get session switch work

# List all profiles
get profile list

# Show all profiles and their sessions
get profile tree

# Remove a profile
get profile remove old-project

Configuration

Control which headers are persisted via the config file:

# Open config in $EDITOR
get config edit

Example config:

# Global: persist these headers for all hosts
session-headers = ["Authorization", "x-api-key"]

# Per-host override (replaces global list)
[sessions."api.example.com"]
session-headers = ["x-session-token"]

Use -S / --no-session to skip session persistence for a single request, or -p / --profile to use a specific profile:

# One-off request without session persistence
get -S https://httpbin.org/get

# Use a specific profile
get -p work https://httpbin.org/get

Unix sockets

Send requests over Unix domain sockets using two URL formats:

If <path> is omitted, it defaults to /.

# GET / on a Unix socket
get unix:/tmp/app.sock

# GET /health
get unix:/tmp/app.sock:/health

# Shorthand form
get /tmp/app.sock:/health

# POST with body over a socket
get /tmp/app.sock:/api/items title=hello

# Verbose request over a socket
get -v /tmp/app.sock:/status

Output control

Several flags control what gets printed:

# Suppress the response body (headers only with -v)
get -v -B https://httpbin.org/get

# Disable JSON formatting and syntax highlighting
get -H https://httpbin.org/json

# Combine: verbose, no body
get -v -B https://httpbin.org/anything title=test

Response formatting and syntax highlighting are enabled only when stdout is a TTY. Piping output to another command disables them automatically.

Redirects

By default, get follows up to 16 redirects. Use --max-redirects to change the limit, or set it to 0 to disable following redirects entirely:

# Follow redirects (default behavior)
get https://httpbin.org/redirect/3

# Limit to 1 redirect
get --max-redirects 1 https://httpbin.org/redirect/3

# Disable redirects
get --max-redirects 0 https://httpbin.org/redirect/1

# Debug redirect chain
get --debug https://httpbin.org/redirect/3

Debugging

Use --debug for detailed request and redirect debugging information:

# Debug a simple request
get --debug https://httpbin.org/get

# Debug a redirect chain
get --debug https://httpbin.org/redirect/2

# Debug a POST with body
get --debug https://httpbin.org/anything \
  title=hello \
  count:=5

Shell completions

Generate completion scripts for your shell:

# Bash
get completions bash

# Zsh
get completions zsh

# Fish
get completions fish

Flags reference

FlagDescription
-v, --verboseShow request and response headers
--debugPrint detailed request and redirect info
--dry-runShow the request without sending it
-X, --methodSet the HTTP method
--formSend body as form-encoded instead of JSON
-s, --streamStream the response body as it arrives
-B, --no-bodyDo not print the response body
-H, --no-highlightDisable formatting and syntax highlighting
-S, --no-sessionSkip session persistence for this request
-p, --profileUse a named session profile
--max-redirectsMax redirects to follow (default: 16, 0 to disable)