https://github.com/frigus02/curl-history
Wrapper for curl, which stores a history of all requests/responses
https://github.com/frigus02/curl-history
Last synced: over 1 year ago
JSON representation
Wrapper for curl, which stores a history of all requests/responses
- Host: GitHub
- URL: https://github.com/frigus02/curl-history
- Owner: frigus02
- Created: 2021-06-23T08:21:38.000Z (about 5 years ago)
- Default Branch: main
- Last Pushed: 2021-06-27T16:26:11.000Z (about 5 years ago)
- Last Synced: 2024-10-06T09:41:35.842Z (almost 2 years ago)
- Language: Shell
- Homepage:
- Size: 30.3 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# curl-history
**Experimental**
Wrapper for curl, which stores a history of all requests/responses
## Install
Download and source the shell script:
```sh
git clone --depth=1 https://github.com/frigus02/curl-history.git ~/.curl-history
source ~/.curl-history/curl-history.sh
```
It will export 2 functions:
- `curl`: wraps curl and records the output of all executions into a file
- `curlh`: let's you search your curl history
It requires the following external tools:
- [fzf](https://github.com/junegunn/fzf)
- [ripgrep](https://github.com/BurntSushi/ripgrep)
## Usage
Use `curl` as usual.
Then use `curlh` to search for requests and view responses. Examples:
- `curlh example.com`: search for requests where "example.com" is part of the command
- `curlh -o json`: search for requests where "json" is part of the command or output
## Configuration
You can set the following environment variables before sourcing the script.
- `$CURL_HISTORY_CURL` (defaults to `$(command -pv curl)`)
- `$CURL_HISTORY_DIR` (defaults to `~/.config/curl-history`)
- `$CURL_HISTORY_SIZE` (defaults to `1000`)