Skip to content

ai-action/code-ollama

Repository files navigation

Note

TUI is under active development. APIs may change.

Ollama

Code Ollama

NPM

NPM version build codecov

πŸ¦™ Ollama coding agent that runs in your terminal. Read the wiki.

Prerequisites

Set up Ollama.

Quick Start

npx code-ollama

Install

Install the CLI globally:

npm install --global code-ollama

Usage

TUI

Open the TUI:

code-ollama

Or use the alias:

collama

Skills

Skills are Markdown instructions loaded into the system prompt as context. They do not add tools or execute code.

Add project skills:

.code-ollama/skills/<skill-name>/SKILL.md

Add user skills:

~/.code-ollama/skills/<skill-name>/SKILL.md

Project skills load before user skills. Missing directories are ignored, and skills with the same directory name from both locations are both loaded with their source labels. Use /skills in the TUI to show loaded skills.

See example skill .code-ollama/skills/git-commit-staged/SKILL.md.

MCP

Tools can be loaded from stdio Model Context Protocol servers configured in ~/.code-ollama/config.json.

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"]
    }
  }
}

Servers are enabled by default. Skip a server with disabled: true:

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"],
      "disabled": true
    }
  }
}

MCP permissions can control which modes may execute server tools, which tools skip approval in Safe mode, and which tools are blocked entirely:

{
  "mcpServers": {
    "context7": {
      "command": "npx",
      "args": ["-y", "@upstash/context7-mcp"],
      "permissions": {
        "allowedModes": ["safe", "auto"],
        "autoApprove": ["resolve-library-id", "get-library-docs"],
        "deny": []
      }
    }
  }
}

allowedModes defaults to ["safe", "auto"]; include "plan" to allow MCP tools during Plan mode. autoApprove and deny use server-native MCP tool names. deny wins over both allowedModes and autoApprove.

MCP tools are exposed to the model with names like mcp__context7__resolve_library_id and use the existing tool approval flow. Use /mcp in the TUI to inspect configured servers, loaded tools, disabled servers, permissions, and startup errors. MCP tools are available in Plan mode only when "plan" is included in permissions.allowedModes.

CLI

Show the version:

code-ollama --version

Show the help:

code-ollama --help

Run a one-off prompt:

# code-ollama run --trust <model> <prompt>
code-ollama run --trust gemma4 "review diff"

License

MIT