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

    Commandcode

    @falentio/opencode-commandcode·v0.1.0·其他

    OpenCode plugin for CommandCode

    GitHub 星标

    0

    月装机量

    0

    综合评分

    20.0

    生态多维模型

    最近提交

    1 小时前

    2026-09-12

    快速安装与配置

    opencode.json

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

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@falentio/opencode-commandcode@0.1.0"]
    }

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

    An OpenCode plugin for CommandCode.

    Install

    Add the plugin to your opencode.json:

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["@falentio/opencode-commandcode"]
    }
    

    OpenCode installs npm plugins automatically with Bun at startup.

    What it does

    • Logs plugin initialization and session-idle events via client.app.log.
    • Registers a commandcode tool that OpenCode can call.
    commandcode: <command> (<directory>)
    

    Development

    Requires Node 24+ and pnpm.

    pnpm install
    pnpm dev        # vp pack --watch
    pnpm typecheck  # tsc --noEmit
    pnpm test       # vp test
    pnpm build      # vp pack
    

    Build output goes to dist/ (ESM + type declarations) via vp pack (tsdown).

    Project layout

    Path Purpose
    src/index.ts Plugin entry, exports CommandCodePlugin
    src/index.test.ts Vitest tests
    vite.config.ts Vite+ config, incl. the pack block
    .github/workflows/ci.yml Typecheck, build, test on PR/push
    .github/workflows/publish.yml Trusted publishing on v* tags

    Releasing

    Publishing uses npm trusted publishing over GitHub Actions OIDC. No npm token is stored in the repo.

    One-time npm setup (package → Settings → Trusted publishing → GitHub Actions):

    • Organization or user: falentio
    • Repository: opencode-commandcode
    • Workflow filename: publish.yml
    • Allowed actions: npm publish

    Then cut a release:

    pnpm release   # bumpp: bump version, commit, tag
    git push --follow-tags
    

    The v* tag triggers .github/workflows/publish.yml, which builds and runs pnpm publish. Provenance attestations are generated automatically.

    repository.url in package.json must exactly match the GitHub repo, or npm will reject the OIDC publish.

    License

    MIT

    同类生态推荐