#clipboard #remote #ssh #sharing #session #client-server #cli

bin+lib clipat

CLI tool for sharing clipboard with remote SSH sessions

2 releases

0.1.1 Apr 19, 2024
0.1.0 Apr 18, 2024

#11 in #sharing

Download history 192/week @ 2024-04-13 53/week @ 2024-04-20

245 downloads per month

MIT license

17KB
411 lines

clipat - Remote clipboard server / client

Allows sharing clipboard with remote SSH sessions.

Similar to lemonade.

Installation

  1. Install Rust.
  2. Install clipat:
    cargo install clipat
    

Usage in shell

  1. Run server on local machine:

    clipat server
    
  2. Set up SSH session with remote machine:

    ssh -R 14573:127.0.0.1:14573 user@remote
    
  3. To copy text on a remote machine:

    cat copy.txt | clipat copy
    
  4. To paste text on a remote machine:

    clipat paste > paste.txt
    

Usage with neovim

This will replace your + and * registers with clipat.

vim.g.clipboard = {
  name = 'clipat',
  copy = {
    ['+'] = { 'clipat', 'copy' },
    ['*'] = { 'clipat', 'copy' },
  },
  paste = {
    ['+'] = { 'clipat', 'paste' },
    ['*'] = { 'clipat', 'paste' },
  },
  cache_enabled = false,
}

Security considerations

By default, clipat only listens on 127.0.0.1. If you want to listen on all interfaces, you can use the --listen option. This is not recommended, as it allows anyone on the network to access your clipboard.

It is also not recommended to use clipat on multi-user systems, as any user could potentially access your clipboard.

Communications between the client and server are not encrypted. However, if you pipe the connection through SSH, this will take care of encryption over internet.

License

clipat is licensed under the MIT license. Full license text is available in the LICENSE file.

Dependencies

~14–27MB
~265K SLoC