Agen is a command-line tool for macOS to shorten amazon links
- Mint is a package manager that installs and runs Swift CLI packages. If you haven't installed it yet, install it first.
- Install Agen via mint terminal command:
$ mint install el-hoshino/Agen
. - Done!
- Archive
agen
target from your Xcode application. - After the binary file generated, put the binary file to /usr/local/bin or anywhere you have set as bash path so that you can always use it from anywhere in terminal.
$ agen [options] <url_string>
- -h / --help: Help. (This will ignore all other arguments and won't perform any output.)
- -v / --version: Print version number. (This will ignore all other arguments and won't perform any output.)
- -nc / --no-copy: Don't copy the result to pasteboard.
In a bash environment, &
may be used as an operator, so the output may look like this:
$ agen https://www.amazon.co.jp/dp/B0865ZJKFC/ref=sr_1_2?dchild=1&qid=1588707252&sr=8-2
[1] 5768
[2] 5769
[2]+ Done qid=1588707252
<machine>:Agen <me>$ Shorten URL: https://www.amazon.co.jp/dp/B0865ZJKFC
Result has been copied to your clipboard, you can use cmd + v to paste it.
[1]+ Done agen https://www.amazon.co.jp/dp/B0865ZJKFC/ref=sr_1_2?dchild=1
It looks weird but there's nothing I can do to avoid the superfluous process with my program. If you don't want to see outputs like that, you may use "
so the url string can be forced parsed as an argument like this:
$ agen "https://www.amazon.co.jp/dp/B0865ZJKFC/ref=sr_1_2?dchild=1&qid=1588707252&sr=8-2"
Shorten URL: https://www.amazon.co.jp/dp/B0865ZJKFC
Result has been copied to your clipboard, you can use cmd + v to paste it.
"Agen (阿根)" is the name of a character in an animation The Legend of Luo Xiaohei. His life is very mysterious and has the ability to do many kind of things. I assume that he can use online shopping too :)
Also, Agen looks like a mis-spell of "Agent", which looks cool to me.