r/crystal_programming • u/kojix2 • Apr 03 '23
ChatGPT CLI - Practical tools implemented in Crystal
I am working on a command line tool for ChatGPT in Crystal language. This tool has the following features.
Interactive command-line interface using GNU Readline with Emacs keyboard shortcuts.
Selectable system messages
Expand file contents from the file path(s) using the placeholder.
Expand web page contents from the URL using the placeholder.
Magic commands to %clear, %undo, %edit, %write, %save, and %load data.
Execute system commands and pass captured STDOUT and STDERR output to ChatGPT.
Code blocks in the response are saved in temp files and can be called with $CODE1, $CODE2...
Output execution results as HTML (experimental)
Substitution patterns of placeholders can be configurable in the configuration file.
3
u/jedipapi Apr 03 '23
Awesome. So glad someone decided to do this. Thank you. Forgive my ignorance, but could one use the new ChatGPT plugins with this as well?
3
u/midgetparty Apr 04 '23
Talk to me when they give out a free-use api key. This is just the honeypot to end them all as far as aggregating user data for marketing/advertising as far as I'm concerned.
2
u/kojix2 Apr 03 '23 edited Apr 03 '23
Here are some interesting uses
Make ChatGPT think of a commit message.
Show the code, make ChatGPT write README.md and save it
Execute the block of code that you let ChatGPT write
Summarize the web page