The API client that lives in your terminal (and your git repo). Stop clicking through heavy Electron apps just to send a JSON body.
$ npx -y skills add jamierpond/yapi --agent claude-code
The API client that lives in your terminal (and your git repo).
Stop clicking through heavy Electron apps just to send a JSON body. yapi is a CLI-first, offline-first, git-friendly API client for HTTP, gRPC, and TCP. It uses simple YAML files to define requests, meaning you can commit them, review them, and run them anywhere.
Try the Playground | View Source
macOS:
curl -fsSL https://yapi.run/install/mac.sh | bash
Linux:
curl -fsSL https://yapi.run/install/linux.sh | bash
Windows (PowerShell):
irm https://yapi.run/install/windows.ps1 | iex
Using Homebrew (macOS):
brew tap jamierpond/yapi
brew install --cask yapi
Using Go:
go install yapi.run/cli/cmd/yapi@latest
From Source:
git clone https://github.com/jamierpond/yapi
cd yapi
make install
Unlike other API clients, yapi ships with a full LSP implementation out of the box. Your editor becomes an intelligent API development environment with real-time validation, autocompletion, and inline execution.
Install the official extension from VS Code Marketplace or Open VSX:
Features:
Cmd+Enter (Mac) or Ctrl+Enter (Windows/Linux) - execute requests without leaving your editor${VAR} to see environment variable statusThe extension automatically detects .yapi.yml files and activates the language server. No configuration needed.
yapi was built with Neovim in mind. First-class support via lua/yapi_nvim:
-- lazy.nvim
{
dir = "~/path/to/yapi/lua/yapi_nvim",
config = function()
require("yapi_nvim").setup({
lsp = true, -- Enables the yapi Language Server
pretty = true, -- Uses the TUI renderer in the popup
})
end
}
Commands:
:YapiRun - Execute the current buffer:YapiWatch - Open a split with live reloadThe LSP communicates over stdio and works with any editor that supports the Language Server Protocol:
yapi lsp
| Feature | Description |
|---|---|
| Real-time Validation | Errors and warnings as you type, with precise line/column positions |
| Intelligent Autocompletion | Context-aware suggestions for keys, HTTP methods, content types |
| Hover Info | Hover over ${VAR} to see environment variable status |
| Go to Definition | Jump to referenced chain steps and variables |
Create a request file (e.g., get-user.yapi.yml):
yapi: v1
url: https://jsonplaceholder.typicode.com/users/1
method: GET
Run it:
yapi run get-user.yapi.yml
See the magic: You get a beautifully highlighted, formatted response.
Note: The
yapi: v1version tag is required at the top of all config files. This enables future schema evolution while maintaining backwards compatibility.
yapi sendDon't want to create a file? Use yapi send for one-off requests directly from the command line.
# Simple GET
yapi send https://jsonplaceholder.typicode.com/posts/1
# POST with JSON body (method auto-detected when body is provided)
yapi send https://httpbin.org/post '{"title":"Hello from yapi"}'
# Explicit method, custom headers
yapi send -X PUT https://httpbin.org/put '{"updated":true}' \
-H 'Authorization: Bearer my-token'
# Filter response with jq
yapi send https://jsonplaceholder.typicode.com/posts/1 --jq '.title'
# TCP request
yapi send 'tcp://tcpbin.com:4242' 'Hello from yapi!'
Flags:
-X, --method - HTTP method (default: GET, or POST if body is provided)-H, --header - Custom headers (repeatable, e.g. -H 'Key: Value')-v, --verbose - Show request details, timing, and response headers--json - Output full result as JSON with metadata--jq - Apply a JQ filter to the responseTransport is auto-detected from the URL scheme: tcp:// for TCP, grpc:// for gRPC, and HTTP by default.
yapi speaks many protocols. Here is how you define them.
Chain multiple requests together, passing data between steps. Build authentication flows, integration tests, or multi-step workflows.
yapi: v1
chain:
# Step 1: Login and get token
- name: login
url: https://api.example.com/auth/login
method: POST
body:
username: "dev_sheep"
password: ${PASSWORD} # from environment
expect:
status: 200
assert:
- .token != null
# Step 2: Create a post using the token
- name: create_post
url: https://api.example.com/posts
method: POST
headers:
Authorization: Bearer ${login.token}
body:
title: "Hello World"
tags:
- cli
- testing
author:
id: 123
active: true
expect:
status: 201
assert:
- .id != null
- .title == "Hello World"
Key features:
${step_name.field} syntax${login.data.token}.id == ${previous_step.expected_id}Manage multiple environments (dev, staging, prod) with a single config file. Create a yapi.config.yml:
yapi: v1
default_environment: local
environments:
local:
url: http://localhost:3000
vars:
API_KEY: dev_key_123
prod:
url: https://api.example.com
vars:
API_KEY: ${PROD_API_KEY} # from shell env
env_file: .env.prod # load vars from file
Then reference in your requests:
yapi: v1
url: ${url}/api/v1/users
method: GET
headers:
Authorization: Bearer ${API_KEY}
Switch environments: yapi run my-request.yapi.yml -e prod
No more escaping quotes in curl. Just clean YAML.
yapi: v1
url: https://api.example.com/posts
method: POST
content_type: application/json
body:
title: "Hello World"
tags:
- cli
- testing
Validate complex response structures with JQ-powered assertions.
yapi: v1
url: https://api.example.com/users
method: GET
expect:
status: 200 # or [200, 201] for multiple valid codes
assert:
- . | length > 0 # array has items
- .[0].email != null # first item has email
- .[] | .active == true # all items are active
Chain variable assertions - compare values across steps:
yapi: v1
chain:
- name: create_item
url: https://api.example.com/items
method: POST
body:
name: "Test Item"
expect:
status: 201
- name: get_item
url: https://api.example.com/items/${create_item.id}
method: GET
expect:
status: 200
assert:
- .id == ${create_item.id} # verify same ID
- .name == "Test Item"
Don't grep output. Filter it right in the config.
yapi: v1
url: https://jsonplaceholder.typicode.com/users
method: GET
# Only show me names and emails, sorted by name
jq_filter: "[.[] | {name, email}] | sort_by(.name)"
Stop hunting for .proto files. If your server supports reflection, yapi just works.
yapi: v1
url: grpc://localhost:50051
service: helloworld.Greeter
rpc: SayHello
body:
name: "yapi User"
First-class support for queries and variables.
yapi: v1
url: https://countries.trevorblades.com/graphql
graphql: |
query getCountry($code: ID!) {
country(code: $code) {
name
capital
}
}
variables:
code: "BR"
wait_forPoll an endpoint until conditions are met. Perfect for async jobs, webhooks, and eventual consistency.
Fixed Period Polling:
yapi: v1
url: ${url}/jobs/${job_id}
method: GET
wait_for:
until:
- .status == "completed"
period: 2s
timeout: 60s
Exponential Backoff:
yapi: v1
url: ${url}/jobs/${job_id}
method: GET
wait_for:
until:
- .status == "completed"
backoff:
seed: 1s
multiplier: 2
timeout: 60s
Backoff waits: 1s -> 2s -> 4s -> 8s... until timeout.
In Chains - Async Job Workflow:
yapi: v1
chain:
- name: create_job
url: ${url}/jobs
method: POST
body:
type: "data_export"
expect:
status: 202
- name: wait_for_job
url: ${url}/jobs/${create_job.job_id}
method: GET
wait_for:
until:
- .status == "completed" or .status == "failed"
period: 2s
timeout: 300s
expect:
assert:
- .status == "completed"
- name: download
url: ${wait_for_job.download_url}
method: GET
output_file: ./export.csv
Don't remember the file name? Just run yapi without arguments.
yapi
This launches the Interactive TUI. You can fuzzy-search through all your .yapi.yml files in the current directory (and subdirectories) and execute them instantly.
For a richer CLI experience, source the yapi shell helper in your .zshrc:
# Add to ~/.zshrc
YAPI_ZSH="/path/to/yapi/bin/yapi.zsh" # or wherever you installed yapi
[ -f "$YAPI_ZSH" ] && source "$YAPI_ZSH"
# Optional: short alias
alias a="yapi"
This enables:
โ to re-run it instantly.Note: Requires
jqto be installed.
Tired of Alt-Tab -> Up Arrow -> Enter? Use watch mode to re-run the request every time you save the file.
yapi watch ./my-request.yapi.yml
Stress test entire workflows with concurrent execution. Not just individual requests - stress test multi-step chains, auth flows, and complex scenarios. Perfect for finding bottlenecks in real-world usage patterns.
# Stress test an auth flow: login -> create post -> fetch results
yapi stress auth-flow.yapi.yml -n 1000 -p 50
# Run a multi-step workflow for 30 seconds
yapi stress my-workflow.yapi.yml -d 30s -p 10
# Load test against production
yapi stress checkout-flow.yapi.yml -e prod -n 500 -p 25
Options:
-n, --num-requests - Total number of workflow executions (default: 100)-p, --parallel - Number of concurrent workflow executions (default: 1)yapi is a Claude Code plugin with 1 hand-picked skill, indexed on Flowy in the CLI Tools category. Install it with the command on its page. It includes yapi. Its skills do not fire on their own yet. Request auto-invocation to have Flowy route them as you prompt. Free and open source.
Is this plugin yours?
Claim it with GitHubSubmit a pluginPromote it