File size: 2,156 Bytes
7b6b075
ef80460
 
 
 
7b6b075
 
ef80460
7b6b075
 
ef80460
 
085912f
ef80460
 
 
 
085912f
ef80460
 
 
 
085912f
ef80460
085912f
 
 
 
 
 
 
 
 
 
 
 
 
 
 
ef80460
 
 
085912f
 
 
 
 
 
 
 
 
 
 
 
 
ef80460
 
 
085912f
ef80460
085912f
ef80460
 
 
 
 
 
 
 
085912f
 
ef80460
 
 
085912f
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
---
title: VS Code on Web
emoji: πŸ’»
colorFrom: blue
colorTo: purple
sdk: docker
pinned: false
app_port: 7860
---

# VS Code on Web - Hugging Face Spaces

This Space deploys VS Code in your browser using code-server with persistent storage via Hugging Face Datasets.

## Features

- 🌐 VS Code running in your browser
- πŸ’Ύ Persistent storage using Hugging Face Datasets
- 🐍 Pre-installed Python 3 and pip
- πŸ“¦ Node.js and npm included
- πŸ› οΈ Build tools and common utilities
- πŸ”’ Password-protected access
- πŸ€– AI coding assistant (Continue) with Gemini support

## Setup

### 1. Create a Hugging Face Dataset

Create a new private dataset on Hugging Face to store your VS Code data:
https://huggingface.co/new-dataset

### 2. Configure Environment Variables

In your Space settings, add these secrets:

- `HF_TOKEN`: Your Hugging Face access token (with write permissions)
- `HF_DATASET`: Your dataset name (e.g., `username/vscode-data`)

### 3. Access Your VS Code

Once deployed, access your VS Code instance through this Space. The default password is `huggingface`.

## How Persistence Works

The startup script automatically:
- Downloads your saved workspace, settings, and extensions from the HF dataset on startup
- Auto-saves every 5 minutes while running
- Saves all data when the Space shuts down

**Persisted data includes:**
- VS Code settings and configuration
- Installed extensions
- Workspace files and folders
- Extension settings (including API keys)

## Configuration

- **Port**: 7860
- **Default Password**: `huggingface` (change in Dockerfile)
- **Workspace Directory**: `/home/coder/workspace`
- **Auto-save interval**: Every 5 minutes

## Installed Tools

- Git
- Python 3 with pip
- Node.js with npm
- Build essentials (gcc, g++, make)
- Text editors (vim, nano)
- Hugging Face CLI
- Continue extension (supports Gemini, GPT-4, Claude, etc.)

## Notes

- Without `HF_TOKEN` and `HF_DATASET` set, the Space runs without persistence
- The first startup takes longer as it sets up the environment
- Large workspaces may take time to sync
- Your data is stored in your private HF dataset and not accessible to others