Skip to content

xavman6/airtable-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Airtable CLI

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

Installation

  1. Clone this repository
  2. Install dependencies:
npm install
  1. Create a .env file with your Airtable credentials (copy from .env.example)
  2. Make the script executable:
chmod +x index.js
  1. Link the package globally (optional):
npm link

Configuration

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.

Usage

List Tables

airtable-cli list-tables

Options:

  • -b, --base <base>: Override the Airtable Base ID from the environment variable

List Records

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

Create Record

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

Update Record

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

Delete Record

airtable-cli delete-record <table> <recordId>

Options:

  • -b, --base <base>: Override the Airtable Base ID

Examples

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

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors