Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mwarkentin/yuri
CLI tool to parse URIs into their components
https://github.com/mwarkentin/yuri
cli golang homebrew http json parser uri url utility
Last synced: 2 months ago
JSON representation
CLI tool to parse URIs into their components
- Host: GitHub
- URL: https://github.com/mwarkentin/yuri
- Owner: mwarkentin
- License: mit
- Created: 2016-12-21T20:18:33.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2021-11-05T14:36:35.000Z (about 3 years ago)
- Last Synced: 2024-10-04T21:44:19.760Z (3 months ago)
- Topics: cli, golang, homebrew, http, json, parser, uri, url, utility
- Language: Go
- Size: 315 KB
- Stars: 4
- Watchers: 3
- Forks: 3
- Open Issues: 9
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# yuri
CLI tool to parse URIs into their components## Installation
### Binaries
Binaries for linux and macs can be downloaded and installed from the [Github Releases](https://github.com/mwarkentin/yuri/releases).
### Source
If you want to install from source:
```
$ git clone [email protected]:mwarkentin/yuri.git
$ cd yuri
$ make install
```## Examples
### CLI
```
$ yuri "https://username:[email protected]:443/path+to+foo?query1=1&query2=2#FRAG" | jq
{
"fragment": "FRAG",
"host": "stage.example.com:443",
"hostname": "stage.example.com",
"port": "443",
"opaque": "",
"password": "password",
"path": "/path+to+foo",
"rawpath": "/path+to+foo",
"rawquery": "query1=1&query2=2",
"scheme": "https",
"username": "username"
}
```### Available fields
Here are the JSON fields provided by yuri:
* `scheme`: type of URI
* `opaque`: encoded opaque data
* `username`: basic auth username
* `password`: basic auth password
* `host`: host or host:port
* `hostname`: host without port
* `port`: port
* `path`: path
* `rawpath`: encoded path
* `rawquery`: encoded query values, without `?`
* `fragment`: fragment for references, without `#`## Developing yuri
### Running tests
Run `make test`.
### Updating dependencies
Run `make vendor` and check in updates.
### Releasing
* Push tag to Github: `git tag x.y.z && git push origin x.y.z`
* Create release: `gh release create x.y.z`Binaries for multiple architectures (linux / darwin) will be built in [Github Actions](.github/workflows/release.yml).