{"id":22444584,"url":"https://github.com/jaykaycodes/airtable-typegen","last_synced_at":"2026-03-01T23:02:47.542Z","repository":{"id":65231589,"uuid":"588357429","full_name":"jaykaycodes/airtable-typegen","owner":"jaykaycodes","description":"Generate TypeScript \u0026 Zod types from your Airtable bases","archived":false,"fork":false,"pushed_at":"2024-07-24T04:38:21.000Z","size":226,"stargazers_count":29,"open_issues_count":7,"forks_count":7,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-09-22T22:29:40.912Z","etag":null,"topics":["airtable","codegen","typegen","typescript","zod"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jaykaycodes.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2023-01-12T23:28:39.000Z","updated_at":"2025-05-27T22:45:27.000Z","dependencies_parsed_at":"2025-04-19T17:24:23.638Z","dependency_job_id":"5fab0b5d-cc0e-4019-b33f-e922ec72927b","html_url":"https://github.com/jaykaycodes/airtable-typegen","commit_stats":null,"previous_names":["jaykaycodes/airtable-typegen","jkcorrea/airtable-typegen"],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jaykaycodes/airtable-typegen","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaykaycodes%2Fairtable-typegen","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaykaycodes%2Fairtable-typegen/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaykaycodes%2Fairtable-typegen/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaykaycodes%2Fairtable-typegen/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jaykaycodes","download_url":"https://codeload.github.com/jaykaycodes/airtable-typegen/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jaykaycodes%2Fairtable-typegen/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29987656,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-01T22:42:38.399Z","status":"ssl_error","status_checked_at":"2026-03-01T22:41:51.863Z","response_time":124,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["airtable","codegen","typegen","typescript","zod"],"created_at":"2024-12-06T03:08:49.797Z","updated_at":"2026-03-01T23:02:47.525Z","avatar_url":"https://github.com/jaykaycodes.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"airtable-typegen\n=================\n\nGenerate TypeScript types \u0026 [Zod](https://github.com/colinhacks/zod) schemas from your Airtable bases.\n\n[![Version](https://img.shields.io/npm/v/airtable-typegen.svg)](https://npmjs.org/package/airtable-typegen)\n[![CI](https://img.shields.io/github/actions/workflow/status/jkcorrea/airtable-typegen/ci.yml)](https://github.com/jkcorrea/airtable-typegen/actions/workflows/ci.yml)\n[![Downloads/week](https://img.shields.io/npm/dw/airtable-typegen.svg)](https://npmjs.org/package/airtable-typegen)\n[![License](https://img.shields.io/npm/l/airtable-typegen.svg)](https://github.com/jkcorrea/airtable-typegen/blob/main/package.json)\n\n\u003e :warning: **This tool is in ALPHA. It has not be thoroughly tested with Airtable bases in the wild.** Please use carefully and sanity check the generated code before using in production! Contributions \u0026 bug reports are appreciated :)\n\n\n## Quickstart\n\n```sh\n$ npm install --save-dev airtable-typegen\n# or\n$ yarn add -D airtable-typegen\n```\n\nThen generate types via:\n\n```sh\n$ airtable-typegen \u003cBASE_ID\u003e -o ./types/airtable.d.ts\n```\n\nOr generate [Zod](https://github.com/colinhacks/zod) schemas with the `-z` flag!\n\n```sh\n$ airtable-typegen \u003cBASE_ID\u003e -z -o ./src/schemas/airtable.ts\n```\n\n## Setup\n\nThe script relies on the [Airtable Meta API](https://airtable.com/api/meta), which requires an Access Token. This is different than an Airtable API key. The simplest way to get one is by creating a personal access token:\n\n1. Navigate to https://airtable.com/create/tokens\n2. Click “Create token”\n3. Enter a name (e.g. “airtable-typegen”)\n4. Give it a scope of `schema.bases:read`\n5. Give permission to your relevant bases/workspaces\n6. Copy the created token \u0026 store it in your .env as `AIRTABLE_TYPEGEN_ACCESS_TOKEN`\n\n## Usage\n\nThe command takes a list of Airtable base IDs (those of the form `appXYZ...`) and some flags. It will output a file in your current working directory depending on the flags you supply it:\n\n```\nUSAGE\n  $ airtable-typegen [BASEID] [-v] [-z] [-t \u003cvalue\u003e]\n\nARGUMENTS\n  BASEID  The Airtable Base ID (looks like appABC123XYZ). Can specify multiple.\n\nFLAGS\n  -o, --output=\u003cvalue\u003e  The file (relative to CWD) to write generated code to (defaults to \"base-name.ts\")\n  -t, --tables=\u003cvalue\u003e  A comma-separated list of tables (names or ids) to generate from (defaults to all tables)\n  -v, --version         Show CLI version.\n  -z, --zod             Generate Zod schemas instead of TypeScript definitions\n\nDESCRIPTION\n  Generate TypeScript types and/or Zod schemas from an Airtable Base.\n  Will read your Airtable API key from the AIRTABLE_TYPEGEN_ACCESS_TOKEN environment variable.\n  Reads environment from .env file if present in current working directory.\n\nEXAMPLES\n  $ airtable-typegen appABC123\n  \u003e Outputs TypeScript definitions to ./base-name.ts\n\n  $ airtable-typegen appABC123 -t MyTable,tblUOInmv7kanMKjr\n  \u003e Outputs TypeScript definitions to ./base-name.ts for the specified tables\n\n  $ airtable-typegen appABC123 -z -o ./src/schemas/airtable.ts\n  \u003e Outputs Zod schemas to ./src/schemas/airtable.ts\n```\n\n\nFor example, you could do this in your `package.json`:\n\n```json\n{\n  \"scripts\": {\n    \"generate:airtable\": \"airtable-typegen \u003cBASE_ID\u003e -z -o src/schemas/airtable.ts\",\n  }\n}\n```\n\nthen run it everytime you want to sync the types:\n\n```sh\n$ npm run generate:airtable\n```\n\nAlternatively, you could combine it into your `dev` and `build` commands (withs omething like [npm-run-all](https://github.com/mysticatea/npm-run-all), perhaps):\n\n```json\n{\n  \"scripts\": {\n    \"build\": \"run-s generate:airtable 'remix build'\",\n    \"dev\": \"run-s generate:airtable 'remix dev'\",\n    \"generate:airtable\": \"airtable-typegen \u003cBASE_ID\u003e -z -o src/schemas/airtable.ts\",\n  }\n}\n```\n\n## TODO\n- [ ] Show how types \u0026 Zod schemas can be used (currently need to parse each row individually)\n- [ ] Add a thin runtime wrapper around Airtable SDK to parse `FieldSet`s with proper types\n- [ ] Improve `example/`\n\nI probably won't work on this much until I absolutely need it. Sorry. Welcome any and all contributions!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaykaycodes%2Fairtable-typegen","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjaykaycodes%2Fairtable-typegen","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjaykaycodes%2Fairtable-typegen/lists"}