Skip to content

Quick Start with Template

Clone the pre-configured Airtable template to get a base with the correct field structure and sample data.

Clone Airtable Template

TIP

After cloning, edit the data and run huh pull.


Airtable Base/Table Setup

Creating a New Base

  1. Log in to Airtable.
  2. Select Add a base > Start from scratch.
  3. Name the base (e.g., Error Content).

Field (Column) Structure

Create the following fields in your table:

Field NameField TypeRequiredDescription
trackIdSingle line textYesUnique error identifier (e.g., ERR_LOGIN_001)
typeSingle selectYesTOAST, MODAL, PAGE, or custom type
messageLong textYesError message. Supports template variables
titleSingle line textOptionalError title (used for modal, page)
imageURL or Single line textOptionalError image URL
severitySingle selectOptionalINFO, WARNING, ERROR, CRITICAL, or custom severity
actionLabelSingle line textOptionalAction button text
actionTypeSingle selectOptionalREDIRECT, RETRY, BACK, DISMISS, or custom action
actionTargetURL or Single line textOptionalURL to navigate to for REDIRECT

TIP

Adding TOAST, MODAL, PAGE, etc. as Single select options for the type field helps prevent input mistakes. The same applies to severity (INFO, WARNING, ERROR, CRITICAL) and actionType. Custom types can also be added as options. Even if entered in lowercase, the CLI will automatically convert them to uppercase.

Example Data

trackIdtypemessagetitleseverityactionLabelactionTypeactionTarget
ERR_LOGIN_001TOASTLogin failed. Please try again.WARNINGRetryRETRY
ERR_PAYMENT_001MODALAn error occurred during payment processing.Payment ErrorERRORContact SupportREDIRECT/support
ERR_NOT_FOUNDPAGEThe page you requested could not be found.Page Not FoundINFOGo HomeREDIRECT/
ERR_NETWORKTOASTPlease check your network connection.WARNINGTry AgainRETRY

Personal Access Token

  1. Go to the Airtable token page.
  2. Click Create new token.
  3. Enter a token name (e.g., huh-cli).
  4. Under Scopes, select data.records:read.
  5. Under Access, select the relevant base.
  6. Click Create token and copy the token.

WARNING

The token is shown only once. Store it in a safe place.

Finding the Base ID and Table ID

  1. Open the relevant base in Airtable.
  2. Find them in the browser URL:
    https://airtable.com/appXXXXXXXXXXXXXX/tblYYYYYYYYYYYYYY/...
                         ^^^^^^^^^^^^^^^^^^^  ^^^^^^^^^^^^^^^^^^^
                         Base ID              Table ID

Configuration

bash

.huh.config.json Example

json
{
  "source": {
    "type": "airtable",
    "baseId": "appXXXXXXXXXXXXXX",
    "tableId": "tblYYYYYYYYYYYYYY"
  },
  "output": "./src/huh.json"
}

To specify the token directly in the config:

json
{
  "source": {
    "type": "airtable",
    "baseId": "appXXXXXXXXXXXXXX",
    "tableId": "tblYYYYYYYYYYYYYY",
    "token": "patXXXXXXXXXXXXXX"
  },
  "output": "./src/huh.json"
}

WARNING

If you include the token directly in the config file, add .huh.config.json to your .gitignore.

Fetching Data

bash

If successful, a JSON file will be generated at the output path.

Released under the MIT License.