A command-line interface tool for interacting with Airtable bases. This CLI allows you to:
- List tables in a base
- List records from a table
- Create new records
- Update existing records
- Delete records
- Clone this repository
- Install dependencies:
npm install
- Create a
.envfile with your Airtable credentials (copy from.env.example) - Make the script executable:
chmod +x index.js
- Link the package globally (optional):
npm link
Create a .env file with the following variables:
AIRTABLE_API_KEY=your_api_key
AIRTABLE_BASE_ID=your_base_id
You can find your API key in your Airtable account settings, and the Base ID in the API documentation for your base.
airtable-cli list-tables
Options:
-b, --base <base>: Override the Airtable Base ID from the environment variable
airtable-cli list-records <table>
Options:
-b, --base <base>: Override the Airtable Base ID-m, --max-records <number>: Maximum number of records to return (default: 100)-v, --view <view>: Specific view to use-f, --fields <fields>: Comma-separated list of field names to include
airtable-cli create-record <table> --fields '{"Field1": "Value1", "Field2": "Value2"}'
Options:
-b, --base <base>: Override the Airtable Base ID-f, --fields <fields>: JSON string of fields and values
airtable-cli update-record <table> <recordId> --fields '{"Field1": "NewValue1"}'
Options:
-b, --base <base>: Override the Airtable Base ID-f, --fields <fields>: JSON string of fields and values to update
airtable-cli delete-record <table> <recordId>
Options:
-b, --base <base>: Override the Airtable Base ID
List records from a table called "Tasks":
airtable-cli list-records Tasks
Create a new record:
airtable-cli create-record Tasks --fields '{"Name": "New Task", "Status": "Not Started", "Due Date": "2025-06-01"}'
Update a record:
airtable-cli update-record Tasks rec123456789 --fields '{"Status": "Completed"}'
Delete a record:
airtable-cli delete-record Tasks rec123456789
MIT