Maybe a small plug of own similar library: terminal-agent (https://github.com/laszukdawid/terminal-agent) which also supports tools and even MCP. There's a limited agentic capability but needs some polishing.
Only once I made some progress on own app I learned about this `llm` CLI. Though that one more won't harm.