npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

open-workspace

v0.2.1

Published

Multi-root workspace support for OpenCode and Claude Code via MCP, enabling VS Code .code-workspace file parsing and cross-directory operations.

Readme

open-workspace

Multi-root workspace support for OpenCode and Claude Code, enabling VS Code .code-workspace file parsing and cross-directory operations.

Why

AI coding assistants typically operate in a single project directory. If your codebase spans multiple repositories (monorepo siblings, mobile + web + backend, etc.), you can't search or read across them natively. This plugin bridges that gap by leveraging the same .code-workspace files VS Code uses.

Install

建议使用 npm 上的包 + npx:无需克隆仓库,也不必手写本机 dist/server.js 路径。包名:open-workspace(当前版本可用 npm view open-workspace version 查看)。

MCP Server(Claude Code + OpenCode)— 推荐

需要 Node.js 18+。MCP 走的是包内 bin 入口(open-workspacedist/server.js)。

Claude Code

claude mcp add open-workspace -- npx -y open-workspace@latest

或在项目根目录 .mcp.json

{
  "mcpServers": {
    "open-workspace": {
      "command": "npx",
      "args": ["-y", "open-workspace@latest"],
      "env": {
        "WORKSPACE_DIR": "/path/to/your/project"
      }
    }
  }
}

OpenCode(opencode.json / opencode.jsonc

{
  "mcp": {
    "open-workspace": {
      "type": "local",
      "command": ["npx", "-y", "open-workspace@latest"],
      "enabled": true,
      "environment": {
        "WORKSPACE_DIR": "/path/to/your/project"
      }
    }
  }
}

Note: WORKSPACE_DIR 可选;省略时使用当前工作目录。首次 npx 拉包会略慢,之后会复用缓存。

固定版本(可选)

open-workspace@latest 换成 [email protected] 等,避免次版本自动升级。

从源码运行 MCP(不推荐日常)

若你已克隆本仓库并完成 npm install && npm run build

claude mcp add open-workspace -- node /absolute/path/to/open-workspace/dist/server.js

OpenCode 原生插件(不按 MCP)

与 MCP 二选一即可;插件走 @opencode-ai/plugin,不启动独立 MCP 进程。

npm install open-workspace
{
  "plugin": ["open-workspace"]
}

Skills(OpenCode 斜杠命令)

安装 同一 npm 包 后,技能文件在包目录的 skills/ 下(全局或项目本地均可)。

全局安装:

npm install -g open-workspace
ln -sf "$(npm root -g)/open-workspace/skills" ~/.config/opencode/skills/open-workspace

仅装在当前项目:

npm install open-workspace
ln -sf "$(pwd)/node_modules/open-workspace/skills" ~/.config/opencode/skills/open-workspace

改完后重启 OpenCode。仍可从 本仓库 skills 目录ln -s 指过去。

维护者

发布流程、npm 令牌与 GitHub Actions(NPM_TOKEN、Release 发版等)见 docs/MAINTAINERS.md

从源码参与开发

git clone https://github.com/FuDesign2008/open-workspace.git
cd open-workspace
npm install
npm test
npm run build
npm test        # Vitest
npm run test:watch

测试覆盖 parserstateworkspace-tool-core(临时目录下的 list / select / read / grep / glob 等)。

Setup

Create a .code-workspace file in your project root (or use an existing one from VS Code):

{
  "folders": [
    { "path": "../bulb" },
    { "path": "../ydoc" },
    { "path": "../ynote-desktop" },
    { "path": "../ynote-android" },
    { "path": "../ynoteios" }
  ],
  "settings": {}
}

Folder paths are resolved relative to the .code-workspace file location.

Tools

6 tools are available, all prefixed with workspace_:

workspace_list

Find all .code-workspace files in the current project directory.

workspace_select

Select a workspace as the active one for the current session. Once selected, other tools use it automatically without needing the workspace parameter each time.

workspace_select                            # show current selection and available workspaces
workspace_select workspace="bulb-one"       # select by name
workspace_select workspace="clear"          # deselect

When only one .code-workspace file exists, it is auto-selected.

workspace_parse

Parse a workspace file and show all configured folders with their resolved paths.

workspace_read

Read a file from a specific workspace folder. Supports offset and limit for large files.

workspace_read folder="bulb" file="src/index.ts"

workspace_grep

Search file contents across all (or selected) workspace folders using regex.

workspace_grep pattern="useState" include="*.tsx"
workspace_grep pattern="export default" folders="bulb,ydoc"

workspace_glob

Find files by name pattern across all (or selected) workspace folders.

workspace_glob pattern="*.config.*"
workspace_glob pattern="package.json" folders="bulb,ydoc"

Skills (OpenCode Slash Commands)

The plugin ships with 3 skills that register as user-invocable slash commands in OpenCode.

| Skill | Trigger phrases | What it does | |---|---|---| | ows:select | "select workspace", "switch workspace" | Choose which .code-workspace to use | | ows:search | "search workspace", "grep workspace" | Search file contents or find files by name | | ows:read | "read workspace file" | Read files from any workspace folder |

安装方式见上文 Skills(OpenCode 斜杠命令)。链接成功后重启 OpenCode,可出现 /ows:select/ows:search/ows:read

Architecture

src/
  server.ts                # MCP Server entry (stdio transport, registers all 6 tools)
  index.ts                 # OpenCode plugin entry (backward compatible)
  workspace-tool-core.ts   # Shared workspace_* behavior (list/select/parse/read/grep/glob)
  parser.ts                # .code-workspace JSONC parser
  state.ts                 # Session state (active workspace)
  tools/                   # OpenCode tool wrappers (thin; delegate to workspace-tool-core)

The MCP Server (server.ts) and OpenCode plugin (index.ts) share the same behavior via workspace-tool-core.ts (parser.ts, state.ts), and expose tools through different protocols.

License

MIT