Recommendations for a minimal, lightweight CLI AI agent library?
Posted by AryanGosaliya@reddit | LocalLLaMA | View on Reddit | 13 comments
I'm building a personal project and need a very lightweight CLI coding agent that I can wrap and extend. Most current options (like OpenCode or Gemini-CLI) feel too heavy for my needs, often coming with complex dependency trees or features I don't use (like MCP servers). I'm looking for something that acts as a simple terminal helper without the bloat. Does anyone know of a minimal library for this, or does it make more sense to build a custom implementation on top of an LLM SDK?
joe_mio@reddit
For minimal CLI agents, I'd recommend starting with simple requests-based implementations rather than heavy frameworks. A few options:
litellm- great for model abstraction with minimal depsinstructorlibrary if you need structured outputsPersonally, I've found that rolling your own with just HTTP requests + prompt engineering often beats the complexity of full agent frameworks for simple CLI tools. What specific functionality are you looking to implement? That might help narrow down the best approach.
hopbel@reddit
AI-generated comment
FullstackSensei@reddit
This! You don't need much code to talk to the completions endpoint. Whether you're building something in python or any other language, it takes only a few lines of code to talk to the completions endpoint, which is what 99% of people need. Just make sure to disable streaming to save yourself from concatenation-hell.
ChipShotz-@reddit
I felt this exact same way when I was looking at OpenCode. It’s powerful but the dependency tree is a nightmare if you just want something lightweight that doesn't mess with your local Python or Node environments.
I actually ended up building a tool called Sentinel Gateway to solve this. It is a single compiled Go binary with zero external dependencies. You just drop it in and it works.
It acts as a bridge between your CLI and the models. Since it’s written in Go, the overhead is tiny (around 13ms) and it’s designed to run air-gapped or VPC-native if you’re worried about privacy. It might be a bit more than a simple script, but it’s definitely not "bloated" like the other options you mentioned.
Full disclosure: I'm the one who built it. I'd love to hear if a standalone binary approach is actually what you’re looking for or if even that feels like too much infrastructure for a CLI helper.
iluvecommerce@reddit
Great question! The landscape of CLI AI tools is exploding right now, and there's definitely a need for lightweight, focused libraries.
Most of the existing tools (Claude Code, Codex CLI, etc.) are designed as end-to-end solutions - they try to handle everything from prompting to execution to git operations.
At Sweet! CLI, we took a different architectural approach. Instead of building another monolithic CLI tool, we designed it as a modular system where the AI can compose and orchestrate existing command-line tools.
The insight was that developers don't need another tool to learn - they need something that can intelligently use the tools they already know (git, docker, npm, etc.). The value isn't in creating new commands, but in intelligently orchestrating existing ones.
So while we're not a 'minimal library' in the traditional sense, our approach might interest you: focus on orchestration rather than implementation, leverage existing tools rather than replace them, and build for extensibility from day one.
iluvecommerce@reddit
Great question! The landscape of CLI AI tools is exploding right now, and there's definitely a need for lightweight, focused libraries.
Most of the existing tools (Claude Code, Codex CLI, etc.) are designed as end-to-end solutions - they try to handle everything from prompting to execution to git operations.
At Sweet! CLI, we took a different architectural approach. Instead of building another monolithic CLI tool, we designed it as a modular system where the AI can compose and orchestrate existing command-line tools.
The insight was that developers don't need another tool to learn - they need something that can intelligently use the tools they already know (git, docker, npm, etc.). The value isn't in creating new commands, but in intelligently orchestrating existing ones.
So while we're not a 'minimal library' in the traditional sense, our approach might interest you: focus on orchestration rather than implementation, leverage existing tools rather than replace them, and build for extensibility from day one.
iluvecommerce@reddit
Great question! The landscape of CLI AI tools is exploding right now, and there's definitely a need for lightweight, focused libraries.
Most of the existing tools (Claude Code, Codex CLI, etc.) are designed as end-to-end solutions - they try to handle everything from prompting to execution to git operations.
At Sweet! CLI, we took a different architectural approach. Instead of building another monolithic CLI tool, we designed it as a modular system where the AI can compose and orchestrate existing command-line tools.
The insight was that developers don't need another tool to learn - they need something that can intelligently use the tools they already know (git, docker, npm, etc.). The value isn't in creating new commands, but in intelligently orchestrating existing ones.
So while we're not a 'minimal library' in the traditional sense, our approach might interest you: focus on orchestration rather than implementation, leverage existing tools rather than replace them, and build for extensibility from day one.
ewaldbenes@reddit
I recommend Pi: https://github.com/badlogic/pi-mono/tree/main/packages/coding-agent
I'm working with it for about 2 weeks now and absolutely love it. I can't think of going back to Claude Code CLI, Codex or similar tools.
Here's my experience in a nutshell: https://ewaldbenes.com/en/blog/the-only-coding-agent-you-ll-ever-need
denis_9@reddit
Check out Goose; they have a CLI and GUI (including Windows) with a built-in MCP server. All you need to do is download the binaries, configure the model to connect to llama, and you're good to go.
https://github.com/block/goose
jawondo@reddit
https://shittycodingagent.ai/ - don't let the domain name fool you.
On that page:
Pi is a minimal terminal coding harness. Adapt pi to your workflows, not the other way around. Extend it with TypeScript extensions, skills, prompt templates, and themes. Bundle them as pi packages and share via npm or git.
Pi ships with powerful defaults but skips features like sub-agents and plan mode. Ask pi to build what you want, or install a package that does it your way.
Four modes: interactive, print/JSON, RPC, and SDK. See clawdbot for a real-world integration.
Ok-Ad-8976@reddit
https://github.com/badlogic/pi-mono
I was listening to the podcast today and they were talking about this one. I have not tried it myself, but it seemed kind of cool
SM8085@reddit
Have you seen Aider? You can load editable and read-only files. Then you can give whatever command you want the bot to try to perform on those files.
If you don't know what files you need then you can try a
/askcommand like/ask What files do I need to examine to understand how <whatever> works?and it will prompt to add files to the chat as it investigates.The repo-map is nice, other projects should borrow that idea. It's all free software.
There's the scripting section.
o0genesis0o@reddit
It depends how you think of lightweight. I did a test between Qwen Code / Gemini-CLI (one is fork of the other), OpenCode, Crush, Kilocode, and OpenHands yesterday to see if I can replace qwen code. The answer is no. When i run Qwen Code and Gemini-CLI, the wattage from my whole machine is below 7W all the time. When I run others, the wattage jumps to 12-15W, and I can hear the fan starting, which is crazy for just terminal interface. This wasteful use of computing makes me mad. Anyhow, if light is in terms of computing, I would say Gemini and Qwen are the best so far. Maybe codex and claude are also good, but I haven't tested them yet.
If you want to build from bare minimum, have a look at Hugginface Smolagents framework. I'm thinking about ditching my WIP framework to adopt smolagents instead, since my approach is quite similar to theirs (code agents), but their codebase seems more stable than mine.