A chat window is not always the quickest way to use a local language model. If you spend your day in Windows Terminal, PowerShell or a Linux shell, a command-line AI tool lets you pipe a log file into a model, turn a plain-English request into a shell command, or summarise a document without leaving the prompt. All of the tools below are free, open source and can talk to models running on your own PC through Ollama, so nothing has to leave your machine.
These are not coding agents that edit whole projects; if that's what you want, see our guides to Codex CLI with Ollama and OpenCode with Ollama. They also need a model server running first: every pick here assumes Ollama is installed and serving models on its default address of localhost:11434.
Quick picks
Tool | Best for | Install (from official docs) | Local models via |
|---|
LLM | Scripting, templates and keeping a saved history | pip, pipx, uv or Homebrew | The llm-ollama plugin |
aichat | An all-in-one terminal assistant on Windows, macOS or Linux | Scoop, Homebrew, Cargo, pacman or a pre-built binary | Ollama's OpenAI-compatible endpoint |
ShellGPT | Turning requests into shell commands | pip | LiteLLM, pointed at Ollama |
Fabric | Ready-made prompts for summarising and extracting | Winget, Homebrew, Go or Docker | Built-in Ollama support |
Ollama CLI | The quickest way to chat with a model | Ollama's installer | Itself |
1. LLM - best overall for scripting and history
LLM is Simon Willison's Python command-line tool and library, and it's our pick for anyone who wants AI to fit into scripts and pipelines. Local models come from the llm-ollama plugin, which automatically discovers the models on your Ollama server and registers them with names prefixed ollama/, such as ollama/gemma3.
What makes it stand out:
Pipes and system prompts. You can run cat myfile.py | llm -s "Explain this code" and the file becomes part of the prompt.
Templates. A system prompt can be saved with --save and reused with -t, so a prompt you like becomes a command.
A full log. By default LLM records every prompt and response in a SQLite database, which you can look back through later. Run llm logs off if you'd rather it didn't.
Conversations and extras. -c continues the previous conversation, llm chat opens an interactive session, -x pulls the first fenced code block out of a reply, and schemas ask a model for structured JSON.
Ollama features. The plugin passes images to models that report the vision capability, supports embeddings and tools, and can turn a reasoning model's thinking off with -o think false.
The catch is that it's a Python tool, so on Windows you'll need Python installed first. The LLM documentation also warns that upgrading with uv, pipx or Homebrew replaces the environment and removes any plugins you installed with llm install, so you'll need to reinstall llm-ollama after those upgrades. Our step-by-step guide shows how to use LLM with Ollama.
2. aichat - best all-in-one terminal assistant
aichat describes itself as an all-in-one LLM CLI tool, and the feature list backs that up. It doesn't need Python: it can be installed with Rust's Cargo package manager, and Windows users can use Scoop or download a pre-built binary from GitHub.
It works with more than 20 providers, including Ollama. The project's example configuration adds Ollama as an OpenAI-compatible client with the address http://localhost:11434/v1, listing each model you want to use.
Highlights from the official README:
A one-shot command mode and an interactive REPL with tab completion, multi-line input and history search.
A Shell Assistant that turns a plain-English task into a shell command and adjusts to your operating system and shell.
Input from stdin, local files, whole folders, web addresses and the output of other commands (for example git diff).
Roles, sessions, macros, RAG over your own documents, function calling and MCP tools.
A built-in local server (aichat --serve) with an OpenAI-style chat API, a browser playground and an "arena" for comparing models side by side.
If you want one terminal tool that does nearly everything, this is it. The trade-off is a YAML configuration file to edit before local models appear. We compare it directly with LLM in aichat vs LLM.
3. ShellGPT - best for generating shell commands
ShellGPT (sgpt) is built around one job done well: you describe what you want and it writes the command. sgpt --shell "find all json files in current folder" suggests a command and lets you run it, while --code returns only code and --chat or --repl keep a conversation going. The README says it supports Linux, macOS and Windows and shells including PowerShell, CMD, Bash and Zsh.
It uses OpenAI by default. For local models, the project's Ollama guide has you install it with pip install "shell-gpt[litellm]", then set USE_LITELLM=true, API_BASE_URL=http://localhost:11434 and a model such as ollama/gemma4:e4b in its .sgptrc settings file. The guide notes that this model needs around 10 to 12GB of RAM and, as a reasoning model, may be slower to reply on modest hardware.
As with any tool that writes commands, read what it suggests before you run it, especially anything that deletes files or changes system settings.
4. Fabric - best for ready-made prompts
Fabric, from Daniel Miessler, takes a different approach. Instead of starting from a blank prompt, it gives you a library of ready-made prompts called Patterns, for jobs such as summarising, extracting the key ideas from a video transcript, or condensing an academic paper. You pipe text in and pick a pattern, for example fabric --pattern summarize.
Fabric lists Ollama and LM Studio among its supported providers, and you choose them by running fabric --setup. On Windows it can be installed with winget install danielmiessler.Fabric; Homebrew, Go and Docker routes are also documented. Its optional shell aliases include a yt helper that fetches a YouTube transcript for a pattern to process.
Pick Fabric if you mostly want to process text quickly with proven prompts. It's built around patterns rather than ongoing conversations, so aichat or LLM suit general chat better.
5. Ollama's own CLI - the simplest option
You may not need anything extra. Ollama's command line can already download and chat with a model in one step: ollama run gemma4 starts an interactive chat in your terminal. It's ideal for quick questions and for checking a model works before connecting another tool. What it lacks are the extras above: saved templates, prompt logs, shell-command generation and ready-made prompt libraries.
What hardware do you need?
These tools are light; the language model does the heavy lifting. How fast replies arrive depends on the model you choose and whether it fits in your graphics card's memory. Our guides to context length and VRAM and the best local LLMs for 12GB of VRAM explain how to pick a model that suits your GPU. Piping in long documents needs a bigger context window, which uses more memory.