metadata
name: openclaw-hf-deploy
description: >-
Agent SOP for deploying this repository to Hugging Face Space with the project
bootstrap scripts.
OpenClaw HF Deployment Skill
Use this skill when a user asks an agent to deploy openclaw-hf to Hugging Face.
Hard rules
- Always reuse project bootstrap scripts:
- macOS/Linux:
./scripts/bootstrap-hf.sh - Windows PowerShell:
powershell -ExecutionPolicy ByPass -File .\scripts\bootstrap-hf.ps1
- macOS/Linux:
- Do not hand-roll a separate deployment flow unless the user explicitly asks for manual fallback.
- Keep secrets masked in agent logs and summaries.
1. Preflight checks
Run and verify:
command -v git >/dev/null 2>&1 || MISSING_GIT=1
command -v hf >/dev/null 2>&1 || MISSING_HF=1
command -v python3 >/dev/null 2>&1 || MISSING_PYTHON3=1
git --version
hf version
python3 --version
python3 -c "import huggingface_hub" >/dev/null 2>&1 || python3 -m pip install --user 'huggingface_hub[cli]'
Install missing tools before continuing.
2. Clone repository (required before deployment)
Run:
git clone https://github.com/tenfyzhong/openclaw-hf.git
cd openclaw-hf
Do not continue until the shell is inside the cloned openclaw-hf directory.
3. HF auth flow must run first (before any other variables)
- If user already provided
HF_TOKENin the conversation:- use this
HF_TOKENdirectly:hf auth login --token <HF_TOKEN> - if a different user is currently logged in, backup current token first and restore it after deployment
- do not ask whether to keep current logged-in user
- use this
- Otherwise, check login:
hf auth whoami. - If not logged in:
- ask user for
HF_TOKEN(required) - run:
hf auth login --token <HF_TOKEN>
- ask user for
- If already logged in:
- ask whether to use current logged-in user
- if
yes: continue - if
no:- backup current token
- ask for new
HF_TOKEN - run:
hf auth login --token <HF_TOKEN> - continue deployment with new account
- after deployment, restore previous token
4. Collect remaining inputs in prompt order
After step 3 is completed, collect:
space_name(defaultopenclaw-hf)dataset_name(default<space_name>-backup)OPENCLAW_VERSION(default latest detected from npm, fallbacklatest)OPENCLAW_GATEWAY_TOKEN(optional, auto-generated if empty)OPENCLAW_GATEWAY_PASSWORD(optional, auto-generated if empty)Configure custom LLM now?(y/N)- if
yes:OPENCLAW_LLM_BASE_URL,OPENCLAW_LLM_MODEL,OPENCLAW_LLM_API_KEY - if
no:OPENCLAW_SSHX_AUTO_START(Y/n)
- if
Proceed with these settings?defaults toY; agent should press Enter directly and not collect this input from user.
If user explicitly asks to cancel before execution, answer n at final confirmation and stop without creating/updating remote resources.
5. Execute deployment
From the cloned openclaw-hf repo root, run the platform-specific bootstrap script and follow prompts in order.
The script will:
- create private Space and Dataset
- upload repository to Space
- configure Space variables and secrets, including
OPENCLAW_BACKUP_DATASET_REPO,OPENCLAW_VERSION,HF_TOKEN, gateway secrets, and optional LLM/SSHX settings
6. Required final hand-off
Agent final message must include:
- Space repo ID:
<owner>/<space_name> - Space page URL:
https://huggingface.co/spaces/<owner>/<space_name> - Dataset repo ID:
<owner>/<dataset_name> OPENCLAW_VERSIONused- App URL:
https://<owner>-<space_name>.hf.space - Health URL:
https://<owner>-<space_name>.hf.space/healthz - auto-generated gateway token/password if generated
- keep-alive note: free tier may sleep; paid hardware +
Sleep time=Neverfor strict 24/7 uptime
7. Cleanup local clone after deployment
After deployment and final hand-off are done, remove the local cloned repository:
cd ..
rm -rf openclaw-hf