Skip to content

Simple tool that copies to clipboard the content of files given as CLI arguments, with a comment before each file.

Notifications You must be signed in to change notification settings

LeanerCloud/f2c

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

File-to-Clipboard Tool (f2c)

This tool helps you copy the contents of multiple files to the clipboard, with each file's content prefixed by a comment indicating the file name.

It's useful for pasting entire projects into large language models (LLMs) for analysis.

Features

  • Reads contents of multiple files given as command-line arguments.
  • Prefixes each file's content with a comment showing the file name.
  • Copies the combined content to the clipboard.
  • walks directories recursively and gathers all their files.
  • Ignores non-text files.
  • Can exclude files matching a list of paths, given as comma-separated list.

Requirements

  • Go 1.15 or higher

Installation

  1. Ensure you have Go installed from golang.org.

  2. Install the software

go install github.com:LeanerCloud/f2c@latest

Usage

Assuming the GOPATH/bin is in your PATH, you can run the program with the files you want to copy as arguments:

f2c *.txt

or

f2c --exclude .git . # -e works as well to save you some typing

The combined content will be copied to your clipboard, ready to paste.

Example

Given these files:

file1.txt:

Hello, this is file1.

file2.txt:

Hello, this is file2.

Results in the clipboard containing:

// file1.txt
Hello, this is file1.

// file2.txt
Hello, this is file2.

License

This project is licensed under the MIT License.

About

Simple tool that copies to clipboard the content of files given as CLI arguments, with a comment before each file.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages