Rust Airtable Utility (RAU) Documentation

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
Install Rust: If you haven't installed Rust yet, you can download it from here.
Clone the Repository:
git clone https://github.com/njfio/rau.git
Navigate to the Project Directory:
cd rau
Build the Project:
cargo build
Configuration
Create a Configuration File (
config.toml
): Place aconfig.toml
file in the root directory of your project.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" }
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 yourconfig.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:
The latest release for the RAU project is version 0.1.0. You can find more details about this release on the Releases page.
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.
Last updated