Metadata-Version: 2.4
Name: airtable-api-cli
Version: 0.1.0
Summary: Zero-dependency CLI for the Airtable REST API. Token-efficient TSV output for humans and AI agents.
Project-URL: Homepage, https://github.com/arnoldadlv/airtable-cli
Project-URL: Issues, https://github.com/arnoldadlv/airtable-cli/issues
Author: Arnold D
License-Expression: MIT
License-File: LICENSE
Keywords: agent,airtable,api,cli
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Database
Classifier: Topic :: Utilities
Requires-Python: >=3.8
Description-Content-Type: text/markdown

# airtable-cli

Zero-dependency CLI for the Airtable REST API. TSV-first output designed for humans and AI agents.

## Install

```bash
pip install airtable-api-cli
```

## Setup

Set your [Airtable Personal Access Token](https://airtable.com/create/tokens):

```bash
export AIRTABLE_PAT="pat..."
```

## Commands

### Bases & Tables

| Command | Description |
|---------|-------------|
| `airtable list-bases` | List all accessible bases |
| `airtable create-base <json>` | Create a new base (requires workspaceId) |
| `airtable list-tables <baseId>` | List tables in a base |
| `airtable create-table <baseId> <json>` | Create a new table |
| `airtable create-field <baseId> <tableId> <json>` | Create a field |
| `airtable update-field <baseId> <tableId> <fieldId> <json>` | Update a field |

### Records

| Command | Description |
|---------|-------------|
| `airtable list-records <baseId> <table> [options]` | List records |
| `airtable get-record <baseId> <table> <recordId>` | Get a single record |
| `airtable create-records <baseId> <table> <json>` | Create records |
| `airtable update-records <baseId> <table> <json>` | Update records (PATCH) |
| `airtable replace-records <baseId> <table> <json>` | Replace records (PUT) |
| `airtable delete-records <baseId> <table> <id1,id2>` | Delete records |

### Bulk & Utilities

| Command | Description |
|---------|-------------|
| `airtable bulk-create <baseId> <table> <json>` | Create any number of records (auto-batches by 10) |
| `airtable bulk-update <baseId> <table> <json>` | Update any number of records (auto-batches by 10) |
| `airtable upsert <baseId> <table> --match <field> <json>` | Create or update based on match field |
| `airtable resolve-links <baseId> <table> [--field <name>]` | Resolve linked record IDs to display values |
| `airtable export-csv <baseId> <table> [options]` | Export table to CSV |
| `airtable count <baseId> <table> [--filter '<formula>']` | Count records |
| `airtable find-duplicates <baseId> <table> --field <name>` | Find duplicate records |

## Output Formats

Default output is TSV (tab-separated values) -- compact and easy to pipe.

```bash
airtable list-records appXXX "My Table"              # TSV (default)
airtable list-records appXXX "My Table" -o json       # JSON
airtable list-records appXXX "My Table" -o csv        # CSV
```

## Query Options

For `list-records` and `export-csv`:

```bash
--filter '{Status} = "Active"'   # filterByFormula
--fields 'Name,Email'            # select specific fields
--sort 'Name:asc'                # sort (field:direction)
--max 10                         # limit records
--view 'Grid view'               # use a specific view
--all                            # auto-paginate all records
```

## Why This Exists

- **Zero dependencies** -- stdlib `urllib` only, installs anywhere Python runs
- **TSV-first** -- default output is token-efficient for LLM/agent pipelines
- **One file** -- easy to audit, vendor, or fork
