Show HN: Chatblade – A CLI Swiss Army Knife for ChatGPT (github.com)
integrate chatGPT into your scripts or terminal work. Supports piping text, saving prompts, estimating costs, and some basic json/yaml extraction.
I've added some elaborate examples on the readme of how to use it with pictures, that may provide a better overview.
67 comments
[ 2.8 ms ] story [ 129 ms ] threadCongrats to npiv.
[0] https://github.com/clevercli/clevercli
[1] https://github.com/sigoden/aichat/
Having that on even just a super old computer would be revolutionary for the old computer. Completely new life.
Something old that was obsolete, if it can have a terminal connected to an LLM, and hopefully internet access too, then it becomes a super powerful interface that doesn’t even require images.
Thank you, I'm glad to have a more casually hackable implementation in TypeScript. It definitely helps that you project is not written in Rust!
Launch your take anyways
Get it shipped lol. Highest rated comment and you're practically the only person not linking your own!
Don't gatekeep yourself!
Now if the Chrome store stops taking 3-4 days to approve an update, that'd be great!
[1] https://sublimegpt.com
https://github.com/NotBrianZach/bza (my concept, wip, read along repl as opposed to io focused cli tool)
You could create a graph of the intersections/references of meaning across different books. Those could represent an external memory for the agent/LLM, that it can retrieve/navigate via prompts.
he says it tends to lose character cohesion as conversation goes on
and of course obviously could be useful if a character shows up in a scene it just looks up their wiki entry essentially
sounds complicated lol
i just wanna read math book with it
i could imagine it would be fun to create a wiki with friends and then like randomly roll characters into your session from your shared universe or something
a lot of possibilities
Then you download/subscribe/connect your LLM interface, to your tools. I guess that’s kind of like Slack.
Having GPT fill in (or 'out', if you prefer) the myriad of web-forms I'm currently wrestling with as a job-seeker would be amazing. There's only so many times each day I can copy and paste from my CV (résumé) without turning to drink.
On the first part: I've been trying to build a tool that parses webpages using ChatGPT, but I'm struggling to figure out the best way to pass the website content over. Some options I have tried:
* Raw HTML - expensive, and in a lot of cases doesn't fit in prompt input
* OCR - works better than I would have expected, but can struggle with certain fonts, and a lot of the webpage structure is lost
Maybe stripping the styling and Javascript from webpages would work? Did you do the OCR as part of the complete model or did you make it a separate step? Machine learning is usually much better in one step.
For more context: I have this setup as an api that I feed url + typescript definitions to, and have chatgpt output information from the website in the specified typescript definition.
For example, I can use {product_price: float, product_name: str} + a url as the input, and fairly accurately get product price info across ALL product websites. It's kind of amazing that it's able to do this much just based upon the typescript variable names + raw OCR output.
Wait till they make the image input available via the API, I guess
https://github.com/dylanjcastillo/shell-genie
Edit: just saw on another post aichat - https://github.com/sigoden/aichat/
I made something quite similar, this can also run commands and has syntax highlighting
https://github.com/lennardv2/hey-chatgpt-cli
openai.error.AuthenticationError: Incorrect API key provided: user@dom***.tld. You can find your API key at https://platform.openai.com/account/api-keys.
That is kind of weird, because the email given in that message looks valid, but does not match my OpenAI account name. Is that email encoded in the key? If so, apparently decoding worked, so why should the key be invalid?
Am I doing something wrong here, or is something round the API key stuff broken right now?
I can generate the same error by setting
OPENAI_API_KEY="this is wrong"; chatblade test
openai.error.AuthenticationError: Incorrect API key provided: this is *rong. You can find your API key at https://platform.openai.com/account/api-keys.
if you run
echo $OPENAI_API_KEY
you should see your key which starts with sk-......... If not thats where your issue is
So I wonder where it is getting this email from.
curl https://api.openai.com/v1/completions -H "Content-Type: application/json" -H "Authorization: Bearer $OPENAI_API_KEY" -d '{ "model": "text-davinci-003", "prompt": "Say this is a test", "max_tokens": 7, "temperature": 0 }'
So my api key is valid. But something in chatblade or the python packages it depends on trashes the input I provide, and replaces it with an email address of mine. Sounds weird, but is apparently true.
An other option is that you passed your email as a parameter mistakingly (which takes precedence over the env variable)
But the code is really pretty simple. https://github.com/npiv/chatblade/blob/4ce28739ca7ada1611029...
I even replaced get_openai_key(params) with a hardcoded
and still no luck. I guess the bug must be in the openai python package, but I cant find it either. However, rest assured I am not providing this email anywhere manually...> If no authentication method is given with the auth argument, Requests will attempt to get the authentication credentials for the URL’s hostname from the user’s netrc file. The netrc file overrides raw HTTP authentication headers set with headers.
Source: https://docs.python-requests.org/en/latest/user/authenticati...
The main itch I wanted to scratch for my own exploration with chatgpt was that I found myself doing a lot of curl requests, and then after a few iterations I would come up with one that worked well. The next step was to reproduce that last result (without ideally hitting the openai servers again) and I wanted to pipe it to the next part of my chain.
This project kind of grew out of that. Every time I had more than 2 pipes I created a new "ease of life" parameter.
Although it is possible (and likely) that your working memory is far greater than mine to come up with a command like that.
I am sure I could encode stuff with plain other tools as well, but jq is actually handy for escaping json strings. And since it can read variable content from stdin, I was a happy man. Even with decently working emacs integration now.
But again, thanks for writing this. I have both now, and will happily steal ideas from chatblade!
The dream is ultimately to leverage chatgpt as a fuzzy text assistant to 10x productivity and I think combining the unix CLI which is optimized for text is the best way to do so.
It is also one of the great powers of the unix CLI that there are many roads that lead to rome.
If you use tmux, you can pipe in `tmux capture-pane -p -S -` to ask questions about commands and outputs you have just run in your shell.
I use a small script that does that, but will probably replace it with chatblade
script: https://gist.github.com/kinfolk0117/7177964818f46407d4c45792...