import json, subprocess, os
PAT = open('/tmp/pat.txt').read().strip()
BASE = 'appE43UvTyARe5oJs'

# Find Actions table — list tables first
env = os.environ.copy()
r = subprocess.run([
    'curl', '-sS',
    f'https://api.airtable.com/v0/meta/bases/{BASE}/tables',
    '-H', f'Authorization: Bearer {PAT}',
], capture_output=True, text=True, env=env)
data = json.loads(r.stdout)
for t in data.get('tables', []):
    if 'action' in t['name'].lower() or 'follow' in t['name'].lower():
        print(t['id'], t['name'], t.get('fields', [{}])[0].get('name', ''))
print("---ALL TABLES---")
for t in data.get('tables', []):
    print(t['id'], t['name'])