From 5b6cf37d07453f591782036f25d83c71840b7387 Mon Sep 17 00:00:00 2001 From: Ryan Fowler Date: Mon, 13 Jul 2026 16:42:13 -0400 Subject: [PATCH] docs: streamline documentation structure Reduce the root README to essential setup and usage, add a documentation index and dedicated Agent Skill guide, and format the Markdown documentation consistently. --- AGENTS.md | 26 +++--- README.md | 183 ++++++++------------------------------ docs/README.md | 36 ++++++++ docs/advanced-features.md | 3 +- docs/agent-skill.md | 103 +++++++++++++++++++++ docs/cli-reference.md | 29 ++---- docs/ech.md | 18 ++-- docs/getting-started.md | 2 + docs/image-rendering.md | 6 +- docs/request-bodies.md | 26 +++--- docs/websocket.md | 6 ++ 11 files changed, 236 insertions(+), 202 deletions(-) create mode 100644 docs/README.md create mode 100644 docs/agent-skill.md diff --git a/AGENTS.md b/AGENTS.md index a4b6194b..9950b00f 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -52,19 +52,19 @@ cargo build --release --locked ## Architecture Map -| Area | Files | Notes | -| --- | --- | --- | -| Entry | `src/main.rs`, `src/app.rs`, `src/cli.rs` | `main` runs the Tokio runtime on a spawned thread without overriding the platform default stack size; this avoids Windows' small process-main stack while removing the custom 16 MiB stack. Do not move stack-heavy entry futures back to the process main thread. | -| Core IO | `src/core.rs`, `src/output`, `src/fileutil.rs` | Central printer/color/format/stdout policy, atomic writes, `~/` expansion, cross-platform locks. Prefer `core::write_stdout`, `core::stdio`, `core::color_enabled`, `core::format_enabled`; avoid direct `print!`/`println!` and ad-hoc terminal checks. | -| Config | `src/config` | INI with host overlays. Config-backed options belong in `config_options!`; duplicate host sections are errors. Metadata commands parse config best-effort only. | -| HTTP | `src/http`, `src/http/response`, `src/http/transport`, `src/net.rs` | Request building/execution, response orchestration, retries, proxies, TLS, Unix sockets, timing. Transport code owns DNS/TCP/TLS/QUIC setup; reuse `src/net.rs` dialing/proxy helpers. | -| DNS | `src/dns` | Custom UDP/TCP/TLS/QUIC/DoH resolvers, inspection, HTTPS/SVCB, EDNS/truncation fallback. Reuse `custom.rs`, `wire.rs`, `doh.rs`; inspection orchestration/rendering stays under `src/dns/inspect*`. | -| TLS | `src/tls` | Shared rustls config, client auth, min/max TLS, ECH, inspection. Inspection orchestration in `inspect.rs`; cert/DER/render helpers stay split. | -| Formatting | `src/format`, `src/format/content_type.rs`, `src/image` | MIME-to-formatter policy, streaming formatters, built-in image defaults; external image adapters only for `--image external`/config and must be bounded. | -| gRPC/protobuf | `src/grpc`, `src/proto` | Framing/status/reflection, local schema/discovery/conversion/JSON streams. Reuse standard gRPC headers/status/framed-body helpers. | -| WebSocket | `src/websocket` | Interactive and non-interactive message loops; custom dialer for DNS/proxy/TLS. | -| Auth/session/update | `src/auth`, `src/session.rs`, `src/update`, `src/skill.rs`, `install.sh` | Auth helpers; locked cookie sessions; HTTPS self-update; offline embedded Agent Skill installation with modification detection. | -| Tests | `tests/`, `tests/support/` | Integration tests run the compiled binary; support code is split by domain. `run_fetch` isolates HTTP/3 cache by default. `TestServer`/`H3TestServer` use `mpsc` channel notification (not polling). `wait_for_requests` blocks via `recv_timeout` on the notification channel. | +| Area | Files | Notes | +| ------------------- | ------------------------------------------------------------------------ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | +| Entry | `src/main.rs`, `src/app.rs`, `src/cli.rs` | `main` runs the Tokio runtime on a spawned thread without overriding the platform default stack size; this avoids Windows' small process-main stack while removing the custom 16 MiB stack. Do not move stack-heavy entry futures back to the process main thread. | +| Core IO | `src/core.rs`, `src/output`, `src/fileutil.rs` | Central printer/color/format/stdout policy, atomic writes, `~/` expansion, cross-platform locks. Prefer `core::write_stdout`, `core::stdio`, `core::color_enabled`, `core::format_enabled`; avoid direct `print!`/`println!` and ad-hoc terminal checks. | +| Config | `src/config` | INI with host overlays. Config-backed options belong in `config_options!`; duplicate host sections are errors. Metadata commands parse config best-effort only. | +| HTTP | `src/http`, `src/http/response`, `src/http/transport`, `src/net.rs` | Request building/execution, response orchestration, retries, proxies, TLS, Unix sockets, timing. Transport code owns DNS/TCP/TLS/QUIC setup; reuse `src/net.rs` dialing/proxy helpers. | +| DNS | `src/dns` | Custom UDP/TCP/TLS/QUIC/DoH resolvers, inspection, HTTPS/SVCB, EDNS/truncation fallback. Reuse `custom.rs`, `wire.rs`, `doh.rs`; inspection orchestration/rendering stays under `src/dns/inspect*`. | +| TLS | `src/tls` | Shared rustls config, client auth, min/max TLS, ECH, inspection. Inspection orchestration in `inspect.rs`; cert/DER/render helpers stay split. | +| Formatting | `src/format`, `src/format/content_type.rs`, `src/image` | MIME-to-formatter policy, streaming formatters, built-in image defaults; external image adapters only for `--image external`/config and must be bounded. | +| gRPC/protobuf | `src/grpc`, `src/proto` | Framing/status/reflection, local schema/discovery/conversion/JSON streams. Reuse standard gRPC headers/status/framed-body helpers. | +| WebSocket | `src/websocket` | Interactive and non-interactive message loops; custom dialer for DNS/proxy/TLS. | +| Auth/session/update | `src/auth`, `src/session.rs`, `src/update`, `src/skill.rs`, `install.sh` | Auth helpers; locked cookie sessions; HTTPS self-update; offline embedded Agent Skill installation with modification detection. | +| Tests | `tests/`, `tests/support/` | Integration tests run the compiled binary; support code is split by domain. `run_fetch` isolates HTTP/3 cache by default. `TestServer`/`H3TestServer` use `mpsc` channel notification (not polling). `wait_for_requests` blocks via `recv_timeout` on the notification channel. | Request flow: CLI parse → config merge → request build (gRPC may load/reflect schema and frame protobuf) → transport execute → response format/output/pager/clipboard. diff --git a/README.md b/README.md index 186a9917..df6bd58a 100644 --- a/README.md +++ b/README.md @@ -4,187 +4,82 @@ A terminal API client for requests, streams, and network debugging. ![Example of fetch with an image and JSON responses](./assets/example.png) -`fetch` combines formatted HTTP responses, terminal image rendering, -WebSockets, gRPC reflection and calls, DNS inspection, TLS certificate -inspection, and request timing in one CLI. +`fetch` combines formatted HTTP responses with WebSockets, gRPC, DNS and TLS +inspection, request timing, authentication, sessions, and terminal-native image +rendering. ## Features -- **Response formatting** - Automatic formatting and syntax highlighting for JSON, XML, YAML, HTML, CSS, CSV, Markdown, MessagePack, Protocol Buffers, and more -- **HTML article to Markdown** - Extract readable content from HTML, convert it to Markdown, and add YAML frontmatter -- **Image rendering** - Display images directly in your terminal -- **WebSocket support** - Bidirectional WebSocket connections with automatic JSON formatting -- **gRPC support** - Make gRPC calls with automatic reflection, discovery, and JSON-to-protobuf conversion -- **Authentication** - Built-in support for Basic Auth, Bearer Token, AWS Signature V4, and mTLS -- **Compression** - Automatic gzip, brotli, and zstd response body decompression -- **TLS inspection** - Inspect TLS certificate chains, expiry, SANs, and OCSP status -- **DNS inspection** - Inspect hostname resolution, record families, TTLs, and resolver timing -- **Timing waterfall** - Visualize request timing phases (DNS, TCP, TLS, TTFB, transfer) with a waterfall chart -- **Configuration** - Global and per-host configuration file support -- **Agent skill** - Bundled offline skill installation for Codex, Claude Code, Gemini CLI, and Pi +- HTTP/1.1, HTTP/2, HTTP/3, WebSockets, and gRPC with reflection +- Automatic formatting for JSON, XML, YAML, HTML, CSV, Markdown, MessagePack, + Protocol Buffers, SSE, NDJSON, and images +- JSON, XML, forms, multipart uploads, files, stdin, and editor-based bodies +- Basic, Digest, Bearer, AWS SigV4, and mutual TLS authentication +- DNS, TLS certificate, and request timing diagnostics +- Proxies, custom DNS, cookie sessions, configuration, and self-update workflows ## Quick Start -#### Install +Install on macOS or Linux: ```sh -# Install fetch from the shell script (macOS or Linux) curl -fsSL https://raw.githubusercontent.com/ryanfowler/fetch/main/install.sh | bash - -# Or install fetch with homebrew (macOS or Linux) -brew install ryanfowler/tap/fetch - -# Or build fetch from source with Cargo -cargo install --git https://github.com/ryanfowler/fetch --locked ``` -#### Usage +Or use Homebrew or Cargo: ```sh -# Make a request for JSON -fetch httpbin.org/json - -# Make a request for an image -fetch picsum.photos/1024/1024 - -# Open the full command menu / detailed CLI reference -fetch -v -h +brew install ryanfowler/tap/fetch +cargo install --git https://github.com/ryanfowler/fetch --locked ``` -> Tip: `fetch -h` shows concise help. Add `-v` (`fetch -v -h` or -> `fetch -v --help`) to open the full, colorized command menu with detailed -> options, examples, and pager support. - -#### Install the agent skill +Make a request: ```sh -# Use the interoperable ~/.agents/skills/fetch location -fetch --install-skill - -# Or install directly for one agent -fetch --install-skill pi - -# Install all generic and agent-specific locations -fetch --install-skill all - -# Preview a project-local installation -fetch --install-skill all --scope project --dry-run +fetch httpbin.org/json ``` -The skill is embedded in `fetch`, so installation is offline. The installer -shows destinations before writing, detects modified installations, and does not -edit agent configuration files. See [the CLI reference](docs/cli-reference.md#agent-skill-options). - -## Output Model - -`fetch` keeps response bodies and metadata separate: the body is written to -stdout, while status lines, headers, progress, timing, warnings, and errors are -written to stderr. This makes commands like `fetch example.com/api | jq .` work -without mixing diagnostics into the pipe. - -When stdout is a terminal, supported response bodies are formatted and may open -in the pager from `$PAGER`; set `NO_PAGER` or use `--pager off` to write -directly. If `$PAGER` is unset, fetch falls back to `less -FIRX` and honors -`$LESS` instead of adding default flags. `$PAGER` is split with POSIX -shell-style quoting, but fetch launches the pager directly and does not -interpret shell operators such as pipes or redirects. Detailed help -(`fetch -v --help`) is colorized and uses the same pager controls. When stdout -is redirected or piped, formatting turns off by default; use `--format on` to -force formatted output in a pipe. Binary-looking responses are not printed to a -terminal unless you explicitly choose an output path with `-o file`, force raw -stdout with `-o - > file`, or disable terminal image rendering with -`--image off`. - -## Examples - -### Everyday API Work +Send JSON (body options infer `POST`): ```sh -# POST JSON and format the response automatically fetch -j '{"name":"Ada"}' https://httpbin.org/post - -# Reuse cookies across requests with a named session -fetch --session api -j '{"user":"me"}' https://example.com/login -fetch --session api https://example.com/dashboard - -# Convert a curl command into a fetch request -fetch --from-curl 'curl -H "Authorization: Bearer TOKEN" https://api.example.com' - -# Extract readable HTML and convert it to Markdown with YAML frontmatter -fetch --article https://example.com/post - -# Show response headers, request+response headers, or full connection details -fetch -v https://example.com -fetch -vv https://example.com -fetch -vvv https://example.com -``` - -### DNS, TLS, and Timing Diagnostics - -```sh -# Inspect DNS records, TTLs, resolver backend, and lookup duration -fetch --inspect-dns example.com - -# Run the same DNS inspection through DNS-over-HTTPS -fetch --inspect-dns --dns-server https://1.1.1.1/dns-query example.com - -# Inspect the TLS certificate chain, expiry, SANs, OCSP, ALPN, and cipher suite -fetch --inspect-tls https://example.com - -# Inspect the HTTP/3 QUIC/TLS path -fetch --inspect-tls --http 3 https://cloudflare.com - -# Show a request timing waterfall for DNS, TCP/TLS or QUIC, TTFB, and body transfer -fetch --timing https://example.com ``` -### WebSocket and gRPC +Inspect a connection or call a reflected gRPC method: ```sh -# Connect to a WebSocket and send an initial JSON message -fetch wss://echo.websocket.events -j '{"type":"ping"}' - -# Discover gRPC services using reflection -fetch --grpc-list https://localhost:50051 - -# Describe a gRPC service, method, or message -fetch --grpc-describe grpc.health.v1.Health http://127.0.0.1:50051 - -# Make a gRPC call with JSON-to-protobuf conversion +fetch -vvv https://example.com fetch --grpc -j '{"service":""}' \ http://127.0.0.1:50051/grpc.health.v1.Health/Check ``` -### Terminal-Friendly Output +`fetch -h` shows concise help. Use `fetch -v -h` for the complete, colorized +command menu. -```sh -# Render images directly in supported terminals -fetch https://httpbin.org/image/png - -# Disable the pager for scripts or small responses -fetch --pager off https://httpbin.org/json +## Output -# Save a response and copy the decoded body to the clipboard -fetch --copy -o response.json https://httpbin.org/json +Response bodies go to stdout; status, headers, timing, warnings, and errors go +to stderr. This keeps pipelines clean: -# Preserve response bytes for compressed downloads -fetch --compress off -o archive.tar.gz https://example.com/archive.tar.gz +```sh +fetch example.com/api | jq . ``` +Terminal output is formatted automatically. Redirected output is unformatted by +default, and binary responses are protected from accidental terminal output. +See [Output Formatting](docs/output-formatting.md) for pager, color, binary, +clipboard, and file behavior. + ## Documentation -- **[Getting Started](docs/getting-started.md)** - Installation, first steps, and basic concepts -- **[CLI Reference](docs/cli-reference.md)** - Complete reference for all command-line options -- **[Configuration](docs/configuration.md)** - Configuration file format and options -- **[Authentication](docs/authentication.md)** - Basic, Bearer, AWS SigV4, and mTLS -- **[Request Bodies](docs/request-bodies.md)** - JSON, XML, forms, multipart, and file uploads -- **[Output Formatting](docs/output-formatting.md)** - Supported content types and formatting options -- **[Image Rendering](docs/image-rendering.md)** - Terminal image protocols and formats -- **[WebSocket](docs/websocket.md)** - Bidirectional WebSocket connections -- **[gRPC](docs/grpc.md)** - Making gRPC requests with Protocol Buffers -- **[Advanced Features](docs/advanced-features.md)** - DNS, proxies, TLS, HTTP versions, and more -- **[Updates](docs/updates.md)** - Manual updates, auto-update behavior, verification, and update files -- **[Troubleshooting](docs/troubleshooting.md)** - Common issues, debugging, and exit codes +Start with the **[documentation index](docs/README.md)**, or jump directly to: + +- **[Getting Started](docs/getting-started.md)** — installation and common tasks +- **[CLI Reference](docs/cli-reference.md)** — every command-line option +- **[Configuration](docs/configuration.md)** — global and per-host settings +- **[Request Bodies](docs/request-bodies.md)** — JSON, forms, multipart, and files +- **[Authentication](docs/authentication.md)** — supported authentication methods +- **[Troubleshooting](docs/troubleshooting.md)** — diagnostics and exit codes ## License diff --git a/docs/README.md b/docs/README.md new file mode 100644 index 00000000..4f1366a2 --- /dev/null +++ b/docs/README.md @@ -0,0 +1,36 @@ +# fetch Documentation + +Use this index to find the right guide. For a searchable reference inside the +terminal, run `fetch -v -h`. + +## Start Here + +- **[Getting Started](getting-started.md)** — installation, first requests, output basics, and common tasks +- **[CLI Reference](cli-reference.md)** — complete command-line option reference +- **[Configuration](configuration.md)** — configuration files, precedence, and per-host settings +- **[Troubleshooting](troubleshooting.md)** — common failures, diagnostics, and exit codes + +## Requests and Authentication + +- **[Request Bodies](request-bodies.md)** — raw data, JSON, XML, forms, multipart uploads, stdin, and editor input +- **[Authentication](authentication.md)** — Basic, Digest, Bearer, AWS SigV4, custom headers, and mutual TLS + +## Output + +- **[Output Formatting](output-formatting.md)** — content types, article extraction, files, paging, color, and binary output +- **[Image Rendering](image-rendering.md)** — terminal protocols, built-in decoders, and external adapters + +## Protocols + +- **[WebSocket](websocket.md)** — interactive and piped bidirectional connections +- **[gRPC](grpc.md)** — reflection, local schemas, protobuf conversion, and streaming + +## Networking and Security + +- **[Advanced Features](advanced-features.md)** — custom DNS, proxies, Unix sockets, HTTP versions, TLS, compression, sessions, and timing +- **[Encrypted Client Hello](ech.md)** — ECH discovery, modes, configuration, and inspection + +## Maintenance and Integrations + +- **[Updates](updates.md)** — manual and automatic updates, verification, and cache files +- **[Agent Skill](agent-skill.md)** — offline installation for supported coding agents diff --git a/docs/advanced-features.md b/docs/advanced-features.md index 80e77f8b..1a2fda49 100644 --- a/docs/advanced-features.md +++ b/docs/advanced-features.md @@ -50,8 +50,7 @@ fetch --dns-server tls://dns.google:853 example.com ### DNS over QUIC (DoQ) -Use the `quic://` or `doq://` scheme for DNS over QUIC. The default port is -853. Both IP addresses and hostnames are accepted. +Use the `quic://` or `doq://` scheme for DNS over QUIC. The default port is 853. Both IP addresses and hostnames are accepted. ```sh fetch --dns-server quic://1.1.1.1 example.com diff --git a/docs/agent-skill.md b/docs/agent-skill.md new file mode 100644 index 00000000..b861c2fa --- /dev/null +++ b/docs/agent-skill.md @@ -0,0 +1,103 @@ +# Agent Skill + +`fetch` includes an Agent Skill that teaches supported coding agents how to use +the CLI. The skill is embedded in the binary, so viewing, installing, and +uninstalling it require no network access. + +## View the Skill + +Print the embedded `SKILL.md` without installing it: + +```sh +fetch --skill +``` + +## Install + +Install to the interoperable Agents location: + +```sh +fetch --install-skill +``` + +Choose a specific agent, or install all supported targets: + +```sh +fetch --install-skill codex +fetch --install-skill claude +fetch --install-skill gemini +fetch --install-skill pi +fetch --install-skill all +``` + +The default scope is `user`. Use `--scope project` to install inside the current +project: + +```sh +fetch --install-skill pi --scope project +``` + +| Target | User scope | Project scope | +| ------------------ | -------------------------- | ---------------------- | +| `agents` (default) | `~/.agents/skills/fetch` | `.agents/skills/fetch` | +| `codex` | `~/.codex/skills/fetch` | `.codex/skills/fetch` | +| `claude` | `~/.claude/skills/fetch` | `.claude/skills/fetch` | +| `gemini` | `~/.gemini/skills/fetch` | `.gemini/skills/fetch` | +| `pi` | `~/.pi/agent/skills/fetch` | `.pi/skills/fetch` | + +`all` means the five locations in the table; it does not probe for or write to +other agent directories. + +## Preview Changes + +Use `--dry-run` to show every destination without writing: + +```sh +fetch --install-skill all --scope project --dry-run +fetch --uninstall-skill all --dry-run +``` + +When attached to a terminal, install and uninstall commands show their +destinations and ask for confirmation before making changes. + +## Update or Replace an Installation + +Each installed copy includes `.fetch-skill.json`, which records the skill and +`fetch` versions plus file hashes. This allows `fetch` to detect local +modifications before replacing or deleting an installation. + +By default, modified installations are left untouched. Review the destination, +then use `--force` if replacement is intentional: + +```sh +fetch --install-skill pi --force +``` + +## Uninstall + +Remove the generic installation, a specific agent installation, or every +supported installation: + +```sh +fetch --uninstall-skill +fetch --uninstall-skill pi +fetch --uninstall-skill all --scope project +``` + +Uninstall uses the same modification checks as installation. Use `--force` only +when you intend to remove a locally changed copy. + +## Safety and Scope + +The skill workflow: + +- operates only on the selected user or project destinations; +- does not download files; +- does not edit agent configuration files; +- detects modified installations before replacement or removal; and +- uses locked, atomic filesystem operations. + +## See Also + +- [CLI Reference](cli-reference.md#agent-skill-options) +- [Getting Started](getting-started.md) diff --git a/docs/cli-reference.md b/docs/cli-reference.md index 189d01aa..57215393 100644 --- a/docs/cli-reference.md +++ b/docs/cli-reference.md @@ -814,34 +814,21 @@ background auto-update behavior, and cache/lock files. ### Agent skill options -The fetch Agent Skill is embedded in the binary and can be installed offline. -Choose an agent-specific location or the interoperable `agents` location: - -| Target | User scope | Project scope | -| --- | --- | --- | -| `agents` (default) | `~/.agents/skills/fetch` | `.agents/skills/fetch` | -| `codex` | `~/.codex/skills/fetch` | `.codex/skills/fetch` | -| `claude` | `~/.claude/skills/fetch` | `.claude/skills/fetch` | -| `gemini` | `~/.gemini/skills/fetch` | `.gemini/skills/fetch` | -| `pi` | `~/.pi/agent/skills/fetch` | `.pi/skills/fetch` | +View, install, or uninstall the Agent Skill embedded in the binary: ```sh -fetch --skill # print SKILL.md +fetch --skill fetch --install-skill [agents|codex|claude|gemini|pi|all] fetch --uninstall-skill [agents|codex|claude|gemini|pi|all] ``` -User scope is the default; use `--scope project` for the project locations -shown above. Install and uninstall commands show every destination before -changing it and ask for confirmation when attached to a terminal. `--dry-run` -previews changes and `--force` permits replacing or removing a locally modified -installation. No agent configuration files are changed and installation -performs no network requests. +`agents` is the default target. User scope is the default; use +`--scope user|project` to select the destination scope. `--dry-run` previews +changes, and `--force` permits replacing or removing a locally modified +installation. -Each installed copy contains `.fetch-skill.json`, recording the skill version, -fetch version, and hashes used to detect local modifications. `all` means the -five locations listed above; it does not probe and write to additional -directories. +See [Agent Skill](agent-skill.md) for destination paths, modification detection, +and safety behavior. ### `--complete SHELL` diff --git a/docs/ech.md b/docs/ech.md index 38edf29f..f8740845 100644 --- a/docs/ech.md +++ b/docs/ech.md @@ -89,11 +89,17 @@ or raise them to 1.3 when using ECH. curl's `--ech` flag maps to fetch: -| curl | fetch | -|------|-------| -| `--ech hard` | `--ech on` | -| `--ech true` | `--ech on` | -| `--ech auto` | `--ech auto` | -| `--ech false` | `--ech off` | +| curl | fetch | +| ------------- | ------------ | +| `--ech hard` | `--ech on` | +| `--ech true` | `--ech on` | +| `--ech auto` | `--ech auto` | +| `--ech false` | `--ech off` | The `--from-curl` flag translates curl's ECH flags automatically. + +## See Also + +- [Advanced Features](advanced-features.md#tls-configuration) +- [Configuration](configuration.md) +- [CLI Reference](cli-reference.md#--ech-mode) diff --git a/docs/getting-started.md b/docs/getting-started.md index 5d7d5c9f..5929305b 100644 --- a/docs/getting-started.md +++ b/docs/getting-started.md @@ -373,3 +373,5 @@ fetch --complete fish > ~/.config/fish/completions/fetch.fish - **[Output Formatting](output-formatting.md)** - Formatting and syntax highlighting details - **[Updates](updates.md)** - Keep `fetch` current - **[Image Rendering](image-rendering.md)** - Rendering images in the terminal +- **[Agent Skill](agent-skill.md)** - Install the embedded skill for coding agents +- **[Documentation Index](README.md)** - Browse every guide diff --git a/docs/image-rendering.md b/docs/image-rendering.md index 3e8b448d..e6e15f20 100644 --- a/docs/image-rendering.md +++ b/docs/image-rendering.md @@ -8,11 +8,11 @@ Control how images are rendered: -| Value | Description | -| ---------- | ------------------------------------------------------------- | +| Value | Description | +| ---------- | -------------------------------------------------------------- | | `auto` | Try optimal terminal protocol with built-in decoders (default) | | `external` | Allow external adapters for additional formats | -| `off` | Disable image rendering | +| `off` | Disable image rendering | ```sh fetch --image external example.com/photo.avif diff --git a/docs/request-bodies.md b/docs/request-bodies.md index c456db43..1a2e97b9 100644 --- a/docs/request-bodies.md +++ b/docs/request-bodies.md @@ -47,19 +47,19 @@ cat data.json | fetch -d @- example.com/api When using `@filename`, the Content-Type is detected from the file extension. Multipart file parts use the same policy. Some examples are: -| Extension | Content-Type | -| ---------------- | --------------------------- | -| `.json` | `application/json` | -| `.xml` | `application/xml` | -| `.html`, `.htm` | `text/html` | -| `.txt`, `.text` | `text/plain` | -| `.csv` | `text/csv` | -| `.md` | `text/markdown` | -| `.ndjson` | `application/x-ndjson` | -| `.msgpack` | `application/msgpack` | -| `.pb` | `application/protobuf` | -| Image extensions | matching `image/*` type | -| Unknown | `application/octet-stream` | +| Extension | Content-Type | +| ---------------- | -------------------------- | +| `.json` | `application/json` | +| `.xml` | `application/xml` | +| `.html`, `.htm` | `text/html` | +| `.txt`, `.text` | `text/plain` | +| `.csv` | `text/csv` | +| `.md` | `text/markdown` | +| `.ndjson` | `application/x-ndjson` | +| `.msgpack` | `application/msgpack` | +| `.pb` | `application/protobuf` | +| Image extensions | matching `image/*` type | +| Unknown | `application/octet-stream` | Override with a header: diff --git a/docs/websocket.md b/docs/websocket.md index d2ae5f3b..556cfcc5 100644 --- a/docs/websocket.md +++ b/docs/websocket.md @@ -141,3 +141,9 @@ fetch --connect-timeout 2 --timeout 10 wss://api.example.com/ws - WebSocket requires HTTP/1.1 for the upgrade handshake. Using `--http 2` or `--http 3` with WebSocket is not supported. - WebSocket (`ws://` / `wss://`) cannot be combined with `--grpc`, `--form`, `--multipart`, `--xml`, `--edit`, output-file/clipboard flags, or retry flags. - The pager is disabled for WebSocket output. + +## See Also + +- [CLI Reference](cli-reference.md#websocket) +- [Authentication](authentication.md) +- [Advanced Features](advanced-features.md)