Skip to content

supitsdu/clipper

Repository files navigation

Clipper - Ready to Paste

Clipper is a lightweight command-line tool written in Go for copying contents to the clipboard. Quickly and easily copy the contents of any file, command output, or even directly pass text to your clipboard inside your favorite terminal, streamlining your workflow and saving you time.

Features

  • Cross-Platform Compatibility: Clipper works seamlessly on Linux, macOS, and Windows, providing consistent clipboard functionality across different operating systems.
  • Simple Usage: With a straightforward command-line interface, Clipper makes it easy to copy file contents to the clipboard with just a single command.
  • Fast and Efficient: Clipper is designed for performance and efficiency, allowing you to copy contents to the clipboard quickly and without unnecessary overhead.
  • Convenient: Directly copy text, command output, or file contents to the clipboard consistently across all supported platforms.
  • Structured Multi-File Copying: Expand directories and globs, prepend an ASCII tree, and copy labeled file sections that are easier to paste into tickets, chats, or docs.

Installation

Using the Install Script

You can install Clipper using the following command:

curl -sSL https://raw.githubusercontent.com/supitsdu/clipper/main/install.sh | sh

Or:

wget -qO- https://raw.githubusercontent.com/supitsdu/clipper/main/install.sh | sh

Note

If you prefer not to use curl ... | sh, you can manually download and install Clipper as described below.

Manual Installation

To use Clipper, download the appropriate binary for your operating system from the releases page and place it in your desired location.

Important

Add the location of the binary to your system's PATH environment variable to access Clipper from anywhere on your system.

Usage

Long-running operations show a spinner on interactive terminals by default. Use --no-progress to disable it explicitly.

Important

Legacy aliases like -Html, -Markdown, -Mime, and -LineNumbers still work, but the primary interface now uses long flags such as --html, --markdown, --mime, and --line-numbers.

Copy the contents of a file to the clipboard:

clipper README.md

Copy the output of any command:

printf "hello from stdin" | clipper

Directly copy text:

clipper --content "My awesome content!"

Mimetype & Codeblock

Code Snippet Preview

clipper --mime --markdown cli/main.go

Copy an entire source tree with a readable structure summary:

clipper --recursive --tree cli

Expand glob patterns and exclude files you do not want:

clipper "tests/**/*.go" --exclude "**/*_test.go"

Filter by extension and size when copying a directory:

clipper --recursive --extension go,md --max-size 256KB .

Disable progress feedback in scripts or other quiet contexts:

clipper --recursive --min-size 10B --no-progress cli

Contributing

Contributions to Clipper are welcome! Here are a few ways you can contribute:

  • Report Bugs: If you encounter any bugs or unexpected behavior while using Clipper, please open an issue on GitHub to report it.
  • Request Features: Have an idea for a new feature or improvement? Open an issue to share your suggestion and start a discussion.
  • Submit Pull Requests: If you're comfortable with Go programming, you can contribute directly to the development of Clipper by submitting pull requests. Fork the repository, make changes, and submit a pull request for review.

See CONTRIBUTING.md for the local development workflow, go run usage, validation commands, and changelog/release steps.

Building from Source

To build Clipper from source, install the project toolchain with mise.

Requirements

  • mise: Clipper uses mise.toml to pin Go and development tooling.

Once mise is installed, clone the repository and run the following commands in the project directory:

mise install
mise run build:all

This will build Clipper for Windows, Linux, and macOS inside the bin directory.

Common Tasks

mise run fmt
mise run lint
mise run test
mise run build
mise run build:all
mise run checksums
mise run install:local
mise run test:docs
mise run changelog
mise run changelog:latest
RANGE=v1.5.0..v1.6.0 mise run changelog:range
TAG=v1.6.0 mise run release:notes

Pushing a version tag such as v1.7.0 now also creates or updates the matching GitHub Release, uploads the cross-platform binaries plus a checksum manifest, appends the generated notes and checksums to the release body automatically, and refreshes CHANGELOG.md on the default branch.

License

Clipper is licensed under the MIT License. Feel free to use, modify, and distribute it for any purpose.

About

Seamlessly copy file contents to clipboard from command line. Lightweight, cross-platform tool for instant text transfers.

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors