<?xml version="1.0" encoding="utf-8" standalone="yes"?><rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Guides on Restish</title><link>https://rest.sh/docs/guides/</link><description>Recent content in Guides on Restish</description><generator>Hugo</generator><language>en-US</language><atom:link href="https://rest.sh/docs/guides/index.xml" rel="self" type="application/rss+xml"/><item><title>Requests</title><link>https://rest.sh/docs/guides/requests/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/requests/</guid><description>&lt;p&gt;Restish supports two request styles: generic HTTP requests for immediate access
and API-aware commands generated from an API description for repeated work.&lt;/p&gt;
&lt;h2 id="start-with-a-generic-request"&gt;Start With A Generic Request&lt;/h2&gt;
&lt;div class="restish-playground" data-restish-playground&gt;
 &lt;div class="restish-playground__bar"&gt;
 &lt;div&gt;
 &lt;span class="restish-playground__eyebrow"&gt;Browser preview&lt;/span&gt;
 &lt;p class="restish-playground__hint"&gt;Edit the command and run it from your browser against the live docs API.&lt;/p&gt;
 &lt;/div&gt;
 &lt;div class="restish-playground__actions"&gt;
 &lt;span class="restish-playground__state" data-restish-state&gt;Ready&lt;/span&gt;
 &lt;button class="restish-playground__button" type="button" data-restish-run aria-controls="restish-example-0-output"&gt;
 &lt;i class="fas fa-play" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;span&gt;Run&lt;/span&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-copy title="Copy command" aria-label="Copy command"&gt;
 &lt;i class="fas fa-copy" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-reset title="Reset command" aria-label="Reset command"&gt;
 &lt;i class="fas fa-rotate-left" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;label class="visually-hidden" for="restish-example-0-command"&gt;Restish command&lt;/label&gt;
 &lt;div class="restish-playground__terminal-line"&gt;
 &lt;span class="restish-playground__prompt" aria-hidden="true"&gt;$&lt;/span&gt;
 &lt;div class="restish-playground__command-wrap"&gt;
 &lt;div class="restish-playground__command-highlight" aria-hidden="true"&gt;&lt;code class="language-bash" data-restish-command-highlight&gt;restish api.rest.sh/get&lt;/code&gt;&lt;/div&gt;
 &lt;input id="restish-example-0-command" class="restish-playground__command" type="text" spellcheck="false" autocomplete="off" autocapitalize="off" value="restish api.rest.sh/get" data-restish-command&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;pre id="restish-example-0-output" class="restish-playground__output" aria-live="polite" hidden&gt;&lt;code class="language-readable" data-restish-output&gt;&lt;/code&gt;&lt;/pre&gt;
 &lt;noscript&gt;
 &lt;p class="restish-playground__noscript"&gt;Enable JavaScript to run this example in the browser.&lt;/p&gt;</description></item><item><title>API Setup and Discovery</title><link>https://rest.sh/docs/guides/api-setup-and-discovery/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/api-setup-and-discovery/</guid><description>&lt;p&gt;Restish can call any URL, but registering an API gives you generated commands,
profiles, auth setup, spec caching, and completion.&lt;/p&gt;
&lt;h2 id="configure-by-discovery"&gt;Configure By Discovery&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish api connect example api.rest.sh &lt;span class="s1"&gt;&amp;#39;prompt.api_key: docs-key&amp;#39;&lt;/span&gt;
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish example --help
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Restish looks for an OpenAPI description through well-known locations and link
relations, then caches the spec.&lt;/p&gt;
&lt;p&gt;Discovery is intentionally conservative. Restish trusts same-origin spec links
by default; use &lt;code&gt;--allow-cross-origin-spec&lt;/code&gt; only when you expect the API to
advertise its OpenAPI document from another host and you trust that host.
Cross-origin discovery still rejects private, loopback, link-local, multicast,
and unspecified follow targets unless the original API is already private or
local. Use &lt;code&gt;--spec&lt;/code&gt; when you need to name a private spec URL directly.&lt;/p&gt;</description></item><item><title>Authentication</title><link>https://rest.sh/docs/guides/authentication/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/authentication/</guid><description>&lt;p&gt;Auth belongs with the request context. In Restish that usually means a profile,
so tokens, API keys, and environment-specific credentials do not get copied into
every command.&lt;/p&gt;
&lt;h2 id="safe-auth-fixtures"&gt;Safe Auth Fixtures&lt;/h2&gt;
&lt;p&gt;The example API has endpoints that require auth and return only a safe summary.
They are useful for learning and testing.&lt;/p&gt;
&lt;h3 id="bearer-token"&gt;Bearer Token&lt;/h3&gt;
&lt;div class="restish-playground" data-restish-playground&gt;
 &lt;div class="restish-playground__bar"&gt;
 &lt;div&gt;
 &lt;span class="restish-playground__eyebrow"&gt;Browser preview&lt;/span&gt;
 &lt;p class="restish-playground__hint"&gt;Edit the command and run it from your browser against the live docs API.&lt;/p&gt;
 &lt;/div&gt;
 &lt;div class="restish-playground__actions"&gt;
 &lt;span class="restish-playground__state" data-restish-state&gt;Ready&lt;/span&gt;
 &lt;button class="restish-playground__button" type="button" data-restish-run aria-controls="restish-example-0-output"&gt;
 &lt;i class="fas fa-play" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;span&gt;Run&lt;/span&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-copy title="Copy command" aria-label="Copy command"&gt;
 &lt;i class="fas fa-copy" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-reset title="Reset command" aria-label="Reset command"&gt;
 &lt;i class="fas fa-rotate-left" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;label class="visually-hidden" for="restish-example-0-command"&gt;Restish command&lt;/label&gt;
 &lt;div class="restish-playground__terminal-line"&gt;
 &lt;span class="restish-playground__prompt" aria-hidden="true"&gt;$&lt;/span&gt;
 &lt;div class="restish-playground__command-wrap"&gt;
 &lt;div class="restish-playground__command-highlight" aria-hidden="true"&gt;&lt;code class="language-bash" data-restish-command-highlight&gt;restish -H &amp;#39;Authorization: Bearer docs-token&amp;#39; api.rest.sh/auth/bearer --rsh-print b&lt;/code&gt;&lt;/div&gt;
 &lt;input id="restish-example-0-command" class="restish-playground__command" type="text" spellcheck="false" autocomplete="off" autocapitalize="off" value="restish -H &amp;#39;Authorization: Bearer docs-token&amp;#39; api.rest.sh/auth/bearer --rsh-print b" data-restish-command&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;pre id="restish-example-0-output" class="restish-playground__output" aria-live="polite" hidden&gt;&lt;code class="language-readable" data-restish-output&gt;&lt;/code&gt;&lt;/pre&gt;
 &lt;noscript&gt;
 &lt;p class="restish-playground__noscript"&gt;Enable JavaScript to run this example in the browser.&lt;/p&gt;</description></item><item><title>OAuth</title><link>https://rest.sh/docs/guides/oauth/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/oauth/</guid><description>&lt;p&gt;Use this guide when an API uses OAuth and you need Restish to fetch, cache, and
refresh bearer tokens for a profile or generated OpenAPI credential.&lt;/p&gt;
&lt;p&gt;OAuth setup is provider-specific. Restish owns the local CLI workflow, token
cache, request header, and OpenAPI credential binding. Your identity provider
still owns client registration, redirect URI rules, scopes, consent, and token
policy.&lt;/p&gt;
&lt;h2 id="choose-a-flow"&gt;Choose A Flow&lt;/h2&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Flow&lt;/th&gt;
 &lt;th&gt;Restish type&lt;/th&gt;
 &lt;th&gt;Use it when&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Client credentials&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;oauth-client-credentials&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;A script, service account, CI job, or machine-to-machine integration calls the API.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Authorization code with PKCE&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;oauth-authorization-code&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;A human signs in through a browser and grants access to their account.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Device code&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;oauth-device-code&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;The terminal cannot receive a localhost browser callback, or the provider recommends device authorization for CLIs.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Use &lt;code&gt;external-tool&lt;/code&gt; instead when your organization already has an SSO helper or
request signer that should stay in charge of tokens.&lt;/p&gt;</description></item><item><title>Input and Shorthand</title><link>https://rest.sh/docs/guides/input/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/input/</guid><description>&lt;p&gt;Restish shorthand lets you create structured request bodies directly on the
command line. JSON is the default request encoding, but the same body model can
be encoded as YAML, form data, multipart, CBOR, and other registered types.&lt;/p&gt;
&lt;h2 id="object-input"&gt;Object Input&lt;/h2&gt;
&lt;div class="restish-playground" data-restish-playground&gt;
 &lt;div class="restish-playground__bar"&gt;
 &lt;div&gt;
 &lt;span class="restish-playground__eyebrow"&gt;Browser preview&lt;/span&gt;
 &lt;p class="restish-playground__hint"&gt;Edit the command and run it from your browser against the live docs API.&lt;/p&gt;
 &lt;/div&gt;
 &lt;div class="restish-playground__actions"&gt;
 &lt;span class="restish-playground__state" data-restish-state&gt;Ready&lt;/span&gt;
 &lt;button class="restish-playground__button" type="button" data-restish-run aria-controls="restish-example-0-output"&gt;
 &lt;i class="fas fa-play" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;span&gt;Run&lt;/span&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-copy title="Copy command" aria-label="Copy command"&gt;
 &lt;i class="fas fa-copy" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-reset title="Reset command" aria-label="Reset command"&gt;
 &lt;i class="fas fa-rotate-left" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;label class="visually-hidden" for="restish-example-0-command"&gt;Restish command&lt;/label&gt;
 &lt;div class="restish-playground__terminal-line"&gt;
 &lt;span class="restish-playground__prompt" aria-hidden="true"&gt;$&lt;/span&gt;
 &lt;div class="restish-playground__command-wrap"&gt;
 &lt;div class="restish-playground__command-highlight" aria-hidden="true"&gt;&lt;code class="language-bash" data-restish-command-highlight&gt;restish post api.rest.sh/post &amp;#39;name: Alice, enabled: true, count: 3&amp;#39;&lt;/code&gt;&lt;/div&gt;
 &lt;input id="restish-example-0-command" class="restish-playground__command" type="text" spellcheck="false" autocomplete="off" autocapitalize="off" value="restish post api.rest.sh/post &amp;#39;name: Alice, enabled: true, count: 3&amp;#39;" data-restish-command&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;pre id="restish-example-0-output" class="restish-playground__output" aria-live="polite" hidden&gt;&lt;code class="language-readable" data-restish-output&gt;&lt;/code&gt;&lt;/pre&gt;
 &lt;noscript&gt;
 &lt;p class="restish-playground__noscript"&gt;Enable JavaScript to run this example in the browser.&lt;/p&gt;</description></item><item><title>Output</title><link>https://rest.sh/docs/guides/output/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/output/</guid><description>&lt;p&gt;Restish output is built around one rule: stdout carries the selected HTTP
exchange parts, while stderr carries diagnostics, warnings, progress, and
verbose traces.&lt;/p&gt;
&lt;h2 id="processing-model"&gt;Processing Model&lt;/h2&gt;
&lt;pre class="mermaid"&gt;flowchart LR
 A[HTTP response] --&amp;gt; B[Decompress]
 B --&amp;gt; C[Decode by Content-Type]
 C --&amp;gt; D[Normalize status, headers, links, body]
 D --&amp;gt; E[Paginate or stream]
 E --&amp;gt; F[Filter]
 F --&amp;gt; G[Format]&lt;/pre&gt;
&lt;h2 id="choose-a-format"&gt;Choose A Format&lt;/h2&gt;
&lt;div class="restish-playground" data-restish-playground&gt;
 &lt;div class="restish-playground__bar"&gt;
 &lt;div&gt;
 &lt;span class="restish-playground__eyebrow"&gt;Browser preview&lt;/span&gt;
 &lt;p class="restish-playground__hint"&gt;Edit the command and run it from your browser against the live docs API.&lt;/p&gt;</description></item><item><title>Filtering</title><link>https://rest.sh/docs/guides/filtering/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/filtering/</guid><description>&lt;p&gt;Filtering trims a normalized Restish response before formatting. Use shorthand
for direct paths and projections; use jq for richer transforms.&lt;/p&gt;
&lt;h2 id="filter-roots"&gt;Filter Roots&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;proto&lt;/code&gt; for the response protocol string&lt;/li&gt;
&lt;li&gt;&lt;code&gt;status&lt;/code&gt; for the numeric HTTP status&lt;/li&gt;
&lt;li&gt;&lt;code&gt;headers&lt;/code&gt; for response headers&lt;/li&gt;
&lt;li&gt;&lt;code&gt;links&lt;/code&gt; for normalized hypermedia links&lt;/li&gt;
&lt;li&gt;&lt;code&gt;body&lt;/code&gt; for decoded response body&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="restish-playground" data-restish-playground&gt;
 &lt;div class="restish-playground__bar"&gt;
 &lt;div&gt;
 &lt;span class="restish-playground__eyebrow"&gt;Browser preview&lt;/span&gt;
 &lt;p class="restish-playground__hint"&gt;Edit the command and run it from your browser against the live docs API.&lt;/p&gt;
 &lt;/div&gt;
 &lt;div class="restish-playground__actions"&gt;
 &lt;span class="restish-playground__state" data-restish-state&gt;Ready&lt;/span&gt;
 &lt;button class="restish-playground__button" type="button" data-restish-run aria-controls="restish-example-0-output"&gt;
 &lt;i class="fas fa-play" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;span&gt;Run&lt;/span&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-copy title="Copy command" aria-label="Copy command"&gt;
 &lt;i class="fas fa-copy" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-reset title="Reset command" aria-label="Reset command"&gt;
 &lt;i class="fas fa-rotate-left" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;label class="visually-hidden" for="restish-example-0-command"&gt;Restish command&lt;/label&gt;
 &lt;div class="restish-playground__terminal-line"&gt;
 &lt;span class="restish-playground__prompt" aria-hidden="true"&gt;$&lt;/span&gt;
 &lt;div class="restish-playground__command-wrap"&gt;
 &lt;div class="restish-playground__command-highlight" aria-hidden="true"&gt;&lt;code class="language-bash" data-restish-command-highlight&gt;restish api.rest.sh/ -f headers.Content-Type&lt;/code&gt;&lt;/div&gt;
 &lt;input id="restish-example-0-command" class="restish-playground__command" type="text" spellcheck="false" autocomplete="off" autocapitalize="off" value="restish api.rest.sh/ -f headers.Content-Type" data-restish-command&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;pre id="restish-example-0-output" class="restish-playground__output" aria-live="polite" hidden&gt;&lt;code class="language-readable" data-restish-output&gt;&lt;/code&gt;&lt;/pre&gt;
 &lt;noscript&gt;
 &lt;p class="restish-playground__noscript"&gt;Enable JavaScript to run this example in the browser.&lt;/p&gt;</description></item><item><title>Pagination and Links</title><link>https://rest.sh/docs/guides/pagination/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/pagination/</guid><description>&lt;p&gt;Restish follows recognized &lt;code&gt;next&lt;/code&gt; links for collection responses by default.
Use limits and collect mode to make the behavior explicit.&lt;/p&gt;
&lt;h2 id="automatic-pagination"&gt;Automatic Pagination&lt;/h2&gt;
&lt;div class="restish-playground" data-restish-playground&gt;
 &lt;div class="restish-playground__bar"&gt;
 &lt;div&gt;
 &lt;span class="restish-playground__eyebrow"&gt;Browser preview&lt;/span&gt;
 &lt;p class="restish-playground__hint"&gt;Edit the command and run it from your browser against the live docs API.&lt;/p&gt;
 &lt;/div&gt;
 &lt;div class="restish-playground__actions"&gt;
 &lt;span class="restish-playground__state" data-restish-state&gt;Ready&lt;/span&gt;
 &lt;button class="restish-playground__button" type="button" data-restish-run aria-controls="restish-example-0-output"&gt;
 &lt;i class="fas fa-play" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;span&gt;Run&lt;/span&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-copy title="Copy command" aria-label="Copy command"&gt;
 &lt;i class="fas fa-copy" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;button class="restish-playground__icon-button" type="button" data-restish-reset title="Reset command" aria-label="Reset command"&gt;
 &lt;i class="fas fa-rotate-left" aria-hidden="true"&gt;&lt;/i&gt;
 &lt;/button&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;label class="visually-hidden" for="restish-example-0-command"&gt;Restish command&lt;/label&gt;
 &lt;div class="restish-playground__terminal-line"&gt;
 &lt;span class="restish-playground__prompt" aria-hidden="true"&gt;$&lt;/span&gt;
 &lt;div class="restish-playground__command-wrap"&gt;
 &lt;div class="restish-playground__command-highlight" aria-hidden="true"&gt;&lt;code class="language-bash" data-restish-command-highlight&gt;restish api.rest.sh/images -f body.self -o lines&lt;/code&gt;&lt;/div&gt;
 &lt;input id="restish-example-0-command" class="restish-playground__command" type="text" spellcheck="false" autocomplete="off" autocapitalize="off" value="restish api.rest.sh/images -f body.self -o lines" data-restish-command&gt;
 &lt;/div&gt;
 &lt;/div&gt;
 &lt;pre id="restish-example-0-output" class="restish-playground__output" aria-live="polite" hidden&gt;&lt;code class="language-readable" data-restish-output&gt;&lt;/code&gt;&lt;/pre&gt;
 &lt;noscript&gt;
 &lt;p class="restish-playground__noscript"&gt;Enable JavaScript to run this example in the browser.&lt;/p&gt;</description></item><item><title>Links and Hypermedia</title><link>https://rest.sh/docs/guides/links-and-hypermedia/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/links-and-hypermedia/</guid><description>&lt;p&gt;Restish normalizes hypermedia links so filters, pagination, and the &lt;code&gt;links&lt;/code&gt;
command can use one shape even when APIs expose links differently.&lt;/p&gt;
&lt;h2 id="recognized-link-sources"&gt;Recognized Link Sources&lt;/h2&gt;
&lt;p&gt;Restish can extract links from sources such as:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;HTTP &lt;code&gt;Link&lt;/code&gt; headers&lt;/li&gt;
&lt;li&gt;HAL-style &lt;code&gt;_links&lt;/code&gt;, including arrays of HAL resources&lt;/li&gt;
&lt;li&gt;JSON:API-style top-level &lt;code&gt;links&lt;/code&gt; and resource &lt;code&gt;links.self&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;Siren links&lt;/li&gt;
&lt;li&gt;JSON-LD or TSJ &lt;code&gt;@id&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;simple REST-ish &lt;code&gt;self&lt;/code&gt; fields on top-level objects or nested array items&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The exact source matters less to users than the normalized result: relation
names such as &lt;code&gt;self&lt;/code&gt;, &lt;code&gt;next&lt;/code&gt;, and &lt;code&gt;prev&lt;/code&gt; become queryable under &lt;code&gt;links&lt;/code&gt;.
Nested array item links use relation names based on the field, such as
&lt;code&gt;things-item&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>Edit Workflow</title><link>https://rest.sh/docs/guides/edit-workflow/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/edit-workflow/</guid><description>&lt;p&gt;&lt;code&gt;restish edit&lt;/code&gt; is for fetch-edit-update workflows. It gets the resource,
opens an editor or applies shorthand changes, then writes the result back.&lt;/p&gt;
&lt;h2 id="edit-in-your-editor"&gt;Edit In Your Editor&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish edit api.rest.sh/types
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Restish uses &lt;code&gt;$VISUAL&lt;/code&gt;, then &lt;code&gt;$EDITOR&lt;/code&gt;, and falls back to the platform default
where possible.&lt;/p&gt;
&lt;p&gt;After the editor exits, Restish parses the file and compares the normalized
resource value. If the editor only changed whitespace, indentation, key spacing,
or trailing newlines, Restish reports no changes and does not send an update.&lt;/p&gt;</description></item><item><title>Retries and Caching</title><link>https://rest.sh/docs/guides/retries-and-caching/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/retries-and-caching/</guid><description>&lt;p&gt;Restish retries conservative transient failures and uses a disk-backed HTTP
cache for cacheable responses.&lt;/p&gt;
&lt;h2 id="retry-behavior"&gt;Retry Behavior&lt;/h2&gt;
&lt;p&gt;Restish retries network errors plus &lt;code&gt;408&lt;/code&gt;, &lt;code&gt;429&lt;/code&gt;, &lt;code&gt;500&lt;/code&gt;, &lt;code&gt;502&lt;/code&gt;, &lt;code&gt;503&lt;/code&gt;, and
&lt;code&gt;504&lt;/code&gt; responses by default. Automatic retries are limited to &lt;code&gt;GET&lt;/code&gt; and &lt;code&gt;HEAD&lt;/code&gt;,
where retrying is normally safe. &lt;code&gt;--rsh-retry N&lt;/code&gt; controls the attempt count;
use &lt;code&gt;--rsh-retry-unsafe&lt;/code&gt; only when you want to retry POST, PUT, PATCH, or
DELETE, because that can repeat side effects if the server processed the first
attempt. Restish honors &lt;code&gt;Retry-After&lt;/code&gt; and &lt;code&gt;X-Retry-In&lt;/code&gt; when present, capped at
5 minutes by default. Use
&lt;code&gt;--rsh-retry-max-wait 30s&lt;/code&gt; for one command, or set an API-level
&lt;code&gt;retry_max_wait&lt;/code&gt; duration in &lt;code&gt;restish.json&lt;/code&gt;, when a service needs a shorter
rate-limit wait.&lt;/p&gt;</description></item><item><title>Command Behavior</title><link>https://rest.sh/docs/guides/command-behavior/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/command-behavior/</guid><description>&lt;p&gt;Restish is designed for terminals and scripts. Output channels, exit codes, and
verbose diagnostics are part of the interface.&lt;/p&gt;
&lt;h2 id="exit-codes"&gt;Exit Codes&lt;/h2&gt;
&lt;p&gt;Restish uses a compact exit-code policy:&lt;/p&gt;
&lt;table&gt;
 &lt;thead&gt;
 &lt;tr&gt;
 &lt;th&gt;Result&lt;/th&gt;
 &lt;th&gt;Exit code&lt;/th&gt;
 &lt;th&gt;Notes&lt;/th&gt;
 &lt;/tr&gt;
 &lt;/thead&gt;
 &lt;tbody&gt;
 &lt;tr&gt;
 &lt;td&gt;Successful command, including final HTTP &lt;code&gt;2xx&lt;/code&gt; responses&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;0&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Redirects are followed before the final status is evaluated.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Final HTTP &lt;code&gt;3xx&lt;/code&gt; response&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;3&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Redirects are followed before the final status is evaluated.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Final HTTP &lt;code&gt;4xx&lt;/code&gt; response&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;4&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Restish still writes the response body before exiting non-zero.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Final HTTP &lt;code&gt;5xx&lt;/code&gt; response&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;5&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Restish still writes the response body before exiting non-zero.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Runtime failure&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;1&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Network errors, TLS failures, config problems, auth failures, parse errors, formatter errors, and most plugin failures.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Usage error&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;2&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Missing arguments, unknown commands, unknown flags, or invalid flag values before the request runs.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Interrupted with &lt;code&gt;Ctrl-C&lt;/code&gt; / SIGINT&lt;/td&gt;
 &lt;td&gt;&lt;code&gt;130&lt;/code&gt;&lt;/td&gt;
 &lt;td&gt;Matches the usual shell convention for interrupted processes.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;tr&gt;
 &lt;td&gt;Command plugin exit code&lt;/td&gt;
 &lt;td&gt;plugin-defined&lt;/td&gt;
 &lt;td&gt;Command plugins may return their own &lt;code&gt;0&lt;/code&gt;-&lt;code&gt;255&lt;/code&gt; exit code.&lt;/td&gt;
 &lt;/tr&gt;
 &lt;/tbody&gt;
&lt;/table&gt;
&lt;p&gt;Inspect an error body without failing the shell command:&lt;/p&gt;</description></item><item><title>Scripting and Automation</title><link>https://rest.sh/docs/guides/automation/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/automation/</guid><description>&lt;p&gt;Restish is scriptable when response data stays on stdout, diagnostics stay on
stderr, and long-running work is bounded. Use this guide for CI, cron jobs,
shell loops, and small automation around APIs.&lt;/p&gt;
&lt;h2 id="output-streams"&gt;Output Streams&lt;/h2&gt;
&lt;p&gt;Selected output is written to stdout. Progress, verbose request/response
details, plugin diagnostics, migration notices, and warnings are written to
stderr. Redirecting or piping stdout changes &lt;code&gt;--rsh-print=auto&lt;/code&gt; from an
interactive response transcript to raw body bytes for unfiltered responses, or
to pretty rendered output when a filter, metadata shortcut, collection, or
explicit output format is selected.&lt;/p&gt;</description></item><item><title>Streaming</title><link>https://rest.sh/docs/guides/streaming/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/streaming/</guid><description>&lt;p&gt;Restish recognizes Server-Sent Events, NDJSON, and JSON Lines. Streaming
responses are processed one event or line at a time instead of waiting for a
complete response body.&lt;/p&gt;
&lt;p&gt;Streams run until EOF, interruption, or an explicit stream limit. Add
&lt;code&gt;--rsh-max-items&lt;/code&gt; when you want a sample or a script with a fixed record count.
For streams, &lt;code&gt;--rsh-timeout&lt;/code&gt; bounds the wait for response headers; once headers
identify SSE or NDJSON, the body can stay open until EOF, Ctrl-C, or
&lt;code&gt;--rsh-max-items&lt;/code&gt;.&lt;/p&gt;</description></item><item><title>TLS</title><link>https://rest.sh/docs/guides/tls/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/tls/</guid><description>&lt;p&gt;Restish verifies TLS certificates by default. Custom CA and mTLS examples
require your own certificate infrastructure, so this page uses private hostnames
for those parts.&lt;/p&gt;
&lt;h2 id="inspect-a-server-certificate"&gt;Inspect A Server Certificate&lt;/h2&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish cert api.rest.sh
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish cert --warn-days &lt;span class="m"&gt;14&lt;/span&gt; api.rest.sh
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;&lt;code&gt;cert&lt;/code&gt; is TLS-only. Bare hosts default to &lt;code&gt;https://&lt;/code&gt;; &lt;code&gt;http://&lt;/code&gt; targets are
rejected before any network connection.&lt;/p&gt;
&lt;h2 id="trust-a-custom-ca"&gt;Trust A Custom CA&lt;/h2&gt;
&lt;p&gt;Use this when your organization uses a private CA:&lt;/p&gt;
&lt;div class="highlight"&gt;&lt;pre tabindex="0" class="chroma"&gt;&lt;code class="language-bash" data-lang="bash"&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish --rsh-ca-cert ./corp-ca.pem https://service.internal.test/items
&lt;/span&gt;&lt;/span&gt;&lt;span class="line"&gt;&lt;span class="cl"&gt;restish cert --rsh-ca-cert ./corp-ca.pem https://service.internal.test
&lt;/span&gt;&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;&lt;/div&gt;&lt;p&gt;Prerequisite: &lt;code&gt;corp-ca.pem&lt;/code&gt; must contain the PEM-encoded CA certificate that
signed the server certificate.
If the platform trust store cannot be loaded, Restish fails closed instead of
continuing with only the custom CA file.&lt;/p&gt;</description></item><item><title>Troubleshooting</title><link>https://rest.sh/docs/guides/troubleshooting/</link><pubDate>Mon, 01 Jan 0001 00:00:00 +0000</pubDate><guid>https://rest.sh/docs/guides/troubleshooting/</guid><description>&lt;p&gt;Use this page when the command ran but the result was surprising, or when the
command did not run because shell, config, auth, TLS, or plugin setup got in the
way.&lt;/p&gt;
&lt;h2 id="the-shell-rewrites-my-url-or-filter"&gt;The Shell Rewrites My URL Or Filter&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;Symptom:&lt;/strong&gt; A command with &lt;code&gt;?&lt;/code&gt;, &lt;code&gt;&amp;amp;&lt;/code&gt;, &lt;code&gt;[0]&lt;/code&gt;, &lt;code&gt;[]&lt;/code&gt;, or &lt;code&gt;*&lt;/code&gt; fails before Restish
sends a request.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Likely cause:&lt;/strong&gt; Your shell expanded the characters.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;How to confirm:&lt;/strong&gt; Quote the URL or filter and retry.&lt;/p&gt;</description></item></channel></rss>