{"id":25277935,"url":"https://github.com/transformrs/ata","last_synced_at":"2025-04-12T18:45:48.209Z","repository":{"id":65644643,"uuid":"592636503","full_name":"transformrs/ata","owner":"transformrs","description":"Ask the Terminal Anything (ATA): ChatGPT in the terminal","archived":false,"fork":false,"pushed_at":"2025-04-01T17:16:12.000Z","size":122,"stargazers_count":277,"open_issues_count":9,"forks_count":18,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-04-11T12:05:29.359Z","etag":null,"topics":["openai","openai-api","productivity","terminal-based"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/transformrs.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-01-24T07:17:34.000Z","updated_at":"2025-04-06T15:33:51.000Z","dependencies_parsed_at":"2024-01-07T21:02:08.975Z","dependency_job_id":"6e9952d7-a8a7-46dc-ab96-8a8030429266","html_url":"https://github.com/transformrs/ata","commit_stats":{"total_commits":94,"total_committers":5,"mean_commits":18.8,"dds":"0.13829787234042556","last_synced_commit":"d41d7e253a85cdc41c93adb4c265d5ec827753c4"},"previous_names":["transformrs/ata"],"tags_count":11,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transformrs%2Fata","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transformrs%2Fata/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transformrs%2Fata/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/transformrs%2Fata/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/transformrs","download_url":"https://codeload.github.com/transformrs/ata/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248617423,"owners_count":21134190,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["openai","openai-api","productivity","terminal-based"],"created_at":"2025-02-12T17:01:58.785Z","updated_at":"2025-04-12T18:45:48.186Z","avatar_url":"https://github.com/transformrs.png","language":"Rust","funding_links":[],"categories":["\u003ca name=\"ai\"\u003e\u003c/a\u003eAI / ChatGPT","Rust"],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003ccode\u003etrf\u003c/code\u003e: Multimodal AI in the terminal\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003eSupports OpenAI, DeepInfra, Google, Hyperbolic, and others\u003c/h3\u003e\n\n## Examples\n\n- [Chat](#chat-in-bash)\n- [Text to Speech](#text-to-speech-in-bash)\n\n### Chat in Bash\n\nWe can chat straight from the command line.\nFor example, via the DeepInfra API:\n\n```sh\n$ DEEPINFRA_KEY=\"\u003cKEY\u003e\"; echo \"hi there\" | trf chat\n```\n\nThis defaults to the `meta-llama/Llama-3.3-70B-Instruct` model.\nWe can also create a Bash script to provide some default settings to the chat.\nFor example, create a file called `chat.sh` with the following content:\n\n```bash\n#!/usr/bin/env bash\n\nexport OPENAI_KEY=\"$(cat /path/to/key)\"\n\ntrf chat --model=\"gpt-4o\"\n```\n\nand add it to your PATH.\nNow, we can use it like this:\n\n```sh\n$ echo \"This is a test. Respond with 'hello'.\" | trf chat\nhello\n```\n\nOr we can run a spellcheck on a file:\n\n```sh\n$ echo \"Do you see spelling errors in the following text?\"; cat myfile.txt | trf chat\n```\n\nHere is a more complex example.\nFor example, create a file called `writing-tips.sh` with the following content:\n\n```bash\n#!/usr/bin/env bash\nset -euo pipefail\n\nexport DEEPINFRA_KEY=\"$(cat /path/to/key)\"\n\nPROMPT=\"\nYou are a helpful writing assistant.\nRespond with a few suggestions for improving the text.\nUse plain text only; no markdown.\n\nHere is the text to check:\n\n\"\nMODEL=\"deepseek-ai/DeepSeek-R1-Distill-Llama-70B\"\n\n(echo \"$PROMPT\"; cat README.md) | trf chat --model=\"$MODEL\"\n```\n\n### Text to Speech in Bash\n\nWe can read a file out loud from the command line.\nFor example, with the OpenAI API:\n\n```sh\n$ OPENAI_KEY=\"$(cat /path/to/key)\"; cat myfile.txt | trf tts | vlc - --intf dummy\n```\n\nHere, we set the key, print the file `myfile.txt` to stdout, pipe it to `trf` to generate mp3 audio, and pipe that to `vlc` to play it.\nThe `--intf dummy` is optional; it just prevents `vlc` from opening a GUI.\n\nOne way to make this easier to use is to create a Bash script that sets the environment variable and runs the command.\nFor example, create a file called `spk.sh` (abbreviation for \"speak\") with the following content:\n\n```bash\n#!/usr/bin/env bash\n\n# Exit on (pipe) errors.\nset -euo pipefail\n\nexport OPENAI_KEY=\"$(cat /path/to/key)\"\n\ntrf tts | vlc - --intf dummy\n```\n\nAfter adding `spk.sh` to your PATH, you can use it like this:\n\n```sh\n$ cat myfile.txt | spk\n```\n\n### Other Text to Speech Commands\n\n```sh\n$ DEEPINFRA_KEY=\"$(cat /path/to/key)\"; cat myfile.txt | trf tts | vlc -\n```\n\n```sh\n$ DEEPINFRA_KEY=\"$(cat /path/to/key)\"; cat myfile.txt | trf tts --output myfile.mp3\n```\n\n## Philosophy\n\nThe philosophy of this project is mainly to not handle state.\nLike curl or ffmpeg, this should make it easier to use in scripts and to share examples online.\nSettings are done via command line arguments and environment variables.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransformrs%2Fata","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftransformrs%2Fata","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftransformrs%2Fata/lists"}