Publish a website from Cursor, Claude Code or Codex
A coding agent such as Cursor, Windsurf, Claude Code or Codex can build a whole website in a folder on your computer. The last step, putting it online, can be the agent's job too. Set it up once, and "publish it" becomes one more thing you ask for.
First: is it plain files, or a project to build?
- Plain files:
index.html, other pages, CSS, images. They go online as they are. - A project: a
package.jsonand asrcfolder (React, Vue, Astro, Vite...). Ask the agent to build it (npm run build) and publish the folder that creates, usuallydist. Details in hosting a Lovable or Bolt site, which works the same way.
Option 1: the pagehaus command (the simplest)
- Create a free Pagehaus site and install the pagehaus tool.
- Run
pagehaus loginonce and paste a token from Account → API. - Tell the agent how to publish. Put this in the project's
AGENTS.md(orCLAUDE.md, or Cursor's rules) so it remembers:The website is in site/. Before publishing, run: pagehaus check site To publish, run: pagehaus deploy site --site yoursite It's live at https://yoursite.pagehaus.site/
Now "publish the site" works. pagehaus check catches broken links, missing images and
names in the wrong case before anything goes up, and pagehaus serve previews the site on your
computer exactly as it will be online.
Option 2: connect the agent to Pagehaus
Agents that support MCP (Claude Code, Codex, Cursor, VS Code) can work on your site directly: write pages, check the site for problems, read your form messages and write blog posts. The setup for each is in connect an AI assistant. For Claude Code it's one line:
claude mcp add --transport http pagehaus https://pagehaus.app/mcp
Option 3: its own SFTP login
For agents that prefer to copy files, give them an SFTP login and key of their own that you can switch off at any time: let an AI agent manage your site.
Publishing from GitHub
If the project is on GitHub, the Deploy to Pagehaus action publishes the site on every push, so the agent only commits. See the pagehaus tool.
Staying in control
- Every change is kept in version history, whichever way it arrived.
- Tokens and connections can be limited to one site, and removed under Account → API.
- Keep secrets out of the site folder: anything you publish, anyone can read.
Something broken once it's online? See why an AI-made website works on your computer but not online.