Inspiration
Have you ever thought of using a coding agent without any internet connection?
What if you found that your usual coding agent isn't as good as it used to be?
Gennai CLI is for you.
It is a CLI coding agent which works with Ollama, OpenAI, Anthropic, Gemini. Its name is coming from GENeric-ageNt-for-AI and Gennai Hiraga, a historic Japanese inventor.
Features,
- ReAct based reason and act loop
- Integrated tools for coding
- Read-before-Write semantics for proper file editing
- Ask approval for user before editing/writing
- File access is allowed only in workingDir
- Reads AGENTS.md and file content specified with @filesystem
- User setting/history under
~/.gennai - MCP tools support
What it does
This program runs similarly to other coding agents, accepting user's prompt and processes task iteratively. Context messages including tool call/response and thinking are stored in memory. It is also stored in user's local project directory to resume session.
- Explores filesystem: LS, Glob, Grep
- Read/Write/Edit/MultiEdit
- Todo management
- Slash commands like
/clear,/quit - File embedding by
@filename
How we built it
This is a personal pure Go project. Core ideas are derived from LangGraph and behaviors of other coding agents. Thanks to type safety of Go and SDKs from vendors, I could make minimal implementation using these patterns.
- DDD/DI pattern
- pkg/internal isolation
- channel for thinking
- reflect for JSON Schema
Challenges we ran into
It was hard to evaluate cross-model performance of agent manually. So I introduced test suite which tests with various scenarios for each models.
At this moment, Sonnet 3.7 and gpt-5-mini success but gpt-oss:20b and gemini-2.5-flash sometimes fail. Maybe tuning prompts/tools for specific model results better, but I weigh understanding of common behavior of all models.
Accomplishments that we're proud of
Although it is just a simple CLI tool and has no fancy features, it runs with smaller models and does small tasks quickly.
Because it has built-in restriction, it's safe to try it in git-controlled directory.
What we learned
Creating an agent program, Comparing various models, Testing and improving the agent's behavior are great opportunities to understand the latest landscape of LLMs.
What's next for Gennai CLI
Tuning it to larger models is a big challenge for me. It involves more token management and better compaction strategies.
As its original concept, introducing scenarios other than coding may be a next challenge.
Log in or sign up for Devpost to join the conversation.