HORUSdocs
Docs menu
horus CLI

SSH and VS Code

Plain `ssh phone` and VS Code Remote-SSH.

horus ssh is all you need day to day. But many tools only know plain ssh: VS Code, JetBrains Gateway, git remotes, scripts. One command sets things up so ssh pixel just works everywhere.

Set up plain ssh

  1. Pair first

    horus config writes an entry for each paired phone. If you haven't paired yet, see Pair a phone.

  2. Write the config

    your computer
    horus config --install
    
    you'll see something like
    Wrote /Users/you/.horus/ssh_config with 1 phone(s).
    Added it to the top of ~/.ssh/config.
    Then: ssh pixel  (also works in VS Code Remote-SSH)

    Without --install, horus prints the Include line for you to add to ~/.ssh/config yourself.

  3. Connect

    your computer
    ssh pixel
    

Each phone's entry connects through horus proxy, which sets up the USB connection each time. So ssh pixel works as soon as the phone is plugged in, with nothing else running. The phone's identity is checked against the one saved when you paired.

VS Code

VS Code's Remote - SSH extension lets you edit files on the phone as if they were on your computer. You get the file tree, search, the built-in terminal, and extensions.

  1. Install the extension

    In VS Code, open Extensions, search for Remote - SSH (by Microsoft) and install it.

  2. Connect to the phone

    Open the command palette (⌘⇧P on a Mac, Ctrl+Shift+P on Linux), run Remote-SSH: Connect to Host… and pick pixel. The list comes from the config you just wrote.

    The first time, VS Code copies its server onto the phone. That takes a minute and needs internet on the phone.

  3. Open a project

    Choose File → Open Folder… and enter /workspace/projects/your-app. VS Code's terminal now runs on the phone too.

Other tools

Anything that speaks SSH can use the host name, including your computer's own copy tools:

your computer
scp notes.md pixel:/workspace/projects/app/
rsync -a ./app/ pixel:/workspace/projects/app/