{"id":13672483,"url":"https://github.com/yihong0618/rcode","last_synced_at":"2025-04-27T22:32:17.341Z","repository":{"id":37763921,"uuid":"488473297","full_name":"yihong0618/rcode","owner":"yihong0618","description":"Open a file in your locally running  VSCode or Cursor instance from arbitrary terminal connections.","archived":false,"fork":true,"pushed_at":"2025-03-01T09:19:23.000Z","size":118,"stargazers_count":197,"open_issues_count":0,"forks_count":16,"subscribers_count":3,"default_branch":"dev","last_synced_at":"2025-04-26T22:42:24.062Z","etag":null,"topics":["cursor","vs"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"chvolkmann/code-connect","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/yihong0618.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2022-05-04T06:15:07.000Z","updated_at":"2025-03-29T06:38:07.000Z","dependencies_parsed_at":"2023-07-17T07:03:03.216Z","dependency_job_id":null,"html_url":"https://github.com/yihong0618/rcode","commit_stats":null,"previous_names":["yihong0618/code-connect"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihong0618%2Frcode","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihong0618%2Frcode/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihong0618%2Frcode/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/yihong0618%2Frcode/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/yihong0618","download_url":"https://codeload.github.com/yihong0618/rcode/tar.gz/refs/heads/dev","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":251219601,"owners_count":21554444,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cursor","vs"],"created_at":"2024-08-02T09:01:36.913Z","updated_at":"2025-04-27T22:32:17.334Z","avatar_url":"https://github.com/yihong0618.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"## Rcode\n\nThis repo is fork from [code-connect](https://github.com/chvolkmann/code-connect)\n~~Thanks for this cool repo.\n\nhttps://user-images.githubusercontent.com/1651790/172983742-b27a3fe0-2704-4fc8-b075-a6544783443a.mp4\n\n\n## What changed\n\n1. PyPI\n2. support local open remote dir command `rcode ${ssh_name} ${ssh_dir}`\n3. support cursor to open remote dir command `rcursor ${ssh_name} ${ssh_dir}`\n4. you can also open dir from remote to local `cursor` just `cursor ${dir_name}`\n\n## INFO\n\n1. pip3 install rcode (or clone it pip3 install .)\n2. ~~install socat like: (sudo yum install socat)~~\n3. just `rcode file` like your VSCode `code .`\n4. or use cursor just `cursor .`\n5. local open remote use rcode if you use `.ssh/config` --\u003e `rcode remote_ssh ~/test`\n6. local open latest remote `.ssh/config` --\u003e `rcode -l or rcode --latest`\n7. add shortcut_name `rcode s ~/abc -sn abc` then you can use `rcode -os abc` to open this dir quickly\n8. support cursor to open remote dir command `rcursor ${ssh_name} ${ssh_dir}`\n9. Connect to your SSH server with `rssh`, and you can run `rcode/rcursor` on the server to launch VS Code/Cursor, even if they are not running.\n\n\u003e Note:\n\u003e - If using traditional SSH connection, be sure to [connect to the remote host](https://code.visualstudio.com/docs/remote/ssh#_connect-to-a-remote-host) first before typing any `rcode` in the terminal\n\u003e - We may want to add `~/.local/bin` in to your `$PATH` in your `~/.zshrc` or `~/.bashrc` to enable `rcode` being resolved properly\n\u003e ```diff\n\u003e - export PATH=$PATH:/usr/local/go/bin\n\u003e + export PATH=$PATH:/usr/local/go/bin:~/.local/bin\n\u003e ```\n\n## Remote Development with RSSH\n\nRSSH 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:\n\n1. Creating a secure SSH tunnel between your local machine and remote server\n2. Setting up IPC (Inter-Process Communication) sockets for command transmission\n3. Managing remote sessions with unique identifiers and keys\n\nhttps://github.com/user-attachments/assets/41a44915-4714-4fce-8705-a1550921b2f3\n\n### Usage\n\n1. Connect to remote server using `rssh`:\n\nRSSH 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.\n\n```bash\nrssh your-remote-server\n```\n\nAll standard SSH parameters can be used with rssh, except -R and -T.\n\n2. On the remote server, you can now use:\n```bash\nrcode .      # Launch VS Code\nrcursor .    # Launch Cursor\n```\n\n### Using `ssh-wrapper`\n\nIf 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:\n\n```shell\nalias ssh=\"ssh-wrapper\"\n```\n\nWith this alias in place, when you use ssh, it will invoke ssh-wrapper. To activate rssh, include the --rssh parameter:\n\n```shell\nssh --rssh your-remote-server\n```\n\nIf you do not include the --rssh parameter, it will behave as the default ssh command.\n\n### How It Works\n\n1. When you connect with `rssh`:\n   - Generates a unique session ID and key\n   - Creates an SSH tunnel for IPC communication\n   - Sets up environment variables on the remote server\n\n2. When running `rcode`/`rcursor` on the remote:\n   - Communicates with the local IDE through the IPC socket\n   - Automatically launches the appropriate IDE on your local machine\n   - Opens the remote directory in your IDE\n\n### Advanced Options\n\n- Custom IPC host: `rssh --host \u003chost\u003e your-remote-server`\n- Custom IPC port: `rssh --port \u003cport\u003e your-remote-server`\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyihong0618%2Frcode","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fyihong0618%2Frcode","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fyihong0618%2Frcode/lists"}