Clone an htmlhost Site into a Local Project
Starting from the browser, continuing in your editor
Not every project starts in a code editor. Maybe you built a quick landing page using the htmlhost web editor. Maybe you used the AI to generate a page and published it on the spot. Or maybe someone shared a deployed site with you and you want to work on it locally.
In all of these cases, the site exists on the server but you don't have the files on your machine. That's where htmlhost clone comes in.
How cloning works
Run the command with the site's slug (the part before .htmlhost.co in the URL):
htmlhost clone my-site
The CLI creates a new folder called my-site in your current directory, downloads the saved working files (a saved draft when present, otherwise the last published files), and writes them as local files. It also creates a .htmlhost link file so you can immediately start using htmlhost deploy and htmlhost pull.
The output shows each file as it's written:
ℹ Cloning my-site.htmlhost.co…
Version 3 · 4 pages · 2 assets
✓ index.html (3.2 KB)
✓ about.html (1.8 KB)
✓ contact.html (1.1 KB)
✓ blog.html (2.4 KB)
✓ styles.css (4.7 KB)
✓ logo.png (12.3 KB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
✓ Cloned 6 files into ./my-site
Linked → .htmlhost · my-site.htmlhost.co
Deploy changes: htmlhost deploy
Pull updates: htmlhost pull
Cloning into a specific directory
By default, the CLI creates a folder named after the slug. If you want a different folder name, pass it as a second argument:
htmlhost clone my-site ./portfolio
This clones the site into ./portfolio instead of ./my-site.
When the folder already exists
If the target directory exists and contains files, the CLI stops and suggests using htmlhost pull instead (since pull is designed for syncing an existing project). If you're sure you want to overwrite, use the --force flag:
htmlhost clone my-site --force
Use case: moving a browser project to VS Code
This is the most common reason to clone. You prototyped a site in the web editor, maybe used the AI to flesh out the design, and now you want the full power of your local development environment. VS Code extensions, Git version control, your own build tools.
Clone the site, open the folder in your editor, and you're off. Every change you make locally can be pushed live with htmlhost deploy.
Use case: onboarding a new team member
An Admin, Editor or Contributor on the site can clone it to get a local copy without needing access to your machine or your Git repo. They run:
htmlhost clone the-shared-site
They can then edit locally and use htmlhost pull to stay in sync. Admins and Editors can publish; Contributors can save drafts but cannot publish. Viewers do not have file-editing access.
Use case: creating a local backup
Even if you don't plan to edit locally, cloning is a quick way to snapshot a site's saved files onto your machine. It's a one-command backup that preserves the full file structure.
What happens after cloning
Once you've cloned, your local folder is a fully linked htmlhost project. The workflow from here is the same as if you'd started locally:
htmlhost deploypushes your local changes to the live sitehtmlhost pulldownloads any changes made on the server (via the web editor or by collaborators)- The CLI checks for conflicts before you deploy, and warns about newer remote changes; it does not merge files or prevent an explicit overwrite
Quick reference
| Command | What it does |
|---|---|
htmlhost clone my-site | Clone into a ./my-site folder |
htmlhost clone my-site ./proj | Clone into a specific directory |
htmlhost clone my-site --force | Overwrite an existing non-empty directory |
Choose the source
Clone uses the saved working version by default. Use htmlhost clone my-site --published to download the last published files, or --draft for the saved draft. Unsaved browser edits are not available. These commands require access to the site; a public URL alone does not grant access.
The htmlhost VS Code extension also offers Clone a Site for sites you can edit.
Ready to try it yourself?
Import your HTML, check the preview, then publish a link you can share and update.
Start hosting