thelastapi
Get started free

Edit a live site by deploying only what changed

Deploy only the files that changed using thelastapi's content-hashed hosting, terminal CLI, MCP agent tools, or direct HTTP API calls.

On this page 9 sections

To deploy only changed files, use thelastapi's content-hashed hosting: the host checks existing file hashes, uploads only new or modified files, and lays them over your live site. Whether you trigger an update through the terminal CLI, a coding agent in Claude or ChatGPT, or direct HTTP requests, unchanged files are never re-uploaded.

This guide covers how file-level diffing works during deployments, how to push partial edits from a terminal or an AI agent, and how to verify and roll back changes.

How content hashing prevents redundant uploads

Deploying your entire site folder every time you fix a typo wastes bandwidth and build time. thelastapi handles hosting using SHA-1 content hashing:

  1. Hash comparison: The host checks the SHA-1 hash of each file in your project against files it already stores.
  2. Selective transfer: Only files with hashes the host does not currently possess are uploaded.
  3. Manifest registration: The deployment is finalized by sending a manifest listing the paths and hashes that compose the release.

Because each deployment maintains its own complete file manifest, identical assets shared across releases are uploaded exactly once. If you change a single CSS file in a directory of hundreds of assets, only that single CSS file moves across the wire.

Method 1: Deploy edits from your terminal

When deploying from a local repository or folder, the CLI automatically hashes your workspace and skips files that are already present on the host.

To deploy your directory after making updates:

Terminal
vibiz deploy -m "Update pricing table"

To verify changes in an isolated environment before updating your live URL, pass the --preview flag:

Terminal
vibiz deploy ./site --preview

A preview deployment generates a separate URL for testing. When you are ready to make that preview live, promote it:

Terminal
vibiz promote dep_123456

When you promote a production deployment, the live site switches instantly because the required files are already stored. If you need a simple walkthrough for setting up a deployment from scratch, check our guide on how to deploy a static site with one command.

Method 2: Deploy only changed files from an AI agent

If you connect Claude or ChatGPT via the remote MCP server at https://thelastapi.dev/mcp, your agent does not need your whole folder on disk. The agent treats the live deployment's files as the project's source of truth.

The process follows three steps:

  1. Read existing paths: The agent calls vibiz_code with action: "list" or action: "read" to inspect the current live files:
JSON
{
  "action": "read",
  "project_id": "prj_123",
  "paths": ["index.html"]
}
  1. Send only modified files: The agent calls vibiz_deploy sending only the specific files that changed, along with any paths to remove in deleted:
JSON
{
  "project_id": "prj_123",
  "files": [
    {
      "path": "index.html",
      "content": "<!doctype html><html><body><h1>Updated Pricing</h1></body></html>"
    }
  ],
  "deleted": ["old-pricing.html"],
  "message": "Update pricing headline"
}

By default, updates are laid over the active release using base: "live". Any file not mentioned in the files array or the deleted array remains untouched from the previous release. A single MCP deploy call supports up to 300 files, 3 MiB per file, and 4 MiB total payload.

If you want to pull down files that an agent modified in chat to your local computer, use:

Terminal
vibiz pull my-site

Method 3: Deploy via HTTP in three steps

When building custom continuous integration (CI) pipelines or scripts, you can implement the exact content-hashing workflow over HTTP.

1. Check for missing files

Calculate the SHA-1 hash of the file you want to deploy, then ask the API which hashes are missing from storage:

Terminal
SHA=$(shasum -a 1 index.html | cut -d' ' -f1)

curl https://thelastapi.dev/v1/files/missing \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  -H "content-type: application/json" \
  -d "{\"shas\":[\"$SHA\"]}"

The response returns { "missing": ["<sha>"] } for any hash the host has not seen before. If the file was uploaded in a previous deployment, the missing array is empty.

2. Upload missing files

For any hash listed in the missing array, upload the raw file bytes:

Terminal
curl -X PUT https://thelastapi.dev/v1/files/$SHA \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  --data-binary @index.html

The API returns 204 No Content once the file bytes are stored.

3. Create the deployment manifest

Submit the complete file manifest for the project. Include both newly uploaded hashes and previously existing hashes:

Terminal
curl https://thelastapi.dev/v1/projects/prj_123/deployments \
  -H "Authorization: Bearer $VIBIZ_API_KEY" \
  -H "content-type: application/json" \
  -d "{\"files\":[{\"path\":\"index.html\",\"sha\":\"$SHA\",\"size\":$(wc -c < index.html)}]}"

The API answers with 202 Accepted and a deployment payload containing the deployment ID and status. You can poll GET /v1/deployments/:id until status transitions to ready.

Inspecting changes between versions

Every build automatically generates a persistent version record. You do not need to configure an external version control system to audit changes.

To see recent deployments and their summary notes:

Terminal
vibiz versions

To see the exact code differences between the current live version and the one immediately before it:

Terminal
vibiz diff

You can also diff two specific deployments by passing their IDs:

Terminal
vibiz diff dep_old123 dep_new456

Unified diffs are generated for text files up to 512 KB, covering up to 100 files and 200 KB of total change per diff. Learn more in our overview of website version history and rollbacks.

Rolling back an unintended change

Because every deployment retains its own manifest, restoring an earlier version is immediate. If a newly deployed edit causes an issue, switch back:

Terminal
vibiz rollback

This command points traffic to the production deployment immediately preceding the live one. To roll back to an older specific build, provide the deployment ID:

Terminal
vibiz rollback dep_123456

Restoring a production version switches traffic instantly without a rebuild. If you restore an older build that the hosting cache no longer keeps, the system automatically rebuilds it from the stored source files.

Rolling back affects the site's front-end files. The database is not rolled back; tables, rows, and schema adjustments remain in their current state.

Hosting limits and file rules

When planning deployments, keep these platform constraints in mind:

ParameterLimit
Daily builds30 builds per project per UTC day
Deployment sizeUp to 10,000 files per deployment
Individual file size50 MB per file (CLI / HTTP)
In-chat deploy payload300 files, 3 MiB per file, 4 MiB total
Text diff limit512 KB per file, 100 files, 200 KB total changes

The CLI automatically ignores development artifacts and sensitive files. The following paths are never uploaded: node_modules, .git, .next, dist, .turbo, vibiz.json, .env* files, and private credential files (*.pem, id_rsa, .npmrc).

For budget planning on side projects, read our breakdown of the cheapest way to host a website and database.

Next step

Start editing your site locally using the CLI or let your agent apply updates directly. Review the complete setup process in the Quickstart guide.

Frequently asked questions

Does thelastapi charge for deploying individual changed files?

Hosting is not charged today: builds and live sites are recorded in usage at $0, though pricing is not yet decided. Projects are limited to 30 builds per UTC day.

What happens if an edit breaks production?

You can run `vibiz rollback` to return to the version immediately before the live deployment, or `vibiz rollback dep_...` for a specific version. Switching to a recent production build happens instantly, though database tables and schema changes are not rolled back.

Can an AI agent edit my site without uploading the whole codebase?

Yes. An agent using the remote MCP server reads the current site with `vibiz_code` and submits only the changed files via `vibiz_deploy`, which overlays them on the live deployment.

Which files are excluded from deployments?

The CLI refuses to upload `node_modules`, `.git`, `.next`, `dist`, `.turbo`, `vibiz.json`, `.env*` files, credential keys (`*.pem`, `id_rsa`, `.npmrc`), and root or home configuration folders.