Pull Remote Changes to Your Local Project
When your files live in two places
You deployed a site from your terminal using the htmlhost CLI. Your files are on the server. But then something changes on the remote side. Maybe you opened the site in the web editor and tweaked the CSS. Maybe a collaborator you invited made updates. Maybe you used the AI editor to refine a section.
Now the live site is different from what's on your laptop. How do you bring those changes back?
That's what htmlhost pull is for.
Basic usage
Navigate to your project folder (the one with a .htmlhost link file) and run:
htmlhost pull
The CLI reads the .htmlhost file to know which site to pull from, fetches all pages and assets from the server, compares them with your local files, and shows you exactly what changed.
You'll see a list that looks something like this:
+ New: blog.html (1.2 KB)
~ Modified: index.html
~ Modified: styles.css
ℹ 1 new, 2 modified files to pull
Nothing is overwritten until you confirm.
Pulling a specific site
If your project isn't linked yet (no .htmlhost file), you can specify the site slug directly:
htmlhost pull my-portfolio
The CLI fetches the content from my-portfolio.htmlhost.co and writes the files into your current directory.
Preview before writing
If you want to see what would change without actually overwriting anything, use the --dry-run flag:
htmlhost pull --dry-run
This shows the full list of new and modified files but writes nothing to disk. It's useful when you're not sure if the remote changes conflict with local edits you haven't deployed yet.
Skipping the confirmation
For automated workflows or when you're confident in the changes, use the --force flag:
htmlhost pull --force
This pulls and overwrites without asking. Handy in scripts, but use it deliberately.
What gets pulled
The pull command fetches everything the site contains:
- HTML pages are written as local files matching their URL paths (
/aboutbecomesabout.html) - CSS and JavaScript files are written with their original paths preserved
- Images, fonts, and other binary assets are downloaded and saved locally
Binary assets are compared using SHA-256 hashes, so the CLI only downloads files that have actually changed on the server.
A real-world scenario
Here's a situation where htmlhost pull shines. You're working on a site with a teammate. You deployed the initial version from your laptop. Your teammate opens the site in the htmlhost web editor and makes design changes, updates some copy, and publishes.
You come back to your laptop the next day. Instead of asking "what did you change?" and manually patching files, you just run:
htmlhost pull
The CLI shows you exactly which files were modified and what's new. You confirm, and now your local project matches the live site. You can keep editing locally and deploy again when you're ready.
How sync state works
Every time you deploy or pull, the CLI updates the sync metadata in your .htmlhost file. This includes the site's version number and a timestamp. When you pull, the CLI compares the remote version with the version recorded in your local sync state to determine what's changed.
This is also what powers the pre-deploy sync check, which warns you before you accidentally overwrite remote changes.
Quick reference
| Command | What it does |
|---|---|
htmlhost pull | Pull changes for the linked site |
htmlhost pull my-site | Pull a specific site by slug |
htmlhost pull --dry-run | Preview changes without writing files |
htmlhost pull --force | Pull without a confirmation prompt |
Ready to try it yourself?
Paste HTML, get a link. Deploy your site in under 3 seconds — no config, no build step.
Start hosting