yapi is a CLI-first, offline-first API client tailored for developers. With support for HTTP, gRPC, and TCP, it simplifies API interactions by using simple YAML files. Stop relying on bulky GUI tools and embrace a more efficient way to define, review, and run API requests directly from your terminal.
yapi is an innovative CLI-first and offline-first API client designed for ease of use within terminal environments and integration with Git repositories. This tool facilitates interactions with HTTP, gRPC, and TCP protocols without the overhead of traditional GUI applications. By leveraging simple YAML files to define requests, yapi empowers users to commit, review, and execute API calls seamlessly.
.yapi.yml files and execute them on the fly.Create a request file (e.g., get-user.yapi.yml) and run:
# Request Definition
yapi: v1
url: https://jsonplaceholder.typicode.com/users/1
method: GET
yapi run get-user.yapi.yml
Here's an example of chaining requests:
# Chained Requests
yapi: v1
chain:
- name: login
url: https://api.example.com/auth/login
method: POST
body:
username: "dev_sheep"
password: ${PASSWORD}
expect:
status: 200
assert:
- .token != null
- name: create_post
url: https://api.example.com/posts
method: POST
headers:
Authorization: Bearer ${login.token}
Validate complex response structures using assertions powered by JQ:
# Assertion Example
yapi: v1
url: https://api.example.com/users
method: GET
expect:
status: 200
assert:
- . | length > 0
- .[0].email != null
yapi includes a comprehensive Language Server Protocol (LSP) implementation, enabling real-time validation, intelligent autocompletion, and an enhanced API development experience across compatible editors.
Explore the Playground to test yapi in action or View Source for more details.
By embracing yapi, developers can easily create, execute, and manage API requests efficiently, making it an essential tool in modern development workflows.
No comments yet.
Sign in to be the first to comment.