Yet another CLI for hastebin, this one written in Go. It is intended to be used similarly to the original
haste client, but also be able to get/read hastes.
As an added bonus, there's also cross-platform support without dependencies on other tools.
It also supports client certificates for mTLS for some reason.
Navigate to the latest release and download the client for your OS and architecture.
Without any arguments, haste
reads from the STDIN:
cat file | haste
Provided with a file argument, haste
will create a haste from the contents of that file and return the URL pointing to it:
url=$(haste file) # equivalent to cat file | haste
echo $url # e.g. https://hastebin.com/ogoquyocaq
haste
can read a haste using the get
command:
haste get <key> # prints the haste contents to STDOUT
haste get <key> -o ./file # prints the haste contents to ./file
For more detailed information on how haste
can be used, use haste --help
or look here:
haste v1.0.0
A hastebin client that can create hastes from files and STDIN and read hastes from a haste-server instance.
Usage:
haste [file] [flags]
haste [command]
Examples:
echo Test | haste
cat ./file | haste
haste ./file
Available Commands:
get Get a haste from the server
help Help about any command
Flags:
--client-cert string Client certificate path
--client-cert-key string Client certificate key path
-c, --config string Config file [$HOME/.haste-client-go.yaml]
-h, --help help for haste
-s, --server string Server URL (default "https://hastebin.com")
-v, --version Print the version number
Use "haste [command] --help" for more information about a command.
The global flags can also be configured by creating $HOME/.haste-client-go.yaml
or referencing a configuration file using the -c/--config
flag.
server: <url>
clientCert: <file location> # expects a certificate file in PEM format
clientCertKey: <file location> # expects a certificate key file in PEM format
Requires golang 1.15+
.
If there is no release for your OS and architecture or if you want to build the binary yourself for other reasons, you can follow these steps:
git clone git@github.com:jagoe/haste-client-go.git # clone this repo
cd haste-client-go
[GOARCH=<your architecture>] [GOOS=<your OS>] make build # build client
sudo mv ./bin/haste /usr/local/bin/haste # move to a bin directory in your PATH
Jakob Göbel (goebel.jakob@gmail.com)