Getting started

Interfold lets you and your agents publish real websites, files, and backend functions from the command line — no build step, no servers to manage. Ship a page, expose an API endpoint, persist data, and get a live *.interfold.site URL in seconds.

This guide takes you from zero to a live page and a working function.


1. Install the CLI

The interfold CLI is the primary way to work with Interfold. Install it with:

curl -fsSL https://downloads.interfold.dev/install.sh | bash

The installer adds Interfold to your zsh or Bash startup files when it recognizes your shell. Open a new terminal window, or run the source command it prints, then continue below. To manage your PATH yourself, run the installer with bash -s -- --no-path.

Verify the install:

interfold version

2. Log in

Authenticate the CLI. This opens a browser to approve the session and stores a credential locally (at ~/.interfold/credentials.json) — you never paste keys into your shell.

interfold login

Confirm you’re authenticated:

interfold whoami

You’ll see the account the CLI is acting as. Everything you publish belongs to this account.

3. Create a site

A site is a container for files and functions, served at its own *.interfold.site subdomain. Create one:

interfold sites create --name "My Site" --access PUBLIC

The response includes the site id and subdomain. Save the id — site-scoped commands require a --site <id> flag.

--access PUBLIC means anonymous visitors can open the site. Use PRIVATE for a draft or team-only project. See Sites & access.

4. Publish a page

Create a local HTML file:

cat > index.html <<'HTML'
<!doctype html>
<html>
  <head><meta charset="utf-8"><title>Hello, Interfold</title></head>
  <body><h1>Hello from Interfold</h1></body>
</html>
HTML

Upload it to the site’s web directory:

interfold files put ./index.html /web/index.html --site <site-id> --content-type 'text/html; charset=utf-8'

Look up your subdomain and open the live URL:

interfold sites get <site-id>
curl -I https://<subdomain>.interfold.site/

Your page is live at https://<subdomain>.interfold.site/.

5. Deploy a function

Interfold Functions let you run TypeScript on the server at /api/*. Create a handler:

cat > hello.ts <<'TS'
export async function handler(req: Request, ctx: InterfoldContext) {
  const name = new URL(req.url).searchParams.get('name') ?? 'world'
  return Response.json({ ok: true, message: `hello ${name}` })
}
TS

Deploy it by uploading the source under /api/:

interfold files put ./hello.ts /api/hello.ts --content-type text/typescript

Invoke it:

curl -i "https://<subdomain>.interfold.site/api/hello?name=agent"

You now have a live page and a live endpoint. See Functions for the full runtime contract, Databases or Data files for persistence, and Secrets for runtime config.


Where to go next

On this page