Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/blackmann/go-gurl
Curl TUI with Go as Postman replacement
https://github.com/blackmann/go-gurl
charmbracelet go tui
Last synced: about 2 months ago
JSON representation
Curl TUI with Go as Postman replacement
- Host: GitHub
- URL: https://github.com/blackmann/go-gurl
- Owner: blackmann
- License: bsd-3-clause
- Created: 2022-04-09T18:53:43.000Z (over 2 years ago)
- Default Branch: master
- Last Pushed: 2024-02-16T11:39:28.000Z (10 months ago)
- Last Synced: 2024-10-15T03:05:23.069Z (about 2 months ago)
- Topics: charmbracelet, go, tui
- Language: Go
- Homepage:
- Size: 10.2 MB
- Stars: 101
- Watchers: 4
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-repositories - blackmann/go-gurl - Curl TUI with Go as Postman replacement (Go)
README
# go-gurl
![Demo](assets/demo.gif)
TUI `"curl"` as a personal replacement of Postman. Postman just feels overly bloated in appearance and as a program.
This is written purely in Golang and does not use `curl` under the hood.> I'm working on this while learning Go.
⚠️ This program has lots of problems. Most I may not even know about. But the following are the known limitations at the
moment:- [ ] Windows support (I don't have access to a windows machine at the moment)
- [ ] Cookies support
- [ ] Headers deletion
- [ ] Save/Manipulate response/request
- [ ] Edit/delete bookmarks and history
- [ ] Tests (I have some written)
- [ ] Commands
- [ ] Input validationsI'll be providing implementations as time goes by. Feel free to submit an issue as you try this out.
## How to use
### Installation
```bash
go install github.com/blackmann/go-gurl
```### Keybinds
| Bind | Action |
|-------------|---------------------------------------------------------------------------------------------------------------------------|
| `shift+tab` | Alternate between views (address bar and viewport) |
| `esc` | Enter/leave command mode.
In command mode, you can press the forward or back key to switch between the viewport tabs |
| `ctrl+c` | Quit |
| `$` | Show history. You can filter history with ID or annotation.
_See below on how to annotate history_ |### History
When requests are made, they are saved into history. To trigger the history modal, enter a leading `$`.
You can filter the history with ID number or annotation. Selecting a history item will prefill all request fields (
address, headers and body).To annotate history, first find the history ID then enter command mode (`esc`) then type
```
/annotate $32 create-account
```This feature is useful when you run a request very often when testing.
### Bookmarks
Bookmarks allow to you create and use alias for base paths/endpoints.
For example, if you mostly work with an endpoint `https://jsonplaceholder.typicode.com`, you can be able to create a
bookmark with (in command mode `esc`)```
@typicode https://jsonplaceholder.typicode.com
```You can then use the bookmark in making requests (in the addressbar as)
```
POST @typicode/todos/
```### Save Response
You can save the response from a request to a file by doing (in command mode `esc`)
```
/save shops.json
```You can also save a selected/queried parts of the response. For example, say you have a response with the following
structure:```json
{
"total": 3,
"limit": 10,
"skip": 0,
"data": [
{
"name": "Angelina Cudjoe",
"age": 100,
"cute": true
},
{
"name": "Jane Doe",
"age": 80,
"cute": false
}
]
}
```You can query and save the names from each object like this
```
/save people.json data.#.name
```This saves `["Angelina Cudjoe", "Jane Doe"]` to `people.json`.
Queries are processed using this library [gjson](https://github.com/tidwall/gjson).
Check it out for all the possible query formats.### Copy Response
You can copy the response to your clipboard. Do the following [with an optional selector just like the save command]
```
/copy optional.selector
```