Rust Airtable Utility (rau)
  • Rust Airtable Utility (RAU) Documentation
Powered by GitBook
On this page
  • Features
  • Installation
  • Configuration
  • Usage

Rust Airtable Utility (RAU) Documentation

Last updated 12 months ago

Welcome to the Rust Airtable Utility (RAU) documentation. RAU is a command-line utility written in Rust that allows you to interact with the Airtable API. This utility enables you to query, create, and update records in your Airtable bases seamlessly. Below is the detailed documentation for using RAU effectively.

Features

  • Query Records: Retrieve records and their field values by record ID or query parameters.

  • Create Records: Generate new records with specified field values.

  • Update Records: Modify existing records by updating field values.

  • Cache Management: Locally cache available fields for faster subsequent requests.

  • Schema and Fields Output: Display the table schema or available fields for reference.

  • Recent Records: List the 100 most recent record IDs and their names for quick access.

  • Configuration: Easily manage multiple Airtable bases and tables through a config.toml file.

  • Secure API Key Handling: Store your API key securely using environment variables.

Installation

  1. Clone the Repository:

    git clone https://github.com/njfio/rau.git
  2. Navigate to the Project Directory:

    cd rau
  3. Build the Project:

    cargo build

Configuration

  1. Create a Configuration File (config.toml): Place a config.toml file in the root directory of your project.

  2. Define Airtable Configurations: In config.toml, specify your Airtable bases and tables as shown below:

    toml[tables]tweets = { base_id = "appEo7LBNoYQRwEc0", table_name = "Table1" }pokemons = { base_id = "app2jJgrXCQirseg5", table_name = "Pokemon" }prompts = { base_id = "appzdA0NkqZ7JYMeP", table_name = "Prompt PreSet" }
  3. Set Your API Key: Add your Airtable API key to config.toml or use an environment variable:

    • Directly in config.toml:

      tomlapi_key = "YOUR_AIRTABLE_API_KEY"
    • Environment Variable:

      bashexport AIRTABLE_API_KEY="YOUR_AIRTABLE_API_KEY"

Usage

To use RAU, follow the command template below:

bashrau <config_name> [record_id] [fields] [options]

Arguments:

  • <config_name>: The name of the configuration from your config.toml file.

  • [record_id] (optional): The ID of the record to interact with.

  • [fields] (optional): A list of fields to update or query, specified in key=value format.

Options:

  • -s, --schema: Output the table schema.

  • -f, --fields: Output the available fields for the table.

  • -r, --recent: Output the 100 most recent record IDs and their names.

Examples:

  • Query all fields of a record:

    bashrau tweets rec123
  • Query specific fields of a record:

    bashrau tweets rec123 Name Content
  • Update a record:

    bashrau tweets rec123 Name="Updated Name" Content="New content"
  • Create a new record:

    bashrau tweets
  • Output the schema:

    bashrau tweets --schema
  • Output available fields:

    bashrau tweets --fields
  • Output recent records:

    bashrau tweets --recent

RAU is a powerful CLI tool that simplifies your interaction with Airtable. For advanced usage and further customization, refer to the source code and additional documentation provided in the repository.

Additional Information

Releases:

Dependencies:

  • The RAU project has various dependencies, such as reqwest, serde, clap, config, tokio, rustyline, lazy_static, and more. These dependencies help in the utility's functionality and development.

Install Rust: If you haven't installed Rust yet, you can download it from .

The latest release for the RAU project is version 0.1.0. You can find more details about this release on the .

here
Releases page