Skip to content

Commit 69eeaa1

Browse files
authored
docs(spaces-dev-mode): surface SSH command, lead with SSH over VS Code (#2488)
* docs(spaces-dev-mode): surface SSH command, lead with SSH over VS Code SSH is the underlying connection mechanism — VS Code rides on top of it — but the page currently mentions VS Code first and tells readers to find the SSH instructions in the UI modal. Reframe the intro accordingly and show the actual `ssh <subdomain>@ssh.hf.space` command plus a snippet to fetch the subdomain via `HfApi.space_info()`, so anyone reading the docs (humans or agents) can connect without going through the UI. * docs(spaces-dev-mode): drop Beta-stage warning * docs(spaces-dev-mode): clarify SSH vs VS Code web servers
1 parent 6f8054b commit 69eeaa1

1 file changed

Lines changed: 20 additions & 8 deletions

File tree

docs/hub/spaces-dev-mode.md

Lines changed: 20 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
# Spaces Dev Mode: Seamless development in Spaces
22

3-
> [!WARNING]
4-
> This feature is still in Beta stage.
5-
63
> [!WARNING]
74
> The Spaces Dev Mode is part of <a href="https://huggingface.co/pro">PRO</a> or <a href="https://huggingface.co/enterprise">Team & Enterprise</a> plans.
85
@@ -14,7 +11,7 @@ Whenever your commit some changes to your Space repo, the underlying Docker imag
1411

1512
The Dev Mode allows you to update your Space much quicker by overriding the Docker image.
1613

17-
The Dev Mode Docker image starts your application as a sub-process, allowing you to restart it without stopping the Space container itself. It also starts a VS Code server and a SSH server in the background for you to connect to the Space.
14+
The Dev Mode Docker image starts your application as a sub-process, allowing you to restart it without stopping the Space container itself. It also starts an SSH server (for local editors and terminals) and a VS Code server (for the in-product VS Code Web) in the background, so you can connect to the Space.
1815

1916
The ability to connect to the running Space unlocks several use cases:
2017

@@ -39,16 +36,31 @@ The application does not restart automatically when you change the code. For you
3936
You will need to manually run `pip install` from VS Code or SSH.
4037
</div>
4138

42-
### SSH connection and VS Code
39+
### Connecting
40+
41+
Dev Mode exposes the running Space as a standard SSH host. VS Code and any other editor connect through that same SSH endpoint.
42+
43+
#### SSH
44+
45+
Once Dev Mode is running, connect with:
4346

44-
The Dev Mode allows you to connect to your Space's docker container using SSH.
47+
```shell
48+
ssh <space-subdomain>@ssh.hf.space
49+
```
4550

46-
Instructions to connect are listed in the Dev Mode controls modal.
51+
The subdomain is shown in the Dev Mode controls modal. You can also retrieve it programmatically:
52+
53+
```python
54+
from huggingface_hub import HfApi
55+
print(HfApi().space_info("namespace/repo").subdomain)
56+
```
4757

4858
You will need to add your machine's SSH public key to [your user account](https://huggingface.co/settings/keys) to be able to connect to the Space using SSH.
4959
Check out the [Git over SSH](./security-git-ssh#add-a-ssh-key-to-your-account) documentation for more detailed instructions.
5060

51-
You can also use a local install of VS Code to connect to the Space container. To do so, you will need to install the [SSH Remote](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) extension.
61+
#### VS Code
62+
63+
You can also use a local install of VS Code to connect to the Space container. To do so, install the [Remote - SSH](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-ssh) extension and connect to the same `<space-subdomain>@ssh.hf.space` host.
5264

5365
### Persisting changes
5466

0 commit comments

Comments
 (0)