Introduction
Ollama provides a powerful command-line interface for running and managing large language models locally. The CLI allows you to pull models from registries, run them interactively or in scripts, and manage your model library.Basic Usage
Available Commands
serve
Start the Ollama server
run
Run a model interactively
pull
Pull a model from a registry
push
Push a model to a registry
create
Create a custom model
show
Show model information
list
List available models
ps
List running models
stop
Stop a running model
rm
Remove a model
launch
Launch the Ollama menu or integrations
Common Patterns
Quick Start
Pull and run a model in one command:Piping Input
Use Ollama in Unix pipelines:Non-Interactive Mode
Run a one-off prompt without entering interactive mode:JSON Output
Request structured JSON responses:Keep Models Loaded
Control how long models stay in memory:Environment Variables
The host address for the Ollama server
Directory where models are stored
Disable saving command history in interactive mode
Editor to use for multi-line input in interactive mode
Global Flags
Show version information
Show detailed output including timing information
Disable automatic word wrapping in output
Exit Codes
0- Success1- General error- Non-zero - Specific error occurred (check error message)
Getting Help
Get help for any command:Next Steps
Running Models
Learn how to run and interact with models
Creating Models
Create custom models with Modelfiles