Coder Social home page Coder Social logo

theden / gcopy Goto Github PK

View Code? Open in Web Editor NEW
13.0 2.0 1.0 3.62 MB

Copy data to your clipboard via the command line (including images, archive files, videos etc.) ๐Ÿ“‹

License: GNU General Public License v2.0

Makefile 17.86% Go 81.11% Shell 1.04%
clipboard command-line pbcopy macos terminal

gcopy's Introduction

gcopy

copy Logo

Go Version Go Doc Prettier GitHub Release CI status License

gcopy (global copy) is a command line tool that copies data to your clipboard on MacOS.

It does what pbcopy does but with some extra features:

  • Works with images, so copied images can be pasted in other applications
  • Accepts arbitrary STDIN via a pipe
  • If a filename is passed as an argument it'll copy the data as though you hit CMD+C via Finder, allowing pasting of files (PDFs, archive files, videos etc.) to other programs
  • Has an optional flag to copy the absolute pathname of a file or folder to the clipboard
  • Written in Go, deployed as a multi-arch static binary
  • Works as a drop-in replacement for pbcopy since it extends its features

gcopy

Install

Via go install

go install github.com/TheDen/gcopy@latest

Brew

To install via brew

brew tap theden/gcopy
brew install gcopy

Aliasing

gcopy can be used as a drop-in replacement for pbcopy. To do this, add the alias into your .bashrc or similar

alias pbcopy='gcopy'

Usage

Overview

usage: gcopy [file] [STDIN] [-h|--help] [-v|--version] [-p|--path]

                            gcopy: copy content to the clipboard

Arguments:

  -h  --help     Print help information
  -v  --version  Current version
  -p  --path     Copy (and show) the absolute pathname of a file or folder to
                 the clipboard

Copying to clipboard via STDIN

Works with text or arbitrary data

cat main.go | gcopy
# or
gcopy < main.go

Images can also be copied via pipes, and then pasted as images to GUI applications

cat image.png | gcopy
# or
gcopy < image.png

Passing in files to copy to the clipboard

gcopy main.go

Similarly for images

gcopy image.png

Or any other type of file

gcopy backups.zip

Copying via this method will allow you to paste non-text data in other applications

Getting the absolute path of a file or folder

gcopy -p .bashrc
/Users/den/.bashrc

gcopy's People

Contributors

theden avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

Forkers

blackfrog1

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.