fetch
is a modern, high-level HTTP(S) client for the command line.
- Response formatting: automatically formats and colors output for supported types (json, xml, etc.)
- Image rendering: render images directly in your terminal
- Compression: automatic gzip response body decompression
- Authentication: support for Basic Auth, Bearer Token, and AWS Signature V4
- Form body: send multipart or urlencoded form bodies
- Editor integration: use an editor to modify the request body
- Configuration: global and per-host configuration
- and more!
You can install fetch
using an installation script, by compiling from source,
or from pre-built binaries.
For macOS or Linux, download and run the install.sh script:
curl -fsSL https://raw.githubusercontent.com/ryanfowler/fetch/main/install.sh | bash
Ensure you have Go installed, then run:
go install github.com/ryanfowler/fetch@latest
Visit the GitHub releases page to download the binary for your operating system.
Once installed, you can update the fetch binary in-place by running:
fetch --update
Or you can let the application auto-update by including the following setting in your configuration file:
auto-update = true
To make a GET request to a URL and print the status code to stderr and the response body to stdout:
fetch example.com
HTTP/1.1 200 OK
{
"name": "example",
"value": 42
}
For complete usage documentation including all available options and advanced features, see USAGE.md.
fetch
can be configured using a file with an ini-like format. Configuration files support both global settings and host-specific configurations.
fetch
searches for configuration files in the following order:
- the file location specified with the
-c
or--config
flag - on Windows at
%AppData%\fetch\config
- on Unix-like systems at
$XDG_CONFIG_HOME/fetch/config
or$HOME/.config/fetch/config
Settings are applied in the following order of precedence:
- CLI flags (highest priority)
- domain-specific configuration
- global configuration
- default values (lowest priority)
# Global settings
color = on
format = on
timeout = 30
# Domain-specific settings
[api.example.com]
header = X-API-Key: your-api-key
timeout = 10
For complete configuration documentation including all available options, file format details, and advanced examples, see CONFIG.md.
fetch
is released under the MIT License.