Sharing
Sharing publishes an artifact as a link rather than a file. It exists so you do not have to flatten a design to show it to someone.
A deck becomes a URL that still animates. A prototype stays clickable. A 3D model stays orbitable. A motion composition plays. The alternative — export to PPTX, hope the fonts and transitions survive, email a 40 MB attachment — is what this replaces.
Why a share instead of an export
| Goal | Right tool |
|---|---|
| "Show me this design" | share |
| "Send this deck to a client" | share |
| "Let the team review the prototype" | share |
| "I need to edit this in PowerPoint" | export pptx |
| "I need a print-ready file" | export pdf |
If the answer to "what will they do with it?" is look at it, share. Export is for when a file must go into another tool.
A share keeps full fidelity because nothing is converted: the same HTML, the same assets, the same JavaScript that renders in TF Design renders in the recipient's browser.
Creating a share
From an agent, the share_artifact MCP tool:
share_artifact(project="Q4 board deck")
share_artifact(project="Q4 board deck", password="quarterly-2026", expiresInDays=30)
From a terminal:
tfdesign share "Q4 board deck"
tfdesign share "Q4 board deck" --password-stdin --expires 30d
tfdesign share --list --project "Q4 board deck"
tfdesign share --revoke a1b2c3d4e5f6g7h8
Output:
Share ready: https://artifacts.toothfairyai.com/8f3c…/a1b2c3d4e5f6g7h8
Protected by a password — send it to the recipient separately.
Expires: 2026-12-23T00:00:00.000Z
Passing the password via --password-stdin rather than --password keeps it out of your shell history and out of the process table.
What a share is (and is not)
A share is a snapshot. At publish time the project bundle is copied into object storage and served from a CDN.
- Editing the project afterwards does not change the link — the recipient keeps seeing what you sent.
- Re-sharing the same project mints a new link, leaving the old one intact.
- The link works with TF Design closed and with your machine offline.
- Revoking is permanent and immediate.
There is no live/proxy mode: a link never reaches back into your local daemon.
URLs
https://artifacts.toothfairyai.com/{workspaceId}/{shareId} (Australia)
https://artifacts.eu.toothfairyai.com/{workspaceId}/{shareId} (Europe)
https://artifacts.us.toothfairyai.com/{workspaceId}/{shareId} (United States)
The {workspaceId}/{shareId} pair is always both segments. That is deliberate: a share is scoped to a workspace, so there is no URL shape that could address one workspace's artifact from another.
shareId is 16 characters of lowercase base32 (80 bits of entropy, generated server-side). It is never derived from the project id — re-sharing must produce a different id.
The friendly host 302s to a content host on *.cloudfront.net. That redirect is an isolation measure, not an implementation detail: artifact HTML is AI-authored and runs arbitrary JavaScript, and *.cloudfront.net is on the Public Suffix List, so a shared artifact is a separate site from toothfairyai.com and cannot read any of its cookies.
Password protection
share_artifact(project="Compensation model", password="…")
Behaviour:
| Aspect | Value |
|---|---|
| Minimum password length | 8 characters |
| Hashing | scrypt (N=16384, r=8, p=1), per-share salt |
| Wrong-password lockout | 5 attempts, then 15 minutes |
| Unlock cookie lifetime | 2 hours |
| Cookie scope | /{workspaceId}/{shareId}/ only |
The password is asked before any artifact byte is served — the CDN checks a signed cookie at the edge and redirects to a password page otherwise. Without the cookie, the HTML is not just hidden, it is never sent.
Changing a share's password rotates a per-share signing key, which invalidates every cookie already handed out. That is also how revocation works for links people have already opened.
Passwords are never echoed back by any API. There is no "show me the password" call.
Expiry
By default a share never expires — it stays live until revoked. A shared deck sitting in a client's inbox should not silently die on day 8.
Pass expiresInDays (or --expires 7d) when you want a deadline. Expired shares return 410 SHARE_EXPIRED rather than 404, so a recipient can tell "this expired" from "this never existed".
3D models
A shared .glb/.gltf renders in an interactive viewer with orbit controls — the point of sharing a model is that the recipient can turn it around.
.glband.gltfget a<model-viewer>scene with camera controls. Draco and KTX2 compressed models work without any extra setup..obj,.stl,.fbx,.usdzare shown through the same viewer, with a note that conversion to glTF is needed for full interactivity.- A three.js scene (an
index.htmlthat loads a model itself) shares as an ordinary HTML artifact and bundles the whole project tree, so a model referenced only inside aloader.load('…')string is still included.
The same viewer markup is used by the in-app preview, so a model looks identical before and after sharing.
Motion compositions
A motion artifact plays in the shared link.
This is worth stating explicitly because it is not automatic. Motion compositions are authored so every animation is animation-play-state: paused and driven by a --od-t playhead — which only the MP4 renderer advances. Served as-is in a browser, a motion piece would sit on a single frozen frame. The share pipeline injects a small playback driver that advances the playhead, so the shared copy loops the animation. No artifact code is modified.
Supported artifact types
| Artifact | Shared as | Renders |
|---|---|---|
| HTML deck / prototype | HTML | in the browser, full fidelity |
| Motion composition | HTML | plays, loops |
| Three.js scene | HTML | interactive |
.glb / .gltf model | generated viewer | orbit / zoom |
| Image | generated viewer | fit-to-screen, zoom |
Video (.mp4, .webm) | generated viewer | native player, streaming |
| Audio | generated viewer | native player |
| generated viewer | inline viewer | |
| Anything else | generated viewer | download page |
Bundling rules
A share must be self-contained. The bundler follows the artifact's real dependency graph:
- HTML/CSS —
<script src>,<link href>,<img srcset>,url()inside<style>blocks andstyle=""attributes, and CSS@import. This is the same walker the Vercel deploy uses. - ES modules —
import … from '…', side-effect imports, dynamicimport(), andnew URL('…', import.meta.url), across.js/.mjs/.ts/.tsx/.jsx. Extensionless specifiers are resolved. - Import maps — relative specifiers in
<script type="importmap">are included.
Dependencies on a CDN (import 'three', a script from unpkg) are not vendored. They load from the CDN at view time, and the share reports them as an external-dependency warning. That is usually what you want; it does mean the link depends on that CDN staying up.
Limits:
| Limit | Value |
|---|---|
| Per file | 25 MiB |
| Whole bundle | 300 MiB |
| File count | 1000 |
Exceeding a limit is a hard error naming the offending file. A share is never published silently truncated.
Publishing is transactional
A link only becomes reachable once every byte has landed.
createmints the share aspendingand presigns one upload per file.- Files are uploaded directly to storage — bytes never transit the share API.
finalizeverifies each object exists, then flips the share tolive.
If any upload fails, the share is revoked and the URL never resolves. A half-uploaded artifact cannot be reached.
Branding footer
Off by default, because an injected footer is a layout risk on a pixel-perfect deck:
tfdesign share "Pitch deck" --branding
Managing shares
tfdesign share --list --project "Q4 board deck"
a1b2c3d4e5f6g7h8 public live views=12 expires=never https://artifacts.toothfairyai.com/8f3c…/a1b2c3d4e5f6g7h8
z9y8x7w6v5u4t3s2 password live views=3 expires=2026-12-01 https://artifacts.toothfairyai.com/8f3c…/z9y8x7w6v5u4t3s2
tfdesign share --revoke a1b2c3d4e5f6g7h8
Revoking kills the link immediately and invalidates any unlock cookie already issued for it.
Requirements
Sharing needs a ToothFairyAI credential with a workspace id — the URL is workspace-scoped, so a key without a workspace cannot produce one.
tfcode setup
If sharing reports SHARE_NO_WORKSPACE, your profile has a key but no workspace.
HTTP API
The daemon exposes the same operations the CLI and MCP tools use:
| Method | Path | Purpose |
|---|---|---|
POST | /api/projects/:id/shares | Build and publish a share |
GET | /api/projects/:id/shares | List shares for a project |
POST | /api/shares/:shareId/revoke | Revoke a share |
curl -s -X POST http://127.0.0.1:7456/api/projects/$PROJECT_ID/shares \
-H 'content-type: application/json' \
-d '{"protection":"public","title":"Q4 board deck"}'
{
"shareId": "a1b2c3d4e5f6g7h8",
"url": "https://artifacts.toothfairyai.com/8f3c…/a1b2c3d4e5f6g7h8",
"fileCount": 12,
"totalBytes": 4820113,
"warnings": []
}
Troubleshooting
| Symptom | Cause |
|---|---|
SHARE_NO_CREDENTIALS | No ToothFairyAI API key found — run tfcode setup |
SHARE_NO_WORKSPACE | Credential has a key but no workspace id |
SHARE_BUNDLE_MISSING | Artifact references a file that is not in the project |
SHARE_BUNDLE_INVALID | A reference escapes the project root |
SHARE_BUNDLE_FILE_TOO_LARGE | One file exceeds 25 MiB — compress or host it externally |
| Share loads but assets 404 | An external-dependency warning was ignored, or a path was absolute |
| Motion share shows one frame | Check the artifact kind is motion; the playback driver is kind-gated |