Giter VIP home page Giter VIP logo

remote-development-manager's Introduction

Remote Development Manager

An experimental Go application that allows an SSH session to interact with the clipboard of the host machine and forward calls to open. RDM works by listening on a unix socket locally that can be forwarded to an SSH session.

So far the server only works on macOS, but the client commands are not OS specific.

Installation

The easiest way to install rdm is to download the latest release for your platform. Alternatively, you can build it yourself with go build main.go.

e.g. for a Linux server you can use wget to download the binary then put it somewhere in your $PATH:

wget https://github.com/BlakeWilliams/remote-development-manager/releases/latest/download/rdm-linux-amd64
mv rdm-linux-amd64 /usr/local/bin/rdm
chmod +x /usr/local/bin/rdm

Usage

The following is an example of forwarding an rdm server to a remote host: ssh -R 127.0.0.1:7391:$(rdm socket) [email protected]. It's worth noting the port number is not currently configurable and will always attempt to connect to 7391.

For Codespaces, rdm can be forwarded as part of the gh cs ssh command as arguments to ssh, e.g.: gh cs ssh -- -R 127.0.0.1:7391:$(rdm socket)

Server commands:

  • rdm server - hosts a server locally (macOS only) so that your machine can receive copy, paste, and open commands.
  • rdm close - attempts to close a running server.
  • rdm logpath - returns the path where server logs are located. Useful for tail $(rdm logpath)
  • rdm socket - returns the path where the server socket lives. Useful for SSH commands, as seen above.

Client commands:

  • rdm copy - reads stdin and forwards the input to the host machine, adding it to the clipboard. e.g. echo "hello world" | rdm copy
  • rdm paste - reads and prints the host machine's clipboard. rdm paste
  • rdm open - forwards the first argument to open. e.g. rdm open https://github.com/blakewilliams/remote-development-manager

Integrations

Here's a few tools you can easily hook rdm into:

Tmux

If you're using macOS and are already delegating copy to pbcopy you can easily use rdm in an ssh session by creating an alias.

alias pbcopy="rdm copy"

Alternatively, you can define the commands explicitly for rdm:

bind-key -T copy-mode-vi Enter send -X copy-pipe-and-cancel "rdm copy"
bind-key -T copy-mode-vi 'y' send -X copy-pipe-and-cancel "rdm copy"

Neovim

Neovim supports custom clipboards out-of-the-box. You can use rdm with Neovim using the following code:

let g:clipboard = {"name": "rdm", "copy": {}, "paste": {}}
let g:clipboard.copy["+"] = ["rdm", "copy"]
let g:clipboard.paste["+"] = ["rdm", "paste"]
let g:clipboard.copy["*"] = ["rdm", "copy"]
let g:clipboard.paste["*"] = ["rdm", "paste"]

For open support, add the following to ~/.zshenv if you're using zsh:

alias open="rdm open"
alias xdg-open="rdm open"

GitHub CLI

GitHub CLI allows you to configure the browser used to open URL's. We can use this to set rdm as the browser target:

$ gh config set browser "rdm open"

TO-DO

So far this is just an experiment and there's a lot to be done to get it to a stable point. Contributions are very welcome.

  • Add test coverage
  • Daemonize the server process
  • Add a configuration file that allows custom commands
  • Add instructions for vim
  • Linux support, if anyone wants to add it

remote-development-manager's People

Contributors

blakewilliams avatar kenyonj avatar

Watchers

James Cloos avatar  avatar

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.