glsnip
This is a simple CLI tool inspired by the usability of pbcopy and pbpaste or xclip but designed to work across machines.
Installation
If you have Go installed go get github.com/bradwood/glsnip
.
Alternatively, you can download a binary from the Releases
page
Configuration
You can configure glsnip
via a configuration file or via environment
variables. Environment variables will always override configuration file
settings.
Configuration file
Create a yaml-formatted file in your $HOME directory called .glsnip
as
follows:
gitlab_url: https://gitlab.com
token: xxxx
clipboard_name: glsnip
You may also specify an alternative location for the configuration file with the
--config
flag.
Environment variables
You can set environment variables as follows:
export GLSNIP_GITLAB_URL=https://gitlab.com
export GLSNIP_TOKEN=xxxx
Usage
Copying examples:
glsnip copy <some_file.txt
ls | glsnip copy
ls | GLSNIP_GITLAB_URL=https://blah.com GLSNIP_TOKEN=xxx glsnip copy
Pasting examples:
glsnip paste # paste to STDOUT
glsnip paste > myfile.txt
glsnip paste | less