Skip to content

The card file

The card document

Every top-level key, the folder a card lives in, and the limits.

A card is one JSON object. These are all the keys it can have at the top level, straight from the catalogue. Only schema, app, name, permissions and cards are required.

Top-level keys

Always "tailapps/v0"

Required

app

Id: kebab-case, 3–40 chars, unique per install

Required

"laravel-cloud"

Display name, at most 40 chars

Required

One line, shown on the approval sheet (at most 200 chars)

SF Symbols name, drawn in white on the app's accent (style.accent). For a custom image, pass icon_image to create_app/update_app: { "png_base64": "…" } or { "url": "https://…" } (≤ 1 MB, re-encoded at 256 px); it's not part of the app JSON

"cloud"

Author's version number (whole number)

External CLIs the app needs

[
    {
        "cli": "cloud",
        "install": "composer global require laravel/cloud-cli",
        "check": [
            "cloud",
            "--version"
        ]
    }
]

Permission strings (see 'permissions'); may be empty

Required

[
    "cli:cloud deploy",
    "notify"
]

Values the user provides at setup (see 'settings')

Declared state keys (see 'state')

Key = the state key it fills (see 'sources')

File name → shell script text, for short scripts; longer ones go in create_app/update_app's files map as "scripts/<name>.sh" (one or the other per name). Either way "script": "<name>" runs scripts/<name> as /bin/sh <file> <args…>, and the user approves the exact text: an edited file doesn't run until reviewed. Scripts and CLIs get PATH, HOME, LANG and TAILAPPS_PID (TailApps' own process id) plus declared env. Apps that list or stop processes must leave out $TAILAPPS_PID: a run whose args contain it is refused

{
    "ports.sh": "/usr/sbin/lsof -nP -iTCP -sTCP:LISTEN"
}

At least one card: { "id": "main", "layout": <part> }

Required

Name → action (see 'actions')

Run an action at a time from state: name → { at: time or list binding, time: each item's ($item), before: seconds early, action } ($args.time, $args.item). iPhone: while open

{
    "heads_up": {
        "at": "$today",
        "time": "$item.start",
        "before": 120,
        "action": "warn"
    }
}

Where the app shows (see 'views'). Default: a menubar view of the first card

Keyboard shortcuts (see 'shortcuts')

{ "accent": "#2f6fed", "density": "compact" | "comfortable" }

"allowed" (default) or "never". Whether the user may turn on Sync to My Devices for this app (SPEC §38). "never" hides the switch and rules out 'send' steps: use it for apps holding sensitive data, like clipboard history

SPEC §66: an action to run after synced state (state keys with "sync": true) arrives from another device, e.g. to schedule this device's own notifications for a timer started elsewhere. $args.keys (the keys that changed), $args.previous (each one's value before, e.g. to cancel the notification of a timer removed elsewhere), $args.from (the device's name), $args.replay (true while a copy just added catches up). In this run, send steps send nothing and writes to synced keys stay on this device

"reschedule"

Set by TailApps on a named copy: the id it was copied from; not for authors

Sign in with a provider instead of an API key (SPEC §63). { "<provider>": { name, authorize, token, client_id, scope?, hosts, redirect?, params? } }, at most 3. OAuth authorization code with PKCE: no client secret ever (providers that need one, like GitHub OAuth apps, Notion or Slack, aren't supported yet). client_id is the provider's public client id, or "$settings.<key>" of a text setting. hosts are the only hosts the token goes to; each, and the token URL's host, needs net:<host>. scope is the provider's own scope string (Linear: "read,write"). redirect: "relay" (default: register https://tailapps.com/oauth/callback with the provider) or "app" (tailapps://oauth/callback). Until the person signs in on the card, the card shows Sign in with <name> and nothing runs; it works on the Mac and the iPhone, and each device signs in itself. Use it with a fetch: "auth": "oauth:<provider>"

{
    "linear": {
        "name": "Linear",
        "authorize": "https://linear.app/oauth/authorize",
        "token": "https://api.linear.app/oauth/token",
        "client_id": "$settings.client_id",
        "scope": "read",
        "hosts": [
            "api.linear.app"
        ]
    }
}

Rules the validator holds you to

  • A part is an object with exactly one kind key, whose value is the main value: { "stat": "$mrr | currency", "label": "MRR" }.
  • A string that starts with $ is a binding: "$deploys.0.status | upper". Inside other text, {$…} interpolates: "Updated {$meta.deploys.updated | ago}". Write {{ for a literal {, and $$ at the start for a literal $.
  • State holds raw values. Format at display time with pipes (| currency, | ago, …). Never store formatted strings.
  • Every cli/script/fetch/capability use must be covered by a string in "permissions". If one is missing, validate_app names the exact string to add.
  • cli takes a bare binary name and an args array, one element per argument. There is no shell: no pipes, globs, && or $VARS. For pipelines, write a script in "scripts".
  • Check a CLI's or API's real output before binding to its fields; don't guess field names.
  • HTTP without a key (website and uptime checks, public JSON APIs): a fetch source, not curl in a script. For a website check use "raw": true: it writes { status, ms } (status 0 when unreachable) and needs only net:<host>, no script approval. Derive up/slow/down with a binding on status and ms; failed checks retry with backoff by themselves.
  • Secrets never go in the app. fetch uses "auth": "<connection>" (and still needs net:<host>, so the user sees where the key goes); the Connection's kind decides the header (bearer, basic, api_key, headers). Scripts get env values like "connection:stripe".
  • No raw styling: use tone, size and emphasis tokens. The only colour is style.accent.
  • Folder, file and connection settings are always picked by the user; reference them as $settings.<key>.
  • Unknown keys are errors.

Limits

The card document 256 KB
One inline script 32 KB
Shortest source interval (every) 5 seconds
Longest timeout 600 seconds
Containers inside containers 4

A card is a folder

A card with only app.json is complete. Longer scripts, images and data files sit next to it in a fixed layout, the same whether it’s installed, exported or in the Directory:

site-check/
  app.json           the document
  scripts/check.sh   script files: "script": "check.sh" runs scripts/check.sh
  assets/logo.png    images, JSON, text and CSV the card uses: "image": "assets/logo.png"
  icon.png           optional custom icon
  • Only scripts/, assets/ and icon.png; at most 2 folders deep, no hidden files.
  • scripts/: .sh files (or no extension), text, at most 256 KB each. A short script can stay inline in "scripts" instead, but a name can’t be both.
  • assets/: .png .jpg .jpeg .gif .json .txt .md .csv, at most 1 MB each.
  • At most 50 files and 5 MB in all.

Packaging and sharing