Closed Fastidious closed 2 years ago
Hello.
Yes, you could actually create a shell alias for the following command:
bash -c 'curl -Ls https://pasty.lus.pm/api/v2/pastes -d "{\"content\": \"$(echo $(</dev/stdin))\"}" | echo "https://pasty.lus.pm/$(echo $(</dev/stdin) | jq .id -r)"
If you called your alias paste
, you can pipe in any data and receive a paste url like this:
❯ echo "Hello, world" | paste
https://pasty.lus.pm/WX4A5F
Please note that you have to install curl
and jq
for that.
This worked lovely too, thank you very much! This is a good tidbit for a wiki page.
Is there a way to create a paste from CLI? If so, could I have an example on how to do it? Thanks!