#artificial-intelligence #productivity #automation #suggestions #input-file #cli #file-format

app traiy_cli

An utility to serve AI suggestions according to user-provided guidelines and (optionally) context

5 releases

Uses new Rust 2024

0.0.12 May 25, 2025
0.0.11 May 21, 2025
0.0.10 May 18, 2025
0.0.9 May 10, 2025
0.0.7 May 7, 2025

#437 in Parser implementations

MIT license

61KB
648 lines

Traiy CLI: Your AI-Powered Productivity Assistant πŸ› οΈ

Crates.io License Rust Docs.rs

Traiy CLI (traiy_cli) is a tool that leverages the power of Large Language Models (LLMs) to provide insightful recommendations for enhancing documents via CLI, based on specific guidelines and optional context.

NOTE: Right now, traiy features only a CLI interface. However, a TUI is coming soon i.e. tray_tui crate.

It's designed to streamline the process of improving your content i.e. input file, by offering targeted suggestions for anything you want focus on i.e. guidelines while also (optionally) considering your own custom information i.e. context.

What's New?

  • New Google Gemini Models updated: Updated to some latest 2.5 models.
  • Revamps: Now traiy supports automatic revamps, which are "deeper" than recommendations.
  • New OpenAI Models: Added support for the openai-4o mini and openai-4.1 nano models.
  • Enhanced CLI Readme: Improved the README for the CLI.

Features ✨

  • LLM-Powered Recommendations: Utilizes advanced LLMs to analyze your input.
  • Guideline-Driven Analysis: Provides recommendations based on a set of user-defined guidelines.
  • Optional Context Integration: Allows you to provide additional context to influence the recommendations.
  • CSV Input: Accepts input, guidelines, and context in CSV file format.
  • Markdown Output: Generates recommendations in a clear and structured Markdown format.
  • Configurable LLM: Supports specifying the LLM provider and model (currently Google Gemini Flash 2 and 2.5 Preview and OpenAI 4.1 nano and 4o mini).
  • Customizable Parameters: Allows setting maximum output tokens and temperature for the LLM.
  • Simple Logging: Provides informative logging output using the simple_logger crate.

Installation βš™οΈ

To use Traiy CLI, you need to have Rust and Cargo installed on your system. You can install Traiy from crates.io:

cargo install traiy_cli

Usage πŸš€

Here's a basic usage example.

Supposse you have the following file:

input.csv Hey! Just push the pedals, like in motion, one after the other; I mean you can't push both at the same time, but at the same time you can! Speaking of 'at the same time', you must not all, do your thing. So: steer well, push, look up, ride. Oh, and beware of your sorroundings.Easy right?

Hey, those seem like hard to follow instructions for a toddler, right?

Let's use traiy to make it better. First, let's create the guideline:

guideline.csv Explain clearly but friendly how to ride a bike to my son.

For sure, the AI doesn't know my son, so let's create another file:

guideline.csv My kid's name is Jimmy. His bike is called Rocket and it's red. The neighborhood is hilly: ups and downs.

Now, to see traiy in action, just hit in terminal:

LLM_API_KEY=<yours> traiy_cli recommend -i /path_to_/input.csv -g /path_to_/guideline.csv -c /path_to_/context.csv -l google -m gemini-2.0-flash

Wait a couple of seconds, and you will see traiy's output at a new folder, called similar to the input file i.e. input_traiy.

And just like that, you have the best recommendations on how to enhance your input file i.e. better instructions on how to teach Jimmy how to ride a bike.

Here's how such recommendations might look like:

  1. Use a more encouraging and less confusing tone
  • Justification: The original text might be confusing for a child, especially the part about pushing pedals "at the same time." A more encouraging and clear tone will help Jimmy feel more confident.
  • Type: Recommendation
  • Original text snippet: "Just push the pedals, like in motion, one after the other; I mean you can't push both at the same time, but at the same time you can!"
  • Refactor: "Hey Jimmy! Remember Rocket? Let's make it fly! Just push the pedals, one after the other, to make the wheels spin."
  1. Incorporate Jimmy's name and the bike's name to make it more personal
  • Justification: Using Jimmy's name and his bike's name will make the instructions more personal and engaging for him.
  • Type: Recommendation
  • Original text snippet: "So: steer well, push, look up, ride."
  • Refactor: "So: steer Rocket well, push the pedals, look up and enjoy the ride, Jimmy!"
  1. Address the hilly neighborhood and potential challenges
  • Justification: Acknowledging the hills and providing advice on how to handle them will prepare Jimmy for the actual riding conditions in his neighborhood.
  • Type: Recommendation
  • Original text snippet: "Oh, beware of your sorroundings."
  • Refactor: "Oh, and Jimmy, because our neighborhood has ups and downs, remember to be extra careful. Use the brakes to go slowly downhill and pedal harder to go uphill. You got this!"

Remember to hit 'traiy --help' to see more options.

traiy --help

About input files πŸ“„

Traiy expects CSV files for input, guidelines, and context. If you have files in other formats i.e. *.docx, *.pdf, *.xlsx, etc, convert them to csv as well and use them as you see fit.

About Output πŸ“€

Traiy generates a new directory (named based on the input file name) in the same directory as the input file. This directory contains one Markdown file showing recommendations. You can do whatever you like with these files: edit the recommendations, accept them as they are, etc.

Roadmap πŸ—ΊοΈ

Here are some planned features and improvements for Traiy:

  • Support for subcommands (more functionality): Recommend and Enhance (not yet implmented).
  • Support for more input file formats: Expand beyond CSV to include formats like plain text, JSON, etc.
  • More LLM Backends: Integrate support for other popular LLM providers like OpenAI (some implemented), Anthropic and others.
  • Structured Output Options: Allow users to choose different output formats (e.g., JSON).
  • Function calling options: Allow users to set up their own custom tools

Contributing 🀝

Contributions to Traiy are welcome! Please feel free to submit pull requests or open issues for bug fixes, feature requests, or general discussions.

License πŸ“œ

This project is licensed under the MIT License

Dependencies

~12–25MB
~364K SLoC