百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
O

openai_pipe

> AI 编程
开源

一个用于 OpenAI 的 UNIX 界面

196 stars0 点赞2 次浏览
访问官网GitHub

工具介绍

一个用于 OpenAI 的 UNIX 界面

OpenAIPipe

This library provides a UNIX-ey interface to OpenAI. See Installation and Setup below, but first, some examples.

Examples

bash
$ ai what is two plus two
Two plus two is equal to four.
bash
$ uptime | ai convert this to json
{
        "time_of_measurement": "13:48:26",
        "up_time": "30 days, 18:07",
        "users": 3,
        "load_average": [
                0.46,
                0.61,
                0.79
        ]
}
bash
$ ai list the nine planets as JSON | ai convert this to XML but in French | tee planets.fr.xml

   Mercure
   Vénus
   La Terre
   Mars
   Jupiter
   Saturne
   Uranus
   Neptune
   Pluton
…
bash
% history | ai what was the last thing I did
The last command you entered was 'history'.

n.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.

bash
$ history | ai what was the last thing I did before typing history
The last thing you did was amend a README.md file.

n.b. here it determines the amend was for README.md not from the previous command but from ones prior that edited README.md.

bash
$ cat lib/openai_pipe/version.rb | ai rewrite this file with just the minor version incremented | sponge > lib/openai_pipe/version.rb
$ git diff
diff --git a/lib/openai_pipe/version.rb b/lib/openai_pipe/version.rb
index 0f82357..cc57fab 100644
--- a/lib/openai_pipe/version.rb
+++ b/lib/openai_pipe/version.rb
@@ -1,5 +1,5 @@
 # frozen_string_literal: true

 module OpenAIPipe
-  VERSION = "0.1.0"
+  VERSION = "0.1.1"
 end
bash
$ ruby -e "$(ai write me a python script that prints the current month | ai translate this into ruby)" | ai translate this into French
Le mois courant est Décembre.

Installation

Install the gem by executing:

$ gem install openai_pipe

Setup

This library uses quick_openai which itself uses ruby-openai, so you may want to familiarise yourself with those projects first.

This library uses OpenAI GPT3 to generate responses, so you will need to have your access token available in ENV. In .bashrc or equivalent,

bash
export OPENAI_ACCESS_TOKEN=mytoken

By default the executable is called openai_pipe. It is reccommended to alias this command to something shorter in .bashrc or equivalent, e.g.

bash
alias ai="openai_pipe"

Notes

Be 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.

Development

After 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.

To 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.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/Aesthetikx/openai_pipe.

License

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

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Rubyopenairuby

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月18日
分类AI 编程
定价开源

> 相关工具

G
GitHub Copilot
GitHub 官方 AI 编程助手,覆盖补全、Chat 与 Agent 模式。
C
Cursor
AI 原生代码编辑器,对话改代码、多文件 Agent 与规则体系是其核心。
S
skills
Skills for Real Engineers. Straight from my .agents directory.