ChatGPT 命令行版 - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
推荐学习书目
Learn Python the Hard Way
Python Sites
PyPI - Python Package Index
http://diveintopython.org/toc/index.html
Pocoo
值得关注的项目
PyPy
Celery
Jinja2
Read the Docs
gevent
pyenv
virtualenv
Stackless Python
Beautiful Soup
结巴中文分词
Green Unicorn
Sentry
Shovel
Pyflakes
pytest
Python 编程
pep8 Checker
Styles
PEP 8
Google Python Style Guide
Code Style from The Hitchhiker's Guide
pppan
V2EX    Python

ChatGPT 命令行版

  •  1
     
  •   pppan 2023-03-03 12:54:52 +08:00 3711 次点击
    这是一个创建于 953 天前的主题,其中的信息可能已经有所发展或是发生改变。

    特点:

    • 适用于终端爱好者
    • 自带语法高亮
    • 支持上下文
    • 支持代理

    源码: https://github.com/evilpan/gptcli

    预览:

    第 1 条附言    2023-03-04 11:07:26 +08:00

    更新:

    1. 支持多行输入,参考 help 命令
    2. 感谢 @whatthehell,现在已经支持 stream 模式,可以在命令行实时进行渲染!

    12 条回复    2023-03-06 19:27:48 +08:00
    b1ghawk
        1
    b1ghawk  
       2023-03-03 13:09:35 +08:00 via Android
    shower!
    whatthehell
        2
    whatthehell  
       2023-03-03 14:14:59 +08:00
    有没有流式输出版本
    pppan
        3
    pppan  
    OP
       2023-03-03 14:47:40 +08:00
    @whatthehellAPI 好像都是一次性怼回来的 JSON 啊
    wander555
        4
    wander555  
       2023-03-03 15:10:33 +08:00   1
    windows 用不了 readline ,最好换成 pyreadline3
    linux 用当我没说
    howardlau
        5
    howardlau  
       2023-03-03 15:17:46 +08:00
    ptrees
        6
    ptrees  
       2023-03-03 16:10:07 +08:00
    不好使,但是学到了一个 openai.proxy,感谢
    mmxq
        7
    mmxq  
       2023-03-03 16:28:58 +08:00   1
    Windows 下无法使用“readline”module ,pip install pyreadline3 即可运行此脚本。
    小工具吧可是说是,感谢作者!
    然后网上这种类似的 chatgpt 命令行工具还有好多,类似: https://github.com/loclink/chatgpt-prompts
    大伙可以自己去玩玩~
    pppan
        8
    pppan  
    OP
       2023-03-03 17:03:55 +08:00
    参考大家的建议,优化了一些 Windows 下的报错。这个脚本主要是比较轻量,平时用来查代码的。有需要的朋友也可以在此基础上修改下 Prompt ,打造自己专属的 AI 小助手。
    whatthehell
        9
    whatthehell  
       2023-03-03 20:31:48 +08:00
    @pppan
    有流式的,套壳网站都是流式的,看看 stream 参数
    https://platform.openai.com/docs/api-reference/chat/create

    stream: Defaults to false
    If set, partial message deltas will be sent, like in ChatGPT. Tokens will be sent as data-only server-sent events as they become available, with the stream terminated by a data: [DONE] message.
    pppan
    nbsp;   10
    pppan  
    OP
       2023-03-04 11:13:22 +08:00
    @whatthehell 刚刚适配了一下,已经支持流式版本啦!
    mingwiki
        11
    mingwiki  
       2023-03-06 15:10:55 +08:00
    用上了感觉还可以哦,可以直接引入文件吗 想让 gpt 帮我改改代码
    pppan
        12
    pppan  
    OP
       2023-03-06 19:27:48 +08:00
    @mingwiki 可以拷贝文件内容然后多行粘贴进去
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     888 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 27ms UTC 19:47 PVG 03:47 LAX 12:47 JFK 15:47
    Do have faith in what you're doing.
    ubao snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86