Skip to content
Agentmart
Submit a tool

ollama-sync

Synchronizes the list of available models in the 'opencode.json' configuration file's 'ollama' provider models list with the actual models available on the…

Skill by mskadu

IndexedMIT★ 1
Write a review

Install

Works with Claude Code, Claude apps, Codex, Cursor, Gemini CLI, GitHub Copilot, VS Code, OpenCode, Goose, Windsurf. Read the repository before you give any tool access to your data.

npx agentmarket install skill/mskadu-ollama-sync

Asks which of your tools to add it to (Claude Code, Codex, Cursor, VS Code, Windsurf, Gemini CLI, Claude Desktop) and shows the change first. See https://agentmart.dev/cli.

Get the weekly diff

The weekly diff: one email a week with new agent tools, notable updates and grade changes, plus security alerts for tools you follow. Double opt-in, one-click unsubscribe.

We use your email only for this newsletter. Privacy

About

Synchronizes the list of available models in the 'opencode.json' configuration file's 'ollama' provider models list with the actual models available on the system via the 'ollama list' command.

No reviews yet. Installed it? Reviews come from verified installers only. How reviews work

Permissions

What this skill can do and what it asks for, from its SKILL.md. Checked Oct 25, 2026.

Tools
No tools found
Secrets
None asked for
Install scripts
None found

Network hosts it talks to 1

  • codeload.github.com · found in install command

Files it touches

  • ~/.claude/skills/ollama-sync

What's inside

Skill name
ollama-sync
Description
Synchronizes the list of available models in the 'opencode.json' configuration file's 'ollama' provider models list with the actual models available on the system via the 'ollama list' command.
License
MIT
Compatibility
opencode
Instructions
48 lines in SKILL.md · view on GitHub

Agent Skills spec issues

  • allowed-tools: must be a space-separated string

Files (2)

  • README.md
  • SKILL.md

SKILL.md (first lines)

# Ollama Model Synchronizer

## Your Task
When asked to synchronize the local Ollama configuration, your primary goal is to ensure that the model list in the `opencode.json` file is an accurate reflection of the models available on the host system.

The process must involve three main steps:

1. **Fetch Live List:** Execute `ollama list` via the bash tool to retrieve all currently available model names and tags on the machine.
2. **Parse and Extract:** Parse the output of `ollama list` to extract only the clean list of model names (e.g., `llama2`, `mistral`).
3. **Update Config:** Use the `edit` tool to replace the existing model list in `opencode.json` (specifically the `ollama` provider section) with the newly fetched, accurate list.

## Workflow Details

1. **Primary Command Execution:**
   - Run `ollama list` using the `bash` tool.
2. **Parsing Logic (Internal):**
   - The output of `ollama list` needs to be parsed to isolate model names. Assume the output format is reliable enough to grep for model names.
3. **File Manipulation:**
   - Use the `read` tool on `opencode.json` to understand the current structure.
   - Use the `edit` tool to modify the specific section containing the model list.

### Step-by-step Logic
1. **Check Dependency:** Confirm if the `ollama` command is available in the execution environment.
2. **Get System Models:** Execute `ollama list` to get the current list of models.
3. **Isolate Names:** Programmatically parse the output to create a comma-separated string of model names.
4. **Write Back:** Use the `edit` tool to replace the old model list with the new comma-separated list in `opencode.json`.

## Examples & Edge Cases
*   **Empty List:** If `ollama list` returns no models, the `opencode.json` model list should be cleared or set to an empty array, and the user should be warned.
*   **Error Handling:** If the `ollama` command fails or is not found, the process must stop, and the user should be informed that the synchronization failed due to environment issues.

## Target File Structure (Conceptual)
The target file is `opencode.json`. The relevant section looks like this (structure for context):

```json
"providers": {
    "ollama": {
        "models": ["model-a", "model-b", "model-c"], // <-- This list must be updated
        "base_url": "http://localhost:11434"
    },
    // ... other providers
}
```

Always prioritize using the `bash` tool for OS interactions (`ollama list`) and the `edit` tool for configuration management.
---

From mskadu/opencode-agent-skills, MIT.

Signals

Stars
1
Forks
0
Open issues
0
Last commit (this folder)
Jun 6, 2026 (4 months ago)

From GitHub (fetched Oct 24, 2026).

Details

License
MIT
First seen
Oct 24, 2026
Last checked
Oct 24, 2026

More from mskadu

Cite this page

ollama-sync skill. Agent Mart. https://agentmart.dev/skills/mskadu-ollama-sync (last updated 2026-10-24)