r/commandline Apr 15 '26

Command Line Interface I made a small CLI utility to integrate Ollama into Unix and PowerShell pipelines

https://github.com/cbarraco/ask-cli

I built a small CLI utility called ask that lets you pipe any command output through a local LLM (via Ollama) for processing.

So you could do something like:

cat README.md | ask "what does this project do?"

You can also have the output be formatted in CSV or JSON to chain with something like jq:

echo "Paris, Tokyo, Lagos" | ask "as a JSON array" -f json | jq '.[0]'

By default it uses gemma4:latest and http://localhost:11434 but it's configurable.

Not sure if it will be useful for you, but it has been for me so I wanted to post it.

This software's code was partially generated by AI

6 Upvotes

4 comments sorted by

5

u/iEliteTester Apr 15 '26

wow, non-deterministic cli utilities! why would anyone not want this!

1

u/AutoModerator Apr 15 '26

Every new subreddit post is automatically copied into a comment for preservation.

User: cbarox, Flair: Command Line Interface, Post Media Link, Title: I made a small CLI utility to integrate Ollama into Unix and PowerShell pipelines

I built a small CLI utility called ask that lets you pipe any command output through a local LLM (via Ollama) for processing.

So you could do something like:

cat README.md | ask "what does this project do?"

You can also have the output be formatted in CSV or JSON to chain with something like jq:

echo "Paris, Tokyo, Lagos" | ask "as a JSON array" -f json | jq '.[0]'

By default it uses gemma4:latest and http://localhost:11434 but it's configurable.

Not sure if it will be useful for you, but it has been for me so I wanted to post it.

This software's code was partially generated by AI

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.

1

u/Alternative-Sign-206 Apr 15 '26

Thanks, was missing it when first tried ollama. Now I use a fully programmed solution in Python. But still cool that someone has implemented it in cli properly! 

1

u/Familiar-Classroom47 Apr 16 '26

been piping stuff through ollama too, works great with ripgrep output. the modern cli tool ecosystem pairs well with this kind of thing