This repo is fork from code-connect ~~Thanks for this cool repo.
rcode_demo.mp4
- PyPI
- support local open remote dir command
rcode ${ssh_name} ${ssh_dir}
- support cursor to open remote dir command
rcursor ${ssh_name} ${ssh_dir}
- you can also open dir from remote to local
cursor
justcursor ${dir_name}
- pip3 install rcode (or clone it pip3 install .)
install socat like: (sudo yum install socat)- just
rcode file
like your VSCodecode .
- or use cursor just
cursor .
- local open remote use rcode if you use
.ssh/config
-->rcode remote_ssh ~/test
- local open latest remote
.ssh/config
-->rcode -l or rcode --latest
- add shortcut_name
rcode s ~/abc -sn abc
then you can usercode -os abc
to open this dir quickly - support cursor to open remote dir command
rcursor ${ssh_name} ${ssh_dir}
- Connect to your SSH server with
rssh
, and you can runrcode/rcursor
on the server to launch VS Code/Cursor, even if they are not running.
Note:
- If using traditional SSH connection, be sure to connect to the remote host first before typing any
rcode
in the terminal- We may want to add
~/.local/bin
in to your$PATH
in your~/.zshrc
or~/.bashrc
to enablercode
being resolved properly- export PATH=$PATH:/usr/local/go/bin + export PATH=$PATH:/usr/local/go/bin:~/.local/bin
RSSH enables seamless remote development by allowing you to launch VS Code/Cursor on your local machine while working with files on a remote server. It works by:
- Creating a secure SSH tunnel between your local machine and remote server
- Setting up IPC (Inter-Process Communication) sockets for command transmission
- Managing remote sessions with unique identifiers and keys
rssh_h264.mov
- Connect to remote server using
rssh
:
RSSH is designed to be fully compatible with SSH parameters, with the exception of the -R and -T options, which are not allowed when using RSSH.
rssh your-remote-server
All standard SSH parameters can be used with rssh, except -R and -T.
- On the remote server, you can now use:
rcode . # Launch VS Code
rcursor . # Launch Cursor
If you'd like to use rssh as a drop-in replacement for ssh, you can utilize the provided ssh-wrapper. By adding an alias in your shell configuration file (e.g., ~/.bashrc or ~/.zshrc), you can override the ssh command:
alias ssh="ssh-wrapper"
With this alias in place, when you use ssh, it will invoke ssh-wrapper. To activate rssh, include the --rssh parameter:
ssh --rssh your-remote-server
If you do not include the --rssh parameter, it will behave as the default ssh command.
-
When you connect with
rssh
:- Generates a unique session ID and key
- Creates an SSH tunnel for IPC communication
- Sets up environment variables on the remote server
-
When running
rcode
/rcursor
on the remote:- Communicates with the local IDE through the IPC socket
- Automatically launches the appropriate IDE on your local machine
- Opens the remote directory in your IDE
- Custom IPC host:
rssh --host <host> your-remote-server
- Custom IPC port:
rssh --port <port> your-remote-server