Flat / Docs
Publish your finished files.
Use your browser for individual files. Use the CLI for folders, reusable addresses, and access controls.
Publish from your browser
Select files, enter your email if signed out, and publish. Open the returned link to check the result before sharing it. Files published in the browser are public.
Signed-out uploads expire after 1 hour and can contain up to 5 MiB in total. Sign in before expiry to keep them online. If your email already belongs to a verified account, sign in before uploading.
The browser accepts up to 1,000 individual files with unique names. It does not accept folders, extract ZIPs, or rename files. All selected files publish at the top level. Signed-in limits follow your plan.
Publish from your terminal
Install Node.js 20 or newer. Build or export your static site first, then publish the finished folder:
npx -y @getflat/cli deploy ./distThe CLI preserves relative file paths and prints the public URL after publication. A root index.html opens as the main page. The CLI uploads every regular file in the selected folder, including hidden files; choose only the files you intend to publish.
Signed-out uploads expire after 1 hour. Sign in before expiry to keep them online, or sign in before publishing for no default expiry:
npx -y @getflat/cli login you@example.comComplete sign-in in your browser, then paste the returned code into your terminal. Active anonymous uploads from that CLI identity transfer to your account. An explicitly chosen expiry stays in place.
Update files at the same address
Each upload has its own version link. Use a named address when you need one address that can point to later uploads. Sign in first so your address stays under your Organization's ownership.
npx -y @getflat/cli deploy ./proposal.pdf --domain client-proposal-example.onflat.pageReplace the example address with an available name of your own. To update it, publish the revised PDF with the same --domain value. This explicitly points the named address to the new upload; the earlier upload's version link still identifies its original files.
The same workflow works for a site folder. You can also point an address you own to an existing upload:
npx -y @getflat/cli domain assign client-proposal-example.onflat.page DEPLOYMENT_IDUse the upload ID returned by Flat. Domain changes can take up to 60 seconds to appear. The browser uploader does not expose named-address controls.
Named addresses and your own domain
Named onflat.page addresses
Named addresses are included on Free. The label before .onflat.page must have 22 to 63 characters. Use letters, digits, and internal hyphens. Each upload can have one named address.
Custom Domains
Adding your own domain requires a paid plan and access to its DNS settings. Publish using the domain, then inspect it for the required DNS records and serving status:
npx -y @getflat/cli deploy ./dist --domain preview.example.com
npx -y @getflat/cli domain inspect preview.example.comReplace the example with a domain you control. Follow the DNS instructions returned by Flat and inspect again after your DNS provider applies the records. Domain registration costs are separate.
Require a visitor password
Password protection is available on every plan through the CLI or API. It gates the page and its uploaded files. Anyone with the link and password can open them.
npx -y @getflat/cli deploy ./dist --password YOUR_PASSWORDReplace YOUR_PASSWORD with your chosen password, using quotes if it contains spaces. Passwords must contain 8 to 128 UTF-8 bytes, with no leading or trailing whitespace.
For an upload you own, use deployment update DEPLOYMENT_ID --password YOUR_PASSWORD. Use --remove-password to remove the gate. Password protection does not prevent an authorized visitor from saving files.
What opens at your link
- A root
index.htmlopens as your web page. - One file without
index.htmlopens in Flat's file viewer. - Several files without
index.htmlopen in the file explorer. - An exact path, such as
/proposal.pdfor/report.html, serves that original file.
Viewers support PDFs, images, text and source code, spreadsheet data, EPUBs, and browser-supported audio/video. Word-processing documents, presentations, and LaTeX use generated PDF previews. Flat does not run spreadsheet formulas, transcode media, or provide Office editing.
Text previews stop at 1 MB or 20,000 lines. Document-to-PDF conversion accepts up to 5 MB of source and produces up to 20 MB of output, with a 75-second deadline. Other format-specific limits also apply. Larger hosting plans do not increase preview limits.
Unsupported or over-limit files retain original open/download actions. All generated viewers keep Flat branding and cannot be embedded in an iframe. Your own HTML page and original file URLs are separate delivery paths.
Publish through the API
The CLI uses Flat's deployment API. API clients authenticate with a bearer credential and publish in three steps:
- Create a deployment with
POST /deployment. Supply afilesarray with each file'spathand bytesize. - Upload each file's bytes to its returned
put_urlusing HTTP PUT. - Publish with
POST /deployment/{id}/finalize. Use the returned URL after successful finalization.
Creation also accepts domains, password, viewer, and either ttl or expires_at. Use PATCH /deployment/{id} to update access or expiry settings on an active upload you own.
API base: https://control.getflat.dev. Authentication instructions · Agent publishing instructions.