AI & Automation
Ollama CLI
Local LLM management, chat and embeddings via Ollama REST API
✓ 9 tests passed
Install
$ pip install cli-anything-ollama
About
Manage your local Ollama LLM server from the command line. Pull and delete models, run single prompts or multi-turn conversations, generate embeddings — all with streaming support and JSON output.
Requirements
Ollama server running (localhost:11434)
Command Reference
| Command | Arguments | Description |
|---|---|---|
detect |
Check Ollama server connection | |
version |
Show Ollama server version | |
list |
List downloaded models | |
ps |
Show running models | |
pull |
MODEL |
Pull model from Ollama Hub |
show |
MODEL |
Show model details |
run |
MODEL PROMPT --system SYS --temperature T |
Single text generation |
chat |
MODEL --system SYS |
Interactive multi-turn chat |
embeddings |
MODEL TEXT |
Generate text embeddings |
delete |
MODEL |
Delete model |
Usage Examples
# Install
$ pip install cli-anything-ollama
# Health check
$ ollama-cli detect
# Get capabilities schema (Agent-ready, no token needed)
$ ollama-cli schema
# Run with JSON output (for AI Agent integration)
$ ollama-cli --json detect
# Example JSON response:
{"model":"llama3.2","response":"Hello! How can I help?","total_duration_ms":1250}
Agent Integration
# Python — call from AI Agent
import subprocess, json
result = subprocess.run(
["ollama-cli", "--json", "detect"],
capture_output=True, text=True
)
data = json.loads(result.stdout)
print(data)
# Discover all commands without credentials:
schema = subprocess.run(
["ollama-cli", "schema"],
capture_output=True, text=True
)
capabilities = json.loads(schema.stdout)