Show HN: Think, CL tool that makes AI your command line copilot (written in Go)

github.com

14 points by szopa 10 months ago

Hi HN,

I'm thrilled to share with you think, a command-line tool that I developed while diving back into the programming scene.

For the past few years, my focus had shifted from hands-on programming to managerial roles, my last one being at Affirm (I started Affirm's Polish office). However, I recently left my job to revisit my passion for coding and see if I could still write code that works. Not to mention that with what is currently going on in AI if you are a developer this probably the best possible time for a sabbatical in human history :)

My first attempt was with LangChain, but I found it too abstract and elusive for my liking. I knew that Python was the go-to for serious ML research, but as I was primarily dealing with API calls, I wasn't bound to it. So I picked Go for its simplicity, performance, and to spare myself from the notorious Python dependency issues.

Over the last few weeks, I've been hacking on Agency (github.com/ryszard/agency), a framework for writing agents backed by AI. Agency provides an idiomatic interface to various LLM providers (currently OpenAI works and Hugging Face is experimental/brokenish). It simplifies the creation and management of Language Learning Model-based agents, aiding the implementation of autonomous agent systems. It also offers features for production deployment, like caching, retrying, or rate limiting. The idea was to allow managing how data flows between different AI agents without sacrificing my sanity.

With Agency as my foundation, I was able to write think over the course of a weekend. Most of that time was spent figuring out the right UX (and how to use the readline library, whose documentation is... sparse).

Today, I'm presenting you with think – a utility that uses OpenAI's AI models to assist in crafting shell commands. Simply describe what you want to do in your own words, and think generates the relevant shell commands.

tuchsen 10 months ago

Hey, nice work! Being able to continue the conversation and work iteratively looks useful. Bash scripts seem to be one of ChatGPT's sweet spots, where it just gets things right most of the time.

Not to shill, but I'm also doing a GUI version of this as a file manager (aerome.net), with a built in ChatGPT "shell" where you ask it to write scripts and then evaluate them. The goal's to make shell scripting accessible to non developers.

szopa 10 months ago

A friend just mentioned to me https://github.com/m1guelpf/plz-cli (whose tagline I unknowingly reproduced). The difference between think and plz is that in think you are able to keep the conversation going, which allows you to easily ask for followup tasks.