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: Lair – CLI Tools for working with generative AI

2 pointsby DougHaber2 months ago
This is a set of command line tools I made for working with generative AI. Several months back, I was looking for a new job and felt like my GitHub profile needed something more modern. I write a lot of tools, and this one in particular seemed like it might be useful to other people, so I rewrote a lot of it to make a cleaner open source version with a BSD license.<p>Lair currently consists of three main components.<p>First, there is &quot;chat&quot;, a command line chat interface with autocomplete, multi-line editing, markdown rendering, persistent sessions, etc. It&#x27;s really more than just a chat interface, and I use it for prompt engineering and testing things out against different models quickly. This is built using the Python PromptToolkit and Rich modules, which I can&#x27;t recommend enough. Most things are configurable, and there are lots of keyboard shortcuts available.<p>Next up we have &quot;comfy&quot;. This uses ComfyScript (<a href="https:&#x2F;&#x2F;github.com&#x2F;Chaoses-Ib&#x2F;ComfyScript" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;Chaoses-Ib&#x2F;ComfyScript</a>) to run workflows against a ComfyUI server. It can do image and video diffusion as well as upscaling, with a CLI that works well for scripting. ComfyScript is great, but does have some rough edges that might need to be smoothed out to get better performance, easier debugging of errors, and more control over what it writes to STDOUT&#x2F;STDERR. Before I made an open source version of Lair, I was implementing a lot of this functionality by hand. It&#x27;s been really nice letting ComfyUI provide features and optimizations so that I can worry more about providing an interface on top of it.<p>Finally, there is &quot;util&quot;. This is a one-shot tool for LLM interactions from the command line and for shell scripting will LLMs. I&#x27;ve seen a number of similar tools elsewhere. This one is in the style I like, and it works with most Lair features, so it supports attachments (PDF, text, and image with vision models,) sessions, and all of Lair&#x27;s supported tools.<p>The README.md has lots of examples of the functionality and there is also a Youtube video in the Overview section with a live walk-through. I hope someone else finds this useful. I am happy to answer any questions.

no comments

no comments