Skip to content

Picalines/url-dive

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

url-dive

CLI tool that parses URLs with nested URL-encoded query parameters from/into an editable JSON

URLs often contain query parameter values that are themselves encoded URLs, sometimes multiple levels deep. url-dive recursively decodes them into a readable JSON tree and lets you edit it in your text editor

demo

Usage

# Full list of commands and options
url-dive --help

# parse URL to JSON
url-dive parse "https://example.com/path?redirect=%2Fother%3Ffoo%3Dbar"

# read URL from stdin
echo "/search?q=hello" | url-dive parse

# edit URL interactively in $VISUAL/$EDITOR, output rebuilt URL
url-dive edit "https://example.com/path?redirect=%2Fother%3Ffoo%3Dbar"

# edit URL in clipboard (macOS)
pbpaste | url-dive edit | pbcopy

# build URL back from JSON
url-dive build '{ "pathname":"/search", ... }'

# print JSON schema of the URL format
url-dive schema

Install

# --allow-all is needed for read/write access to `/dev/tty`. See the issue:
# https://github.com/denoland/deno/pull/31105
deno install -g --allow-all jsr:@picalines/url-dive

# Standalone binary to custom folder
deno install -g --allow-all --compile --root ~/bin jsr:@picalines/url-dive

About

CLI tool for editing nested and encoded URLs

Topics

Resources

License

Stars

Watchers

Forks

Contributors