用 Rust 写了一个免费使用 ChatGPT 的命令行工具

33 天前
 inkuku

Rust写了一个免费使用 ChatGPT 的命令行工具

代码在 https://github.com/shenjinti/fgpt 🙏 star

提供了 mac 和 linux 的二进制包. 可以到 github 上自行下载

不得不说,Rust写 cli 工具还是真的好用,不管是readline或者tokioreqwest都大大减少代码量

功能:

看看简单用法


fgpt "How to get a domain's MX record on linux shell?"

# Output plain code -c/--code
fgpt -c "Write python code to reverse a string"

# With pipe
git diff | fgpt "Write a git commit bief with follow diff"

# With stdin
fgpt "Convert the follow csv data to json, without any description" < contacts.csv

2268 次点击
所在节点    分享创造
16 条回复
amorphobia
33 天前
linux 可以编译 musl libc 吗?想在某些古老的系统上使用
Vogan
33 天前
能支持代码 markdown 的高亮嘛? shell-gpt 支持
inkuku
33 天前
@amorphobia 可以的,我研究一下
inkuku
33 天前
@Vogan 安排,今天支持哈哈
molezznet
33 天前
fgpt "hello"
Error: Reqwest("builder error")
怎么排查 ……
inkuku
33 天前
@molezznet 抱歉抱歉,我们看看啥情况了这是
你 fgpt --log-level debug 看看?
macy
33 天前
能否支持自己配置 url 和 key 呢,这样就能对接到其他兼容的大模型或者企业内部私有的模型了
molezznet
33 天前
fgpt --log-level debug "hi"
2024-04-19 10:45:02 [DEBUG] cli.rs:141 - Message { role: "user", content: "hi", content_type: "text" }
Error: Reqwest("builder error")
inkuku
33 天前
@macy 暂时不支持配置 api key ,后续可以考虑支持 ollama
inkuku
33 天前
@molezznet 私信你了,➕微信我看看,看起来应该是你的 proxy 设置我们不支持
inkuku
33 天前
@molezznet 这里好像不能 DM ,加我 jinti2000 哈哈哈哈
molezznet
33 天前
@inkuku 嗯 没事啊, 我在 github issues 提吧, 方便贴东西
inkuku
32 天前
@molezznet hahah ,看到了,多谢,确认是 reqwest 没有启用 socks5 导致的,我已经修复了,可以测试看看哈哈
molezznet
32 天前
@inkuku 行了
>> 含有“笑”的词语
当然,以下是一些含有“笑”的词语:

1. 笑容 (xiào róng) - smile
2. 笑话 (xiào huà) - joke
3. 笑声 (xiào shēng) - laughter
4. 笑脸 (xiào liǎn) - smiling face
5. 笑眼 (xiào yǎn) - laughing eyes
6. 笑嘻嘻 (xiào xī xī) - smilingly
7. 笑到肚子疼 (xiào dào dù zi téng) - laughing till one's stomach hurts
8. 笑而不语 (xiào ér bù yǔ) - smile without saying a word

希望你喜欢这些词语!
royalknight
30 天前
这个会封号吗,哈哈
inkuku
30 天前
@royalknight 不会,因为没有登录注册账号的逻辑,但是需要自己翻墙

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/1033713

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX