Skip to content

A command-line tool designed to format, clean up and structure text files based on predefined formatting guidelines.

License

Notifications You must be signed in to change notification settings

wuletawwonte/tfhelps

Repository files navigation

TFHelps

Gem Version

TFHelps is a command-line tool designed to format text files professionally and efficiently. Built primarily for Helps Ministries, it uses the Gemini API to clean up and structure text based on predefined formatting guidelines. This tool is ideal for anyone looking to automate the process of making text more readable and polished.

Installation

Run this command to install the gem:

gem install tfhelps

Usage

Prerequisites

Before using TFHelps, you need to obtain an API key from Google's AI Studio. Follow these steps:

  1. Visit Google AI Studio and sign in with your Google account.
  2. Generate an API key (free or paid, depending on your usage needs).
  3. Store the API key in your environment variables with the key GEMINI_API_KEY. To achieve that, add the following line to your .bashrc, .zshrc, or equivalent shell configuration file:
export GEMINI_API_KEY="your_api_key_here"
  1. Restart your terminal or run source ~/.bashrc (or equivalent) to apply the changes.

Running the Tool

Process a single text file:

tfhelps path/to/your/textfile.txt

Output: Overwrites textfile.txt with the formatted content

Process all .txt files in a directory:

tfhelps path/to/your/text_files/

Creates an output/ directory with formatted versions of all files

Custom output directory (optional):

tfhelps path/to/files/ --output-dir custom_output

Formatting Guidelines

TFHelps follows these rules to format your text:

  1. Combine sentences into a single paragraph if they are separated by a single empty line.
  2. Create a new paragraph whenever there are two or more empty lines separating the text.
  3. Ensure proper spacing, punctuation, and capitalization throughout the text.
  4. Maintain a clean and polished format suitable for professional use.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/wuletawwonte/tfhelps. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the code of conduct.

License

The gem is available as open source under the terms of the MIT License.

Code of Conduct

Everyone interacting in the Tfhelps project's codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.

About

A command-line tool designed to format, clean up and structure text files based on predefined formatting guidelines.

Resources

License

Code of conduct

Stars

Watchers

Forks

Packages

No packages published