Skip to content

The card file

Settings, keys and sign-ins

What the person sets up: settings, Connections, OAuth sign-ins and scripts.

Some things only the person can give a card: a folder to save into, a bucket, an API key, a sign-in. The card declares what it needs, and TailApps asks in its own setup sheet after approval. An agent can’t fill these in, and the values never go in the card.

Settings

Values the user gives at setup, read as $settings.<key>. The setup sheet appears when a required setting is empty.

"settings": {
    "project": {
        "type": "folder",
        "label": "Project folder",
        "must_contain": ".cloud",
        "required": true
    }
}

Keys every setting takes

typerequired
labeltext
requiredbool
defaultvalue
syncbool
platforms["macos"]: only asked on these (others skip it, so a Mac-only folder or storage setting doesn't keep the app off the iPhone)

Setting types

Text field

Number field

keys min, max

Switch

url

URL field

Number + unit, stored as seconds

keys min

Popup

keys options (list of strings), options_from (a source name: its list of strings, or of { value, label } objects; the sheet runs it to load the choices)

Ticks for the user's calendars (needs calendar.read); a list of names for a calendar source's calendars, none: all

Picks one Reminders list (needs reminders.read or .write): a name for list, none: all

Folder picker (user picks; agents can't prefill)

keys must_contain, create, default (e.g. "~/Pictures/Quick Shot")

Where files go: the user picks a folder on this Mac or an S3-compatible bucket (AWS S3, Cloudflare R2, B2, MinIO…); agents can't prefill. files.save to it returns { kind: folder | s3, path, key, url }: for a bucket, url is public_base + key, or a presigned link (expires on the step, default and max 7 days)

keys allow (["folder", "s3"], default both), public_base (https URL links start with), create, default (a folder suggestion)
{
    "dest": {
        "type": "storage",
        "label": "Save shots to",
        "required": true
    }
}

File picker (user picks); the value is the file's path

keys accept (UTType identifiers like "public.json")

The user picks a saved Connection or adds one (name + secret, Keychain only). Use it in env as "connection:$settings.<key>"; $settings.<key> itself is only the name. basic stores user:password

keys kind: bearer | api_key | basic | headers, test (an action without args: the setup sheet's Test button runs it, e.g. a fetch or script that checks the key)
{
    "api": {
        "type": "connection",
        "label": "Stripe key",
        "kind": "api_key",
        "required": true,
        "test": "check_key"
    }
}

Repeatable group of simple fields

keys item (fields), min, max

API keys: Connections

An API key lives in your computer’s keychain (the Keychain on a Mac, the Secret Service keyring on Linux) as a Connection, made in Settings › Connections or in the card’s setup sheet. A card names the Connection, never the key. A fetch adds it as a header with auth; a command or script gets it in its environment.

"sources": {
  "mrr": { "fetch": "https://api.stripe.com/v1/balance", "auth": "stripe", "every": 900 },
  "deploys": { "script": "deploys.sh", "env": { "TOKEN": "connection:stripe" }, "every": 60 }
}
  • A fetch with auth still needs net:<host>, so the approval sheet shows where the key goes.
  • The kind of Connection decides the header: bearer, api_key (a header or query parameter), basic or headers. The card’s own headers can’t replace it.
  • Anything that matches a stored key is masked before it reaches state, the card, the log or an agent.
  • Let the person pick which key with a connection setting, and use "connection:$settings.<key>".
  • Connections are on computers only for now. On the iPhone, use an OAuth sign-in or a bucket.

Sign in with a provider (OAuth)

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>"

"oauth": {
    "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"
        ]
    }
},
"sources": {
  "issues": { "fetch": "https://api.linear.app/graphql", "method": "POST", "auth": "oauth:linear", "body": { "query": "{ viewer { assignedIssues { nodes { title } } } }" } }
}

Register https://tailapps.com/oauth/callback as the redirect URL with the provider.

Scripts and commands (Mac and Linux)

Shell scripts, run as /bin/sh <file> <args…> with only PATH, HOME, LANG and the declared env. The user can read each one on the approval sheet. Print JSON to stdout for sources; exit non-zero with a message on stderr to fail.

  • Scripts and CLIs run sandboxed: they can't read ~/.ssh, ~/.aws, browser data or TailApps' files, and write only to $TMPDIR, caches and files.write folders. Network: cli steps, or any net: permission or uses: sign-in. A blocked path or host fails the step with 'TailApps blocked …' and the fix
  • Max 32 KB per script
  • Tools a script can count on: curl, jq, lsof, awk, sed, screencapture, sips, caffeinate, mdfind, pbcopy, osascript

A cli source or step takes a bare binary name and an array of arguments, one element each. There is no shell: no pipes, globs, && or $VARS. For a pipeline, write a script. Every command needs a cli: permission and every script a script: one; the person can read each script on the approval sheet, and a changed script doesn’t run until it’s approved again.

"permissions": ["script:ports.sh"],
"scripts": { "ports.sh": "/usr/sbin/lsof -nP -iTCP -sTCP:LISTEN" },
"sources": {
  "listening": { "script": "ports.sh", "parse": "lines", "every": 10 }
}

Scripts and commands run only on a computer: sandboxed on a Mac, inside bubblewrap on Linux. On the iPhone, a button whose action needs one shows Needs a Mac, unless the phone routes the work to your computer. Patterns