跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    wntic

    Ocm

    @wntic/ocm·v1.0.4·MCP 集成

    Plugin marketplace for opencode: install skills, agents, commands, JS plugins and MCP servers from any git repo — once, globally, kept up to date

    GitHub 星标

    1

    月装机量

    2,774

    近 7 天 284

    综合评分

    43.5

    生态多维模型

    最近提交

    9 天前

    2026-09-26

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@wntic/ocm@1.0.4"]
    }

    OpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    CI npm license: MIT for opencode runtime: bun

    Stop copy-pasting opencode skills, agents and commands between repos. ocm installs them from any git repository — once, into your global opencode config — so they work in every project and stay current with one ocm update. Share a whole toolkit with your team as a single git URL.

    ocm demo

    Try it in 30 seconds with the example marketplace, wntic/ocm-demo:

    npm install -g @wntic/ocm
    ocm add https://github.com/wntic/ocm-demo
    # restart opencode, then type /ocm — or /git-kit:commit
    

    Why ocm?

    opencode reads skills, agents and commands from a project's .opencode/ and from your global ~/.config/opencode/, and its plugin setting can load JS plugins from npm. What it does not have is a way to distribute them:

    Copy into each repo's .opencode/ Copy into ~/.config/opencode/ npm plugin setting ocm
    Available in every project — ✓ ✓ ✓
    Skills, agents, commands ✓ ✓ — ✓
    JS plugins and MCP servers by hand by hand JS only ✓
    Updates by hand, per repo by hand npm versions ocm update, plus auto-sync on start
    Share a toolkit with your team commit it to every repo — one package per plugin one git URL
    Asks before running a plugin's code — — — ✓
    Your own files are never overwritten — — — ✓

    A marketplace is just a git repository — start your own from the ocm-demo template and see Write a marketplace.

    Install

    npm install -g @wntic/ocm          # latest
    npm install -g @wntic/ocm@1.0.3    # a specific version
    

    Or with bun:

    bun install -g @wntic/ocm          # for the `ocm` binary on PATH
    bunx @wntic/ocm add <url>          # or run it without installing
    

    The npm package is @wntic/ocm; the binary it installs is ocm. Bun must be on PATH whichever way ocm is installed — the ocm binary is TypeScript run by Bun (bin/ocm.ts, "engines": { "bun": ">=1.0.0" }). Also requires git and opencode.

    Quickstart

    A session against the public demo marketplace, github.com/wntic/ocm-demo — three small plugins for git, review and docs work:

    ocm add https://github.com/wntic/ocm-demo
    ocm list
    

    ocm add clones the marketplace and materializes its plugins (git-kit, review-kit, docs-kit); ocm list shows what landed. Restart opencode to activate, then open /ocm to browse and update plugins across marketplaces, or use a command directly — /git-kit:commit writes a Conventional Commits message for the staged changes.

    ocm update                # pull + re-materialize
    ocm remove ocm-demo       # full teardown
    

    Changes apply on the next opencode start — there is no reload API.

    Commands

    Command What it does
    ocm add <url|path> [--ref <ref>] [--explicit] [--name <name>] [--trust|--no-trust] add a marketplace (github url or local dir)
    ocm init install auto-sync loader
    ocm remove <name> remove a marketplace and its links
    ocm update [marketplace] [--quiet] [--json] [--trust|--no-trust] pull latest changes (all or one marketplace)
    ocm pin <name> <ref> follow a branch or tag
    ocm pin <name> --clear back to the default branch
    ocm list [--all] [--json] list marketplaces and plugins
    ocm search <query> [--enabled-only] [--json] search cached plugin metadata
    ocm info <plugin>[@<marketplace>] [--json] show a plugin's cached record
    ocm install <plugin>[@<mp>] [--force] enable a plugin and materialize its components
    ocm uninstall <plugin>[@<mp>] disable a plugin and remove its links
    ocm enable <plugin>[@<mp>] / ocm disable <plugin>[@<mp>] aliases of install / uninstall
    ocm mode <name> <auto|explicit> change when new upstream plugins install
    ocm trust <name> [--yes] approve a marketplace's executable components
    ocm untrust <name> revoke trust and remove executable components
    ocm scan <url|path|plugin> dry-run: show what would be installed
    ocm validate [path] lint a marketplace repo (default: current directory)
    ocm doctor [--fix] diagnose this installation; --fix applies safe fixes
    ocm loader uninstall remove auto-sync loader
    ocm --version print the version

    Documentation

    • Write a marketplace — the repository format, manifests and validation rules.
    • Reference — how it works, per-plugin installs, exit codes, precedence, config safety, trust, the loader, the TUI, migration.

    Requirements

    Tested on macOS and Linux — CI runs the full test suite and a probe against the real opencode on both. Windows is untested: ocm installs components as symlinks, which Windows restricts.

    Contributing

    Bug reports, marketplaces you'd like listed as examples, and PRs are welcome — see CONTRIBUTING.md. Issues tagged good first issue are a good place to start.

    If ocm saves you copy-pasting skills between repos, a star helps others find it.

    License

    MIT

    同类生态推荐