TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

Show HN: An easy-to-use CLI tool for interfacing with OpenAI's models

1 pointsby mehmet_mhyabout 1 year ago
Hey again everyone,<p>Since I debuted Cha, a lot has changed, so I wanted to make a new post about it. Cha is a simple and open-source CLI chat tool designed to easily interface with OpenAI&#x27;s text and image generation models through their API. I built this tool about 1.5 months ago and use it on a daily basis, to the point where I use it more than I use the ChatGPT website.<p>Currently, Cha supports the following features:<p>- Basic CLI chat interface to OpenAI’s LLM models.<p>- Web scraping for a provided link (supports JavaScript scraping).<p>- YouTube scraping; scraping the transcript from a video.<p>- Multi-line support; easily copy and paste new lines into the CLI.<p>- Generate images using OpenAI&#x27;s image models.<p>- Supports interactive and non-interactive mode for chatting.<p>I think Cha is very useful, especially for command-line-based tasks, so I wanted to share it. Cha is still very young, so any feedback would be greatly appreciated.<p>Demo: <a href="https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=YcfFC1IU_SA" rel="nofollow">https:&#x2F;&#x2F;www.youtube.com&#x2F;watch?v=YcfFC1IU_SA</a><p>Code: <a href="https:&#x2F;&#x2F;github.com&#x2F;MehmetMHY&#x2F;cha">https:&#x2F;&#x2F;github.com&#x2F;MehmetMHY&#x2F;cha</a>

1 comment

mehmet_mhyabout 1 year ago
To make Cha more seamless, I created the following command in my .zshrc:<p>chatgpt () { DEFAULT_MODEL=&quot;gpt-4-turbo-preview&quot;<p><pre><code> # path to your OpenAI API key source &#x2F;Users&#x2F;mehmet&#x2F;.custom&#x2F;.env if [[ &quot;$1&quot; == &quot;-f&quot; &amp;&amp; -n &quot;$2&quot; ]]; then cha -m $DEFAULT_MODEL -f &quot;$2&quot; elif [ $# -eq 0 ]; then cha --model $DEFAULT_MODEL else cha -m $DEFAULT_MODEL -s &quot;$1&quot; fi unset OPENAI_API_KEY }</code></pre>