Skip to content

ed-terry/take-put

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

1 Commit
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Take-Put CLI πŸ“‹

A powerful cross-platform CLI tool that acts as a system-wide file/folder clipboard manager. Take files or folders from anywhere, roam around your filesystem, and put them wherever you needβ€”all from the command line.

Author: Edward Terry
Email: sir_edward@icloud.com
GitHub: @ed-terry
Portfolio: ed-terry.github.io


πŸš€ Features

  • Take Command - Capture files or folders for later use
  • Put Command - Paste captured items into any directory
  • Copy Mode - Copy files without removing originals (use -c flag)
  • Move Mode - Move files (cut and paste behavior) - default
  • Clear Command - Purge the clipboard and temp storage
  • Status Command - View what's currently in your clipboard
  • Swap Command - Exchange positions of clipboard item with another file
  • Cross-Platform - Works seamlessly on Windows, macOS, and Linux
  • Verbose Mode - Get detailed output with -v flag
  • Overwrite Protection - Safe handling of existing files with --overwrite flag

βš™οΈ Installation

From Source

git clone https://github.com/ed-terry/take-put.git
cd take-put
npm install
npm run install-cli

From npm

npm install -g take-put

πŸ“– Usage

Basic Commands

Take a file (cut mode - default)

tp take /path/to/file.txt

Take a file (copy mode)

tp take /path/to/file.txt --copy
# or
tp take /path/to/file.txt -c

Put the file in current directory

tp put

Put the file in a specific directory

tp put /destination/path

Check what's in your clipboard

tp status

Clear the clipboard

tp clear

Swap with another file

tp swap /path/to/another/file.txt

🎯 Examples

Example 1: Moving a file across directories

# Navigate to source directory
cd ~/Documents

# Take the file (move mode - default)
tp take important.docx

# Navigate to destination
cd ~/Desktop

# Put the file
tp put

# Result: important.docx is now in ~/Desktop and removed from ~/Documents

Example 2: Copying files without removing originals

# Copy a file
tp take ~/Downloads/photo.jpg --copy

# Navigate elsewhere
cd ~/Pictures/Archive

# Paste the copy
tp put

# Result: photo.jpg is now in both locations

Example 3: Taking an entire folder

# Take a folder
tp take ~/old-project --copy

# Check what's in clipboard
tp status

# Navigate to backup location
cd ~/backups

# Put the folder
tp put

# Result: entire old-project folder is copied to ~/backups

Example 4: Swapping files between locations

# Take a file
tp take ~/config/old-config.json

# Swap with another file
tp swap ~/config/new-config.json

# Result: files are exchanged in their locations, new-config.json is now in clipboard

Example 5: Managing the clipboard

# Take a folder
tp take ~/large-folder --copy

# Check status with verbose output
tp status --verbose

# Later, clear when done
tp clear --verbose

πŸ’» Command Reference

tp take <path> [options]

Capture a file or folder to the clipboard.

Options:

  • -c, --copy - Copy the file instead of cutting (moving)
  • -m, --move - Move/cut the file (default behavior)
  • -v, --verbose - Show detailed output

Default Behavior: Cuts files (moves on put)

Examples:

tp take ./myfile.txt
tp take ./folder -c
tp take ~/document.pdf --copy --verbose

tp put [destination] [options]

Paste the taken file or folder.

Options:

  • -o, --overwrite - Overwrite existing files without prompting
  • -v, --verbose - Show detailed output

Default Behavior: Pastes to current directory if no destination specified

Examples:

tp put
tp put ~/Desktop
tp put ./backup --overwrite
tp put /destination --verbose

tp clear [options]

Clear the clipboard and remove temporary files.

Options:

  • -v, --verbose - Show detailed output

Examples:

tp clear
tp clear --verbose

tp status [options]

Display what's currently in the clipboard.

Options:

  • -v, --verbose - Show detailed output

Examples:

tp status
tp status --verbose

tp swap <path> [options]

Exchange the clipboard item with another file.

Options:

  • -v, --verbose - Show detailed output

Examples:

tp swap ~/Documents/config.json
tp swap ./backup.sql --verbose

πŸ”§ Advanced Usage

Verbose Mode

Get detailed information about operations:

tp take ~/large-project --verbose
tp put /destination --verbose
tp status --verbose

Handling Overwrite Scenarios

# This will fail if destination exists
tp put ~/Desktop

# This will overwrite silently
tp put ~/Desktop --overwrite

Working with Large Files

The tool efficiently handles files and folders of any size:

# Take a large video file
tp take ~/Videos/movie.mkv --copy

# Take an entire project directory
tp take ~/workspace/project-name

πŸ“ Clipboard Storage

Clipboard data is stored in:

  • Linux/macOS: ~/.take-put/
  • Windows: C:\Users\{username}\.take-put\

The state file maintains:

  • Current item path
  • Operation mode (copy or move)
  • Item metadata (size, type, timestamp)

🌐 Cross-Platform Support

The tool is fully compatible with:

  • βœ… Windows (10+)
  • βœ… macOS (10.12+)
  • βœ… Linux (All major distributions)

File operations are optimized for each platform:

  • Windows: Uses copy + delete for move operations
  • Unix-like systems: Uses native rename operations

πŸ“‹ System Requirements

  • Node.js: v14.0.0 or higher
  • npm: v6.0.0 or higher

Check your versions:

node --version
npm --version

πŸ› οΈ Development

Clone the repository

git clone https://github.com/ed-terry/take-put.git
cd take-put

Install dependencies

npm install

Run the CLI

npm start -- take ./test-file.txt

Test the program

npm test

πŸ“ License

MIT License - Feel free to use this tool for personal and commercial projects.


🀝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request or open an Issue for bugs and feature requests.


πŸ› Troubleshooting

Issue: "Command not found"

Solution: Make sure you've installed the CLI globally:

npm install -g .

Issue: "File not found" error

Solution: Use absolute paths or verify the file exists:

tp take "$(pwd)/myfile.txt"

Issue: "Permission denied"

Solution: Ensure you have read/write permissions for the file and destination:

# Check permissions
ls -la /path/to/file

# Make sure destination is writable
ls -ld /destination/path

Issue: Nothing in clipboard

Solution: Take a file first before putting:

tp take ~/myfile.txt
tp put ~/destination

πŸŽ“ Tips & Tricks

  1. Create an alias for quick access:

    alias tp='take-put'
  2. Use with current directory:

    tp take . --copy  # Copy entire current folder
  3. Combine with other CLI tools:

    tp take $(find . -name "*.log" | head -1)
  4. Check before moving:

    tp status --verbose
    tp put /destination
  5. Safe overwriting:

    # Always check first
    tp status
    tp put /destination --overwrite

πŸ“ž Contact & Support

For issues, feature requests, or suggestions, please open an issue on GitHub.


πŸ™ Acknowledgments

Built with ❀️ using Node.js and inspired by clipboard management workflows.

Made with:


Enjoy managing your files efficiently! πŸŽ‰

About

Roam the cli with ease, copy and paste like never before.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors