Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 20 additions & 8 deletions docs/hub/spaces-dev-mode.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
# Spaces Dev Mode: Seamless development in Spaces

> [!WARNING]
> This feature is still in Beta stage.

> [!WARNING]
> 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.
Comment thread
gary149 marked this conversation as resolved.

Expand All @@ -14,7 +11,7 @@ Whenever your commit some changes to your Space repo, the underlying Docker imag

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

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.
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.

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

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

### SSH connection and VS Code
### Connecting

Dev Mode exposes the running Space as a standard SSH host. VS Code and any other editor connect through that same SSH endpoint.

#### SSH

Once Dev Mode is running, connect with:

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

Instructions to connect are listed in the Dev Mode controls modal.
The subdomain is shown in the Dev Mode controls modal. You can also retrieve it programmatically:

```python
from huggingface_hub import HfApi
print(HfApi().space_info("namespace/repo").subdomain)
```

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.
Check out the [Git over SSH](./security-git-ssh#add-a-ssh-key-to-your-account) documentation for more detailed instructions.

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.
#### VS Code

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.

### Persisting changes

Expand Down
Loading