|
| 1 | + |
| 2 | + |
| 3 | +<div style="text-align: center;"> |
| 4 | + |
| 5 | +[](https://rest.sh/) [](https://rest.sh/v1/#/guide) [](https://github.com/rest-sh/restish/actions?query=workflow%3ACI+branch%3Amain++) [](https://codecov.io/gh/rest-sh/restish) [](https://pkg.go.dev/github.com/rest-sh/restish?tab=subdirectories) [](https://goreportcard.com/report/github.com/rest-sh/restish) [](https://github.com/rest-sh/restish) |
| 6 | + |
| 7 | +</div> |
| 8 | + |
| 9 | +[Restish](https://rest.sh/) is a CLI for interacting with [REST](https://apisyouwonthate.com/blog/rest-and-hypermedia-in-2019)-ish HTTP APIs with some nice features built-in, like always having the latest API resources, fields, and operations available when they go live on the API without needing to install or update anything. |
| 10 | + |
| 11 | +## Why use this? |
| 12 | + |
| 13 | +Every API deserves a CLI for quick access and for power users to script against the service. Building CLIs from scratch is a pain. Restish provides one tool your users can install that just works for multiple APIs and is always up to date, because the interface is defined by the server. See how it [compares](./comparison.md) to cURL and HTTPie. |
| 14 | + |
| 15 | +## Getting started |
| 16 | + |
| 17 | +Start with the [guide](./guide.md) to learn how to install and configure Restish as well as getting an overview of all of its features. |
| 18 | + |
| 19 | +## Features |
| 20 | + |
| 21 | +- HTTP/2 ([RFC 7540](https://tools.ietf.org/html/rfc7540)) with TLS by _default_ with fallback to HTTP/1.1 |
| 22 | +- Generic HEAD/GET/POST/PUT/PATCH/DELETE verbs like `curl` or [HTTPie](https://httpie.org/) |
| 23 | +- Generated commands for CLI operations, e.g. `restish my-api list-users` |
| 24 | + - Automatically discovers API descriptions |
| 25 | + - [RFC 8631](https://tools.ietf.org/html/rfc8631) `service-desc` link relation |
| 26 | + - [RFC 5988](https://tools.ietf.org/html/rfc5988#section-6.2.2) `describedby` link relation |
| 27 | + - Supported formats |
| 28 | + - OpenAPI [3.0](https://github.com/OAI/OpenAPI-Specification/blob/master/versions/3.0.3.md) / [3.1](https://spec.openapis.org/oas/v3.1.0.html) and [JSON Schema](https://json-schema.org/) |
| 29 | + - Automatic configuration of API auth if advertised by the API |
| 30 | + - Shell command completion for Bash, Fish, Zsh, Powershell |
| 31 | +- Automatic pagination of resource collections via [RFC 5988](https://tools.ietf.org/html/rfc5988) `prev` and `next` hypermedia links |
| 32 | +- API endpoint-based auth built-in with support for profiles: |
| 33 | + - HTTP Basic |
| 34 | + - API key via header or query param |
| 35 | + - OAuth2 client credentials flow (machine-to-machine, [RFC 6749](https://tools.ietf.org/html/rfc6749)) |
| 36 | + - OAuth2 authorization code (with PKCE [RFC 7636](https://tools.ietf.org/html/rfc7636)) flow |
| 37 | +- Content negotiation, decoding & unmarshalling built-in: |
| 38 | + - JSON ([RFC 8259](https://tools.ietf.org/html/rfc8259), <https://www.json.org/>) |
| 39 | + - YAML (<https://yaml.org/>) |
| 40 | + - CBOR ([RFC 7049](https://tools.ietf.org/html/rfc7049), <http://cbor.io/>) |
| 41 | + - MessagePack (<https://msgpack.org/>) |
| 42 | + - Amazon Ion (<http://amzn.github.io/ion-docs/>) |
| 43 | + - Gzip ([RFC 1952](https://tools.ietf.org/html/rfc1952)), Deflate ([RFC 1951](https://datatracker.ietf.org/doc/html/rfc1951)), and Brotli ([RFC 7932](https://tools.ietf.org/html/rfc7932)) content encoding |
| 44 | +- Automatic retries with support for [`Retry-After`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Retry-After) and `X-Retry-In` headers when APIs are rate-limited. |
| 45 | +- Standardized [hypermedia](https://smartbear.com/learn/api-design/what-is-hypermedia/) parsing into queryable/followable response links: |
| 46 | + - HTTP Link relation headers ([RFC 5988](https://tools.ietf.org/html/rfc5988#section-6.2.2)) |
| 47 | + - [HAL](http://stateless.co/hal_specification.html) |
| 48 | + - [Siren](https://github.com/kevinswiber/siren) |
| 49 | + - [Terrifically Simple JSON](https://github.com/mpnally/Terrifically-Simple-JSON) |
| 50 | + - [JSON:API](https://jsonapi.org/) |
| 51 | +- Local caching that respects [RFC 7234](https://tools.ietf.org/html/rfc7234) `Cache-Control` and `Expires` headers |
| 52 | +- Client-side bulk resource management (like git for API resources) |
| 53 | +- CLI [shorthand](https://github.com/danielgtaylor/openapi-cli-generator/tree/master/shorthand#cli-shorthand-syntax) for structured data input (e.g. for JSON) |
| 54 | +- [Shorthand query](https://github.com/danielgtaylor/shorthand#querying) response filtering & projection |
| 55 | +- Colorized prettified readable output |
| 56 | +- Fast native zero-dependency binary |
| 57 | + |
| 58 | +## Articles |
| 59 | + |
| 60 | +- [A CLI for REST APIs](https://dev.to/danielgtaylor/a-cli-for-rest-apis-part-1-104b) |
| 61 | +- [Mapping OpenAPI to the CLI](https://dev.to/danielgtaylor/mapping-openapi-to-the-cli-37pb) |
0 commit comments