Let an AI agent manage your site
A coding agent that can run commands on your computer (Claude Code, Codex, Gemini CLI, or the agent mode in Cursor or VS Code) can edit your site and publish it over SFTP. You give it a login of its own, with a key instead of a password, and can switch it off whenever you like.
Chat assistants that can't run commands can still write the pages for you; upload them yourself in the dashboard or with FileZilla.
1. Keep the site in a folder on your computer
The agent edits files on your computer and then uploads them. Use a project folder with the website in a
site folder inside it, so notes for the agent are never uploaded:
my-website/
AGENTS.md ← instructions for the agent (step 4); stays on your computer
site/ ← exactly what's published
index.html
...
If your site is already online, step 3 shows how to download it into site/.
Putting the folder under version control (for example git init) gives you a history of every
change the agent makes, and an easy way to undo one.
2. Give the agent its own login
- Create a key just for the agent. It has no passphrase so the agent can use it without asking you,
which is why it gets its own login rather than yours:
ssh-keygen -t ed25519 -N "" -C "pagehaus agent" -f ~/.ssh/pagehaus_agent - In the dashboard, open your site's SFTP tab and add a login called
agent. Choose a folder if the agent should only work on part of the site. - Click Edit next to
yoursite.agentand paste the contents of~/.ssh/pagehaus_agent.pubinto SSH public keys.
Extra logins come with the Personal and Pro plans. On the Free plan you can add the key to your
main login (yoursite) instead; the agent then has full access to the whole site, and the commands
below use yoursite instead of yoursite.agent.
3. Connect once yourself
The first connection asks you to confirm the server's fingerprint. Do this yourself, so the agent never gets
stuck on the question. Compare it with the fingerprints on Connecting with SFTP,
answer yes, then type bye:
sftp -P 2022 -i ~/.ssh/pagehaus_agent yoursite.agent@sftp.pagehaus.app
To download a site that's already online into site/, run this in your project folder:
printf 'get -r / site\n' | sftp -b - -P 2022 -i ~/.ssh/pagehaus_agent yoursite.agent@sftp.pagehaus.app
4. Tell the agent how to publish
Save this as AGENTS.md in your project folder (Claude Code reads CLAUDE.md; you can
use the same text). Most agents read it automatically; otherwise, tell the agent to read it first.
# Website
The `site/` folder is a static website hosted on Pagehaus: https://yoursite.pagehaus.site/
- Plain HTML, CSS, JavaScript and images. There is no build step and no server-side code (no PHP).
- Shared parts such as the header use Server Side Includes, e.g.
`<!--#include virtual="/includes/header.html" -->`. See https://pagehaus.app/help/server-side-includes
- Contact forms post to `/_form/<name>`. See https://pagehaus.app/help/contact-forms
- Everything in `site/` is public once uploaded. Never put passwords, keys, `.env` files or private notes there.
## Publishing (run from this folder)
- Upload the whole site:
printf 'lcd site\nput -r . /\n' | sftp -b - -P 2022 -i ~/.ssh/pagehaus_agent yoursite.agent@sftp.pagehaus.app
- Upload one file:
scp -P 2022 -i ~/.ssh/pagehaus_agent site/about.html yoursite.agent@sftp.pagehaus.app:/about.html
- Delete a file or an empty folder on the server:
printf 'rm old-page.html\nrmdir old-folder\n' | sftp -b - -P 2022 -i ~/.ssh/pagehaus_agent yoursite.agent@sftp.pagehaus.app
- List what's on the server:
printf 'ls -l\n' | sftp -b - -P 2022 -i ~/.ssh/pagehaus_agent yoursite.agent@sftp.pagehaus.app
Uploading never deletes anything on the server: when you remove or rename a page, delete the old one too.
rsync is not supported. After publishing, check the pages at https://yoursite.pagehaus.site/
Staying in control
- Switch it off: on the SFTP tab, Disable or Delete the agent's login. New connections are refused straight away (a connection that's already open isn't cut off).
- Limit it: give the login a folder (it can't see anything above it), or make it Read-only for an agent that should review the site but not change it.
- See what it did: the SFTP tab shows when each login last connected, and version control on your computer shows every change.
- Undo mistakes: re-upload from your own copy. We keep nightly backups too, but restoring one means emailing support, so your own copy is faster.
What an agent can't do yet
Over SFTP, agents work with your files. The API can also create sites. Custom domains, form messages and billing are only in the dashboard for now.