{"id":13645517,"url":"https://github.com/aesthetikx/openai_pipe","last_synced_at":"2025-04-05T09:10:19.841Z","repository":{"id":65063890,"uuid":"581621643","full_name":"Aesthetikx/openai_pipe","owner":"Aesthetikx","description":"A UNIX-ey interface to OpenAI","archived":false,"fork":false,"pushed_at":"2024-06-02T20:19:27.000Z","size":24,"stargazers_count":195,"open_issues_count":4,"forks_count":13,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-29T08:09:53.205Z","etag":null,"topics":["openai","ruby"],"latest_commit_sha":null,"homepage":"","language":"Ruby","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/Aesthetikx.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.txt","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":"2022-12-23T18:38:44.000Z","updated_at":"2025-03-23T09:16:47.000Z","dependencies_parsed_at":"2024-08-02T01:38:28.236Z","dependency_job_id":null,"html_url":"https://github.com/Aesthetikx/openai_pipe","commit_stats":{"total_commits":20,"total_committers":2,"mean_commits":10.0,"dds":"0.050000000000000044","last_synced_commit":"9ee451835e16bae21dd7e35ae411a2d78d62369b"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aesthetikx%2Fopenai_pipe","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aesthetikx%2Fopenai_pipe/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aesthetikx%2Fopenai_pipe/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Aesthetikx%2Fopenai_pipe/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Aesthetikx","download_url":"https://codeload.github.com/Aesthetikx/openai_pipe/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247312085,"owners_count":20918344,"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","ruby"],"created_at":"2024-08-02T01:02:36.333Z","updated_at":"2025-04-05T09:10:19.379Z","avatar_url":"https://github.com/Aesthetikx.png","language":"Ruby","funding_links":[],"categories":["Openai"],"sub_categories":[],"readme":"# OpenAIPipe\n\nThis library provides a UNIX-ey interface to OpenAI.\nSee [Installation](#installation) and [Setup](#setup) below, but first, some examples.\n\n## Examples\n\n```console\n$ ai what is two plus two\nTwo plus two is equal to four.\n```\n\n```console\n$ uptime | ai convert this to json\n{\n        \"time_of_measurement\": \"13:48:26\",\n        \"up_time\": \"30 days, 18:07\",\n        \"users\": 3,\n        \"load_average\": [\n                0.46,\n                0.61,\n                0.79\n        ]\n}\n```\n\n```console\n$ ai list the nine planets as JSON | ai convert this to XML but in French | tee planets.fr.xml\n\u003cPlanètes\u003e\n   \u003cPlanète\u003eMercure\u003c/Planète\u003e\n   \u003cPlanète\u003eVénus\u003c/Planète\u003e\n   \u003cPlanète\u003eLa Terre\u003c/Planète\u003e\n   \u003cPlanète\u003eMars\u003c/Planète\u003e\n   \u003cPlanète\u003eJupiter\u003c/Planète\u003e\n   \u003cPlanète\u003eSaturne\u003c/Planète\u003e\n   \u003cPlanète\u003eUranus\u003c/Planète\u003e\n   \u003cPlanète\u003eNeptune\u003c/Planète\u003e\n   \u003cPlanète\u003ePluton\u003c/Planète\u003e\n\u003c/Planètes\u003e\n```\n\n```console\n$ curl -sL \"https://en.wikipedia.org/wiki/cats\" | head -n 5 | ai extract just the title of this webpage | figlet\n  ____      _            __        ___ _    _                _ _\n / ___|__ _| |_          \\ \\      / (_) | _(_)_ __   ___  __| (_) __ _\n| |   / _` | __|  _____   \\ \\ /\\ / /| | |/ / | '_ \\ / _ \\/ _` | |/ _` |\n| |__| (_| | |_  |_____|   \\ V  V / | |   \u003c| | |_) |  __/ (_| | | (_| |\n \\____\\__,_|\\__|            \\_/\\_/  |_|_|\\_\\_| .__/ \\___|\\__,_|_|\\__,_|\n                                             |_|\n```\n\n```console\n$ ls | ai What is this directory for?\nThis directory contains the source code for a Ruby-based project called openai_pipe. It includes files related to the project's license (LICENSE.txt), changelog (CHANGELOG.md), dependencies (Gemfile and Gemfile.lock), executables (bin and exe), libraries (lib), signature (sig) and tests (spec). There is also a Rakefile and a README.md file which provide information about how to build and install the project, as well as its features and usage. Finally, it includes the openai_pipe-0.1.0.gem and openai_pipe.gemspec files which are used to build the gem which can be installed on other systems.\n```\n\n```console\n$ ls -l | ai which of these are directories?\nbin, exe, lib, sig, spec\n```\n\n```console\n$ ls | ai \"For each of these files, provide a description of what is likely to be their contents?\"\nbin - Likely contains compiled binary executable files.\nCHANGELOG.md - Likely contains a log of changes/modifications, such as bug fixes and new features, that have been made to the project.\nexe - Likely contains executable files.\nfrench_planets.xml - Likely contains an XML file containing data related to planets, likely in French.\nGemfile - Likely contains Ruby code for the project's dependencies.\nGemfile.lock - Likely contains a snapshot of the dependencies of the project and versions of those dependencies.\nlib - Likely contains the Ruby source code (e.g. classes and modules) for the project.\nLICENSE.txt - Likely contains the terms of use/license for the project.\nopenai_pipe-0.1.0.gem - Likely contains a gem that gathers information from the OpenAI API.\nopenai_pipe.gemspec - Likely contains configuration details for the gem.\nplanets.lst - Likely contains a list of planets.\npoem.txt - Likely contains a text file containing a poem.\nRakefile - Likely contains Ruby tasks and dependencies that can be used in projects.\nREADME.md - Likely contains general information about the project and usage instructions.\nreverse.lst - Likely contains a list of words or items that are in reverse order.\nsig - Likely contains digital signatures to validate individual files.\nspec - Likely contains Ruby specs (i.e. tests) for the project.\nuptime.json - Likely contains a file with information regarding system uptime of a computer.\n```\n\n```console\n$ git commit -m \"$(git status | ai write me a commit message for these changes)\"\n[master 7d0271f] Add new files and modify README.md\n```\n\n```console\n$ git status | tee /dev/tty | ai write me a sonnet about the status of this git repository\nOn branch master\nUntracked files:\n  (use \"git add \u003cfile\u003e...\" to include in what will be committed)\n        openai_pipe-0.1.0.gem\n\nnothing added to commit but untracked files present (use \"git add\" to track)\n\nMy master branch may lack to thee its kin\nFor change it holds the only force within\nThé untracked files, they still remain unnamed\n‘Tis fervent hope thé change will soon be claimed\n\nFraught with the choice to leave or to persist\nThe repository wavers ‘tween future and past\nThe openai_pipe-0.1.0 gem stands out\nWaiting to be added, not yet about\n\nThe commit awaits for brave new changes bold\nWhile time’s old force is ever unfurled\nCommit forth young mind, furrow not to crawl\nFrom untracked files, a future stands tall.\n```\n\n```console\n% history | ai what was the last thing I did\nThe last command you entered was 'history'.\n```\nn.b. somehow it sees history-esque output and determines that history was typed -- the history command does not itself include the history command in the output.\n\n```console\n$ history | ai what was the last thing I did before typing history\nThe last thing you did was amend a README.md file.\n```\nn.b. here it determines the amend was for README.md not from the previous command but from ones prior that edited README.md.\n\n```console\n$ cat lib/openai_pipe/version.rb | ai rewrite this file with just the minor version incremented | sponge \u003e lib/openai_pipe/version.rb\n$ git diff\ndiff --git a/lib/openai_pipe/version.rb b/lib/openai_pipe/version.rb\nindex 0f82357..cc57fab 100644\n--- a/lib/openai_pipe/version.rb\n+++ b/lib/openai_pipe/version.rb\n@@ -1,5 +1,5 @@\n # frozen_string_literal: true\n\n module OpenAIPipe\n-  VERSION = \"0.1.0\"\n+  VERSION = \"0.1.1\"\n end\n```\n\n```console\n$ ruby -e \"$(ai write me a python script that prints the current month | ai translate this into ruby)\" | ai translate this into French\nLe mois courant est Décembre.\n```\n\n## Installation\n\nInstall the gem by executing:\n\n    $ gem install openai_pipe\n\n## Setup\n\nThis library uses [quick_openai](https://github.com/Aesthetikx/quick_openai) which itself uses [ruby-openai](https://github.com/alexrudall/ruby-openai), so you may want to familiarise yourself with those projects first.\n\nThis library uses OpenAI GPT3 to generate responses, so you will need to have your access token available in ENV. In .bashrc or equivalent,\n```bash\nexport OPENAI_ACCESS_TOKEN=mytoken\n```\n\nBy default the executable is called `openai_pipe`. It is reccommended to alias this command to something shorter in .bashrc or equivalent, e.g.\n```bash\nalias ai=\"openai_pipe\"\n```\n\n## Notes\n\nBe aware that there is a cost associated every time GPT3 is invoked, so be mindful of your account usage. Also be wary of sending sensitive data to OpenAI, and also wary of arbitrarily executing scripts or programs that GPT3 generates.\n\n## Development\n\nAfter checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.\n\nTo install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at https://github.com/Aesthetikx/openai_pipe.\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](https://opensource.org/licenses/MIT).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faesthetikx%2Fopenai_pipe","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faesthetikx%2Fopenai_pipe","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faesthetikx%2Fopenai_pipe/lists"}