cli-anything-ollama
Local LLM inference and model management via the Ollama REST API. Designed for AI agents and power users who need to manage models, generate text, chat, and create embeddings without a GUI.
Installation
This CLI is installed as part of the cli-anything-ollama package:
Prerequisites:
- Python 3.10+
- Ollama must be installed and running (
ollama serve)
Usage
Basic Commands
REPL Mode
When invoked without a subcommand, the CLI enters an interactive REPL session:
Command Groups
Model
Model management commands.
Generate
Text generation and chat commands.
Embed
Embedding generation commands.
Server
Server status and info commands.
Session
Session state commands.
Examples
List and Pull Models
Generate Text
Chat
Embeddings
Interactive REPL Session
Start an interactive session for exploratory use.
Connect to Remote Host
State Management
The CLI maintains lightweight session state:
- Current host URL: Configurable via
--host - Chat history: Tracked for multi-turn conversations in REPL
- Last used model: Shown in REPL prompt
Output Formats
All commands support dual output modes:
- Human-readable (default): Tables, colors, formatted text
- Machine-readable (
--jsonflag): Structured JSON for agent consumption
For AI Agents
When using this CLI programmatically:
- Always use
--jsonflag for parseable output - Check return codes - 0 for success, non-zero for errors
- Parse stderr for error messages on failure
- Use
--no-streamfor generate/chat to get complete responses - Verify Ollama is running with
server statusbefore other commands
More Information
- Full documentation: See README.md in the package
- Test coverage: See TEST.md in the package
- Methodology: See HARNESS.md in the cli-anything-plugin
Version
1.0.1



