Skip to content
harvzorPublic

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

29 Commits

Folders and files

Repository files navigation

httpyap

Pipe .http file syntax to httpyac via stdin.

demo

Agentic use

The main use case of httpyap is teaching agents how to make readable requests, otherwise they tend to prefer to use curl

Why http syntax is better than curl:

  • Curl acts different between operating systems
  • Http is prettier ✨

Without the yap skill

Using an agent without yap

With the yap skill

Using an agent with yap

Installation

Requires Node.js 18+. Install directly from GitHub:

npm install -g github:harvzor/httpyap

To uninstall:

npm uninstall -g httpyap

Get the skill

A agent skill is available, teaching AI agents how to use yap. Install it with the skills npm tool:

Install globally (recommended - keeps skills out of individual project repos):

npx skills add git@github.com:harvzor/httpyap.git -g

Or install into the current project only:

npx skills add git@github.com:harvzor/httpyap.git

Usage

Interactive

Type yap, paste your request, then type ### on its own line and press Enter to send:

$ yap
Paste your .http request, then type ### to send:
GET https://httpbin.org/json
###

Piped

Bash

Single line:

echo "GET https://httpbin.org/json" | yap

Multiline:

yap << 'EOF'
POST https://httpbin.org/post
Content-Type: application/json

{
  "foo": "bar"
}
EOF
Zsh

Single line:

echo "GET https://httpbin.org/json" | yap

Multiline:

yap << 'EOF'
POST https://httpbin.org/post
Content-Type: application/json

{
  "foo": "bar"
}
EOF
PowerShell

Single line:

"GET https://httpbin.org/json" | yap

Multiline:

@"
POST https://httpbin.org/post
Content-Type: application/json

{
  "foo": "bar"
}
"@ | yap
Nushell

Single line:

"GET https://httpbin.org/json" | yap

Multiline:

'POST https://httpbin.org/post
Content-Type: application/json

{
  "foo": "bar"
}' | yap

Using variables

Via .env files

Httpyap supports .env files via httpyac's variable resolution. Place a .env file in the working directory and reference variables using {{name}} syntax in your request:

# .env
token=my-secret-token
baseUrl=https://httpbin.org
@"
GET {{baseUrl}}/json
Authorization: Bearer {{token}}
"@ | yap

Inline variables

Variables can be defined inline in the request using @name = value:

@"
@token = my-secret-token

GET https://httpbin.org/json
Authorization: Bearer {{token}}
"@ | yap

Output

Displays the full request/response exchange with syntax highlighting, matching httpyac's default output format.

About

No description, website, or topics provided.

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages