burtenshaw commited on
Commit
bbb9941
·
1 Parent(s): 66b268b

update skill and index for persistence

Browse files
.claude/skills/hf-space-sandbox/SKILL.md CHANGED
@@ -27,12 +27,38 @@ uv run scripts/sandbox.py status user/sandbox
27
  ssh USERNAME-SPACENAME@ssh.hf.space
28
  ```
29
 
30
- For example, for space `burtenshaw/sandbox`, use:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
31
  ```bash
32
- ssh burtenshaw-sandbox@ssh.hf.space
 
33
  ```
34
 
35
- Add your SSH key at https://huggingface.co/settings/keys first.
36
 
37
  ## Run uv Scripts
38
 
 
27
  ssh USERNAME-SPACENAME@ssh.hf.space
28
  ```
29
 
30
+ For space `burtenshaw/sandbox`, the host is `burtenshaw-sandbox@ssh.hf.space`.
31
+
32
+ ## Persistent State
33
+
34
+ Use files in `/app` for state that survives across commands:
35
+
36
+ **Set a variable:**
37
+ ```bash
38
+ ssh USERNAME-SPACENAME@ssh.hf.space "echo 42 > /app/foo"
39
+ ```
40
+
41
+ **Read it back:**
42
+ ```bash
43
+ ssh USERNAME-SPACENAME@ssh.hf.space "cat /app/foo"
44
+ ```
45
+
46
+ **Run a background job:**
47
+ ```bash
48
+ ssh USERNAME-SPACENAME@ssh.hf.space "nohup python train.py > /app/train.log 2>&1 &"
49
+ ```
50
+
51
+ **Check progress:**
52
+ ```bash
53
+ ssh USERNAME-SPACENAME@ssh.hf.space "tail /app/train.log"
54
+ ```
55
+
56
+ **Environment variables (source a file):**
57
  ```bash
58
+ ssh USERNAME-SPACENAME@ssh.hf.space "echo 'export FOO=42' >> /app/.env"
59
+ ssh USERNAME-SPACENAME@ssh.hf.space "source /app/.env && echo \$FOO"
60
  ```
61
 
 
62
 
63
  ## Run uv Scripts
64
 
index.html CHANGED
@@ -61,15 +61,18 @@
61
  <h2>create sandbox</h2>
62
  <div class="prompt">create a sandbox called my-sandbox on hugging face</div>
63
 
64
- <h2>set a variable</h2>
65
- <div class="prompt">set FOO=bar in the sandbox</div>
66
 
67
- <h2>echo variable</h2>
68
- <div class="prompt">echo the value of FOO from the sandbox</div>
69
 
70
  <h2>run uv script</h2>
71
  <div class="prompt">run a python script that prints "hello" using requests</div>
72
 
 
 
 
73
  </div>
74
  </body>
75
  </html>
 
61
  <h2>create sandbox</h2>
62
  <div class="prompt">create a sandbox called my-sandbox on hugging face</div>
63
 
64
+ <h2>store a value</h2>
65
+ <div class="prompt">save 42 to a file called foo in the sandbox</div>
66
 
67
+ <h2>read it back</h2>
68
+ <div class="prompt">read the value of foo from the sandbox</div>
69
 
70
  <h2>run uv script</h2>
71
  <div class="prompt">run a python script that prints "hello" using requests</div>
72
 
73
+ <h2>background job</h2>
74
+ <div class="prompt">run train.py in the background and save output to a log file</div>
75
+
76
  </div>
77
  </body>
78
  </html>