Skip to main content

Publish a static website with the CLI

This worked example publishes the Stillform studio page to www on your domain, then updates and restores the same site. Install and sign in, download the example HTML, and save it as index.html in your working directory.

Need a domain first? Follow buy a domain and manage DNS. That example manages a separate blog record; the hosting workflow below handles the records required for www.

Write commands below are for a human using an interactive terminal. They omit --json so the CLI can ask for confirmation. Read-only checks use JSON for clear results. Tools using the Skill and scripts follow the approval steps below.

1. Check capabilities and existing sites​

nameslink site hosted capability --json
nameslink site hosted list --json

Check availability, file limits, and domain eligibility for this account. For an existing site, save and reuse its ID so an update does not create another site.

2. Upload and review a preview​

nameslink site hosted preview --file ./index.html

Review the file and upload operation, then type confirm when prompted. The first preview creates a site. The output supplies a preview URL and a publication command containing the site ID and release ID. Keep that command, including any original request key. In JSON output, these IDs are hostedSiteId and release.releaseId. Do not substitute a preview ID for the release ID.

Open the preview in a new window. For this file, check the “Good things. Made distinct.” headline, the green sculpture, the three portfolio concepts, and the mobile layout. Expand a project description and test navigation before publishing.

For a multi-file site, use --dir ./dist instead of --file ./index.html, with a non-empty root index.html in the static output. The CLI does not build source projects or provide a backend.

A new preview normally lasts 3 hours; follow the returned expiration. Creating a preview does not change an existing live website.

3. Publish to your domain​

Replace the placeholders, including brackets, with actual IDs and your own hostname:

nameslink site hosted publish <site-id> --release <release-id> --host www.example.com
nameslink site hosted status <site-id> --watch --json

A new binding needs an eligible NamesLink domain owned by this account and available hosting resources. Use a single-label subdomain such as www.example.com. New external domains, apex domains, wildcards such as *.example.com, and nested prefixes are unsupported. Review the complete hostname and DNS changes, then complete the requested identity verification.

An accepted request is not a live website. Follow the original site's nextAction or recovery command while pending. Use these checkpoints:

CheckpointExpected result
Temporary previewThe reviewed Stillform page opens at the returned preview URL
Publication statusThe original operation succeeds and returns the verified published site.url
Your domainThe exact www hostname opens over HTTPS with the same page and working navigation

If only the console's embedded view fails, open the published URL directly. See preview troubleshooting.

Skill and script execution

Automation may use --yes --json only for an exact operation that has been reviewed and approved. --json alone does not enable an interactive confirmation prompt; a write can return ApprovalRequired. Approval does not bypass MFA or authorize a different target or unlimited retries. Follow the returned same-challenge continuation for verification. Final JSON is written to stdout; progress events go to stderr.

4. Update using the existing site ID​

nameslink site hosted preview <site-id> --file ./index.html
nameslink site hosted publish <site-id> --release <new-release-id>
nameslink site hosted status <site-id> --watch --json

Edit a piece of text in your local index.html, then run the preview command on the existing site ID. Check that the new preview contains the change while the live domain still serves the previous version. Publish the newly returned release, omitting --host to preserve the destination. Wait for success and check the changed text on the live domain.

The website name is only a management label. Rename it with:

nameslink site hosted rename <site-id> --name "My portfolio"

5. Review history and restore​

nameslink site hosted history <site-id> --json
nameslink site hosted restore <site-id> --release <retained-release-id>
nameslink site hosted status <site-id> --watch --json

Choose the retained successful release from before your text change. Review the restoration, wait for the new operation to succeed, then check that the old text has returned on the same domain. An arbitrary expired preview is not a substitute for a retained release.

If a command is interrupted or awaits MFA or DNS, keep the original operation ID, idempotencyKey, and recovery commands. See interruption recovery.