Skip to main content
skill CX Codex

cli-anything-ollama — Claude Code skill: manage local LLMs via CLI

Skill for working with local LLMs through the Ollama REST API directly from your editor. Lets agents run models, generate text, chat, and create embeddings without a GUI.

Install into Claude Code · Skills CLI (Vercel) All methods and platforms ↓
npx skills add HKUDS/CLI-Anything --skill cli-anything-ollama -a claude-code
Open on GitHub

What cli-anything-ollama does

cli-anything-ollama is a command-line interface to Ollama. The skill adds local model access to your editor: download models from the Ollama library, generate text, run multi-turn chats, create embeddings. Commands output both human-readable format (tables, colors) and machine-readable JSON for agents.

In interactive REPL mode, the skill keeps session state: chat history, current host, last used model. Connect to remote Ollama servers via the --host flag. Requires Python 3.10+ and a running local Ollama server (ollama serve).

For agents, use the --json flag for structured output and --no-stream for complete responses. Check server status with server status before other operations.

What it helps with

  • Run a local model and get text output without a GUI
  • Manage Ollama models: pull, delete, inspect parameters
  • Conduct multi-turn chats with history saved in one session
  • Generate embeddings for text
  • Connect to a remote Ollama server via CLI

Example prompts for the agent

  • Pull a model and show its details: cli-anything-ollama model pull llama3.2 then cli-anything-ollama model show llama3.2
  • Generate text: cli-anything-ollama generate text --model llama3.2 --prompt "Explain quantum computing in one sentence"
  • Chat with a model: cli-anything-ollama generate chat --model llama3.2 --message "user:What is Python?" --message "user:How does it compare to JavaScript?"

How to install cli-anything-ollama

1Skills CLI (Vercel)

npx skills add HKUDS/CLI-Anything --skill cli-anything-ollama -a claude-code

2Manually: put the files in place

~/.claude/skills/cli-anything-ollama/SKILL.md

Copy the whole skill folder; for one project use .claude/skills/cli-anything-ollama/

Step by step, with commands for each platform: How to install skills in Claude Code: five ways

Questions about cli-anything-ollama

How do I install cli-anything-ollama in Claude Code?

Run npx skills add HKUDS/CLI-Anything --skill cli-anything-ollama -a claude-code. The skill will load in ~/.claude/skills/cli-anything-ollama/SKILL.md.

What does cli-anything-ollama do?

It's a command-line interface for Ollama. You can pull models, generate text, run chats, create embeddings, and manage the server — all via API, no GUI needed.

What do I need to use it?

Python 3.10+ and a local Ollama server running. You can connect to a remote server using the --host flag.

Source text

SKILL.md · Apache-2.0
---
name: "cli-anything-ollama"
description: >-
  Command-line interface for Ollama - Local LLM inference and model management via Ollama REST API. Designed for AI agents and power users who need to manage models, generate text, chat, and create embeddings without a GUI.
---

# 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:

```bash
pip install cli-anything-ollama
```

**Prerequisites:**
- Python 3.10+
- Ollama must be installed and running (`ollama serve`)


## Usage

### Basic Commands

```bash
# Show help
cli-anything-ollama --help

# Start interactive REPL mode
cli-anything-ollama

# List available models
cli-anything-ollama model list

# Run with JSON output (for agent consumption)
cli-anything-ollama --json model list
```

### REPL Mode

When invoked without a subcommand, the CLI enters an interactive REPL session:

```bash
cli-anything-ollama
# Enter commands interactively with tab-completion and history
```


## Command Groups


### Model

Model management commands.

| Command | Description |
|---------|-------------|
| `list` | List locally available models |
| `show` | Show model details (parameters, template, license) |
| `pull` | Download a model from the Ollama library |
| `rm` | Delete a model from local storage |
| `copy` | Copy a model to a new name |
| `ps` | List models currently loaded in memory |


### Generate

Text generation and chat commands.

| Command | Description |
|---------|-------------|
| `text` | Generate text from a prompt |
| `chat` | Send a chat completion request |


### Embed

Embedding generation commands.

| Command | Description |
|---------|-------------|
| `text` | Generate embeddings for text |


### Server

Server status and info commands.

| Command | Description |
|---------|-------------|
| `status` | Check if Ollama server is running |
| `version` | Show Ollama server version |


### Session

Session state commands.

| Command | Description |
|---------|-------------|
| `status` | Show current session state |
| `history` | Show chat history for current session |



## Examples


### List and Pull Models

```bash
# List available models
cli-anything-ollama model list

# Pull a model
cli-anything-ollama model pull llama3.2

# Show model details
cli-anything-ollama model show llama3.2
```


### Generate Text

```bash
# Stream text (default)
cli-anything-ollama generate text --model llama3.2 --prompt "Explain quantum computing in one sentence"

# Non-streaming with JSON output (for agents)
cli-anything-ollama --json generate text --model llama3.2 --prompt "Hello" --no-stream
```


### Chat

```bash
# Single-turn chat
cli-anything-ollama generate chat --model llama3.2 --message "user:What is Python?"

# Multi-turn chat
cli-anything-ollama generate chat --model llama3.2 \
  --message "user:What is Python?" \
  --message "user:How does it compare to JavaScript?"

# Chat from JSON file
cli-anything-ollama generate chat --model llama3.2 --file messages.json
```


### Embeddings

```bash
cli-anything-ollama embed text --model nomic-embed-text --input "Hello world"
cli-anything-ollama embed text --model nomic-embed-text --input "Hello" --input "World"
```


### Interactive REPL Session

Start an interactive session for exploratory use.

```bash
cli-anything-ollama
# Enter commands interactively
# Use 'help' to see available commands
```


### Connect to Remote Host

```bash
cli-anything-ollama --host http://192.168.1.100:11434 model list
```


## 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** (`--json` flag): Structured JSON for agent consumption

```bash
# Human output
cli-anything-ollama model list

# JSON output for agents
cli-anything-ollama --json model list
```

## For AI Agents

When using this CLI programmatically:

1. **Always use `--json` flag** for parseable output
2. **Check return codes** - 0 for success, non-zero for errors
3. **Parse stderr** for error messages on failure
4. **Use `--no-stream`** for generate/chat to get complete responses
5. **Verify Ollama is running** with `server status` before 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

© HKUDS · Apache-2.0 · HKUDS/CLI-Anything

Similar skills

Everything for AI and ML →

From the same set55

cli-anything-inkscape Stateful command-line interface skill for editing vector graphics in Inkscape, tracking project state in JSON, and manipulating SVG documents. CX Codex +1 605installs cli-anything-browser This skill maps Chrome's Accessibility Tree to a virtual filesystem. Agents navigate pages, inspect elements, and click buttons with standard terminal commands. CX Codex +1 594installs cli-anything-godot Controls Godot projects from the command line, including scenes, GDScript runs, and exports. Useful when an agent needs to change or inspect a game project. CX Codex +1 548installs cli-anything-comfyui A skill that hands your coding agent a terminal for ComfyUI, so it can queue workflows, browse models and pull finished images without a GUI in the way. CX Codex +1 546installs cli-anything-kdenlive Controls Kdenlive video editing through a stateful terminal tool. Helps coding agents build timelines, apply filters, and export projects to MLT XML without manual GUI work. CX Codex +1 536installs cli-anything-qgis Drives a QGIS project from the shell: GeoPackage layers, WKT features, print layouts, PDF export and qgis_process algorithms. Useful when the map has to be built without clicking. CX Codex +1 534installs cli-anything-audacity A skill that puts a stateful Audacity CLI in your agent's hands: edit tracks, clips and effects, then render without opening the GUI. CX Codex +1 530installs cli-anything-n8n A skill that hands your agent a command line for n8n: workflows, executions, credentials, variables and tags. Useful when automation lives in scripts, not the UI. CX Codex +1 515installs

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor