Skip to content

Guide · Agent skill

How to use the Ollama CLI agent skill (cli-anything-ollama)

Updated · written with AI from the project's own documentation and checked against our catalogue data

The cli-anything-ollama skill teaches an AI agent to operate a command-line tool that controls Ollama, a program for running large language models on your own computer. This guide explains what the skill lets an agent do, how to install it, how to ask for it in plain language, and what to watch for. By the end you will have the skill loaded, Ollama running, and a working example of listing, generating and embedding with local models.

Ollama CLI for Local ModelsHKUDS/CLI-Anything · Apache-2.0

Quick start

  1. 1Install Ollama and start the server. Install Ollama and run ollama serve so the CLI has a server to talk to.
  2. 2Install Python 3.10 or newer. Confirm your Python version meets the 3.10+ requirement before continuing.
  3. 3Install the CLI package. Run pip install cli-anything-ollama.
  4. 4Add the skill folder. Unzip the downloaded ZIP and place it in ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings → Capabilities → Skills.
  5. 5Check the server. Run cli-anything-ollama server status to confirm Ollama is reachable.
  6. 6Ask the agent in plain language. Mention Ollama and a model name, and state the action you want, such as listing models or creating embeddings.

What is an agent skill and what does this one do?

An agent skill is a folder containing a SKILL.md file that tells an AI agent how to perform a specific task with a tool. This skill covers the cli-anything-ollama command-line interface, which wraps the Ollama REST API.

Once installed, the agent can list, download, inspect and delete local models, generate text, hold chat conversations, create text embeddings, and check whether the Ollama server is running. Output can be machine-readable JSON that the agent can parse.

  • Model management: list, show, pull, rm, copy and ps (models loaded in memory)
  • Text generation and chat
  • Embeddings from one or more inputs
  • Server status and version checks
  • Session status and chat history

What you need before installing

The skill needs Python 3.10 or newer and Ollama installed and running. The CLI cannot work without an Ollama server. The source starts it with ollama serve.

The CLI talks to a host URL. By default this is the local machine, but you can point it at another machine on your network.

  • Python 3.10+
  • Ollama installed and running (ollama serve)
  • The pip package cli-anything-ollama
  • A local or remote Ollama server reachable at a host URL
pip install cli-anything-ollama

How to install the skill

Download the ZIP from this page and unzip it. The skill folder contains SKILL.md. Place the folder in your personal skills directory ~/.claude/skills/, or in a project's .claude/skills/ folder if you want it limited to one project.

You can also upload the ZIP in the Claude apps under Settings → Capabilities → Skills.

The skill's install instructions also use pip to install the CLI itself. Install the package and confirm it works by running the help command.

  • Personal: ~/.claude/skills/
  • Single project: .claude/skills/ inside the project
  • Claude apps: Settings → Capabilities → Skills, then upload the ZIP
pip install cli-anything-ollama cli-anything-ollama --help

How to ask the agent to use it

You do not need to type commands yourself. Describe the outcome in plain language and mention Ollama or local models so the agent picks up the skill. Name the model if you have a preference, such as llama3.2 or nomic-embed-text for embeddings.

Good requests name the action and the model, for example asking the agent to list your local models, pull a model, or generate an embedding. Ask for JSON output if the result will be processed by another script.

  • "Using Ollama, list the models I have locally."
  • "Pull llama3.2 with Ollama and show its details."
  • "Ask llama3.2 locally to explain quantum computing in one sentence, without streaming."
  • "Create embeddings for these two sentences with nomic-embed-text and return JSON."

Examples of commands the agent runs

These are the commands the source documents. The agent uses the same forms. Human-readable output is the default; the --json flag gives structured output for agents.

For chat, the source shows messages written as role:text pairs, and a JSON file can also be passed with --file. To use a remote Ollama server, pass --host with its URL.

  • Generation without streaming, returning JSON, is the form the source recommends for agents.
  • Multi-turn chat repeats the --message flag.
  • Remote hosts use the --host flag before the subcommand.
cli-anything-ollama --json model list cli-anything-ollama model pull llama3.2 cli-anything-ollama --json generate text --model llama3.2 --prompt "Hello" --no-stream cli-anything-ollama generate chat --model llama3.2 --message "user:What is Python?" --message "user:How does it compare to JavaScript?" cli-anything-ollama embed text --model nomic-embed-text --input "Hello" --input "World" cli-anything-ollama --host http://192.168.1.100:11434 model list

Safety notes: scripts, network and local storage

This skill runs scripts and uses the network. Prompts are sent to the Ollama server you configure. They stay on your machine when the server is local, and leave it only if you point --host at a remote host.

Model pull and rm commands change what is stored on your machine. Pulling downloads models from the Ollama library, and rm deletes them. If you do not want an agent changing storage unattended, ask it to show the list first and confirm before pulling or deleting.

  • Check the host URL before sending sensitive prompts
  • Review pull and rm requests before the agent runs them
  • The source does not describe a permission model, so review what the agent runs

Tips for reliable results

The source gives four habits for programmatic use. Always use --json, check return codes (0 means success, non-zero means error), parse stderr for error messages, and use --no-stream for generate and chat so you get complete responses. Ask the agent to run server status before other commands if something fails.

If you need more detail, the package includes README.md and TEST.md, which the source references.

  • Always use --json for parseable output
  • Check return codes: 0 is success
  • Read stderr for errors
  • Use --no-stream for complete responses
  • Run server status first when troubleshooting
cli-anything-ollama server status

What people use it for

  • Listing and pulling models so an agent can prepare a local environment
  • Generating text from a local model in a script that expects JSON
  • Holding multi-turn chats with a local model from an agent workflow
  • Creating embeddings from local models without a graphical app
  • Running Ollama on another machine on your network and querying it with --host

Frequently asked questions

Is cli-anything-ollama free to use?

The skill is listed under the Apache-2.0 licence. Ollama itself is a separate program that you install and run on your own computer or server, and this skill does not add any hosted service or charge.

What do I need to install before the skill works?

You need Python 3.10 or newer, Ollama installed and running with ollama serve, and the pip package cli-anything-ollama. The CLI cannot work without a running Ollama server.

Does this skill send my prompts to the cloud?

Not by default. The CLI talks to a local Ollama server, so prompts stay on your machine. They only go to another machine if you set --host to a remote Ollama server URL.

How do I install the skill for Claude?

Download the ZIP from this page and unzip it. Put the folder in ~/.claude/skills/ for personal use or in a project's .claude/skills/ folder, or upload the ZIP in the Claude apps under Settings → Capabilities → Skills.

Why does the agent need --json and --no-stream?

The source recommends --json so output is structured for parsing, and --no-stream so generate and chat return complete responses instead of partial streamed text.

What should I do if the agent cannot reach Ollama?

Confirm Ollama is running with ollama serve, then run cli-anything-ollama server status. If a remote host is set, check the --host URL. The source advises reading stderr for error messages.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Use this skill if you want an agent to manage and query local Ollama models, especially if you need JSON output or embeddings on a machine you control. Skip it if you do not already run Ollama, want a cloud-hosted model API, or are not comfortable letting an agent pull or delete models without checking first.

Download the skill