CLI tool to parse URIs into their components
Binaries for linux and macs can be downloaded and installed from the Github Releases.
If you want to install from source:
$ git clone git@github.com:mwarkentin/yuri.git
$ cd yuri
$ make install
$ yuri "https://username:password@stage.example.com: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"
}
Here are the JSON fields provided by yuri:
scheme
: type of URIopaque
: encoded opaque datausername
: basic auth usernamepassword
: basic auth passwordhost
: host or host:porthostname
: host without portport
: portpath
: pathrawpath
: encoded pathrawquery
: encoded query values, without?
fragment
: fragment for references, without#
Run make test
.
Run make vendor
and check in updates.
- 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.