Skip to main content
Mirage’s built-in client for the Airtable Web API. The Airtable mount reads bases as files; a record write is not a file write, so writes go through this CLI, which also reaches what a file cannot: server-side filters, one record by id, and comments. The command tree is discoverable with airtable --help.

Install

The CLI takes the mount’s own config: token, baseIds, baseUrl, maxReadRecords and requestsPerSecond. Two installs under different names are two accounts. In YAML, the same install rides the clis: section; see the CLI overview. Reads need the mount’s scopes (data.records:read, schema.bases:read); writes add data.records:write, and comments data.recordComments:read and data.recordComments:write. See Airtable Setup.

Ids

Every verb below a base names it with --base and its table with --table. Take the ids from the mount’s directory names, after the last __, and a record’s from its record_id:
--table and table get also take the table’s name.

Reads

--formula is Airtable’s filterByFormula and --view takes a view id or name, so both filter on the server. record list is bounded like the mount: without --max-records it asks for max_read_records + 1 records and, if that many come back, fails (exit 1) rather than paging the rest of the table. An explicit --max-records N is honored as asked.

Writes

Without that single-record form, record create, update and delete read JSONL from stdin, one records.jsonl line per record, so a mount read edited with jq pipes straight back:
  • A line may hold only record_id, created_time and fields. Any other key, a line that is not an object, or a fields that is not an object is a usage error naming the 1-based line, and every line is checked before the first request.
  • Computed fields (formula, rollup, lookup, count, autonumber, created and modified time or by, button, AI text, sync source) are dropped from a stdin line, because a mount line carries them and Airtable refuses a write to one. --fields is sent as given.
  • Writes go ten records to a request, Airtable’s limit. update is a PATCH, so a field a line leaves out keeps its value. If a later request fails, the records the earlier ones wrote are still printed, with the error on stderr and exit 1.
  • --typecast lets Airtable convert string values to the field types.
  • comment add takes --text or the text on stdin, with one trailing newline stripped: echo "Ship it" | airtable comment add ... RECORD.

Errors

The airtable <verb>: prefix is the head word the CLI was installed under, so a second install under another name refuses in that name. A refusal the verb decides itself (bad --fields, a bad stdin line) prints its message alone, the way the gh and ntn CLIs do; one the argument parser decides (a missing required flag) keeps the parser’s prefix and --help hint. Requests are paced per base at requests_per_second. A read retries a 429, 502 or 503; a write retries only a 429 for the rate limit, after Airtable’s 30 second penalty, since a write answered 502 or 503 may have landed.