返回目录
模型与 MCP 待识别

dsh-gitnexus

devwangxiaogang/dsh-gitnexus

GitNexus code-graph plugin for DeepSeek Harness — 17 MCP graph tools, one-command install, Chinese skills.

Stars
0
Forks
0
Issues
0
更新
15 天前

PROJECT TOPICS

项目标签

PROJECT README

README

dsh-gitnexus

Brings GitNexus code-graph capabilities into DeepSeek Harness, and fixes the three practical problems around it: installing it, finding it, and knowing how to use it.

  • 17 graph tools (mcp__gitnexus__query, impact, context, trace, detect_changes, cypher, explain, check, rename, ...) mounted as an MCP stdio server, available in every session.
  • 4 Chinese skills covering overview, install/index, exploration, and impact analysis, so the model knows when to query the graph and how to read the results.
  • One-command setup: dsh-gitnexus setup . installs GitNexus, builds the index, and verifies the artifacts really landed on disk.
  • Never breaks boot: when the CLI or a real Node binary is missing the plugin logs one actionable hint, keeps the skills available, and can auto-install in the background with autoInstall: true.

Chinese documentation: README.zh.md.

Why this plugin exists

GitNexus ships as a global npm CLI (gitnexus); DSH knows nothing about it. Adding GitNexus as a pnpm dependency of the DSH profile fails twice over:

  1. its postinstall compiles tree-sitter grammars, which pnpm blocks by default (ERR_PNPM_IGNORED_BUILDS);
  2. the skills GitNexus ships are PolyForm Noncommercial licensed and should not be redistributed.

This plugin therefore depends on Node builtins only (no build step, no postinstall), discovers an already-installed gitnexus CLI at runtime, and launches gitnexus mcp with a real Node executable; it ships its own originally written skills.

Why a real Node binary, not the Electron-bundled Node

DSH Desktop is an Electron app, so process.execPath points at electron.exe. GitNexus relies on LadybugDB's native addon (lbugjs.node), which is compiled for a regular Node ABI: inside Electron's Node it fails with A DLL initialization routine failed and the MCP initialize request hangs until timeout. With a real node.exe child the handshake completes in about one second and all 17 tools are listed. The plugin probes nodePath → GITNEXUS_NODE → non-Electron process.execPath → PATH → common install dirs / nvm·volta·fnm, executing each candidate once to validate its version and reject Electron runtimes. The required range is ^22.18.0 || >=24.11.0.

Prerequisites

  • DSH Desktop 0.2.2-rc.1+ — the plugin consumes the host-provided @deepseek-ai/dsh-mcp-client and dsh-skill-filesystem;
  • Node.js ≥ 22.18 (or ≥ 24.11) — runs both the dsh-gitnexus CLI and the GitNexus MCP child process;
  • network access for the first GitNexus install (~220 MB).

Install

Option A — install from GitHub (recommended)

dsh plugin --profile desktop add github:devwangxiaogang/dsh-gitnexus#v0.1.0

#v0.1.0 is a repository tag (use #main to track the latest code). GitHub serves a source archive for every tag, so no release asset is required; the same spec can be pasted into the DSH plugin manager's install box.

Option B — install from a local tarball

npm pack --pack-destination dist
dsh plugin --profile desktop add ./dist/dsh-gitnexus-0.1.0.tgz

Then run:

dsh-gitnexus setup .

After installation the dsh-gitnexus bin is linked into the profile's node_modules/.bin (e.g. D:\Apps\dsh-data\dsh-home\profiles\desktop\node_modules\.bin\dsh-gitnexus.cmd), which is not on your system PATH. Either add that directory to PATH or invoke the script directly:

node "D:\Apps\dsh-data\dsh-home\profiles\desktop\node_modules\dsh-gitnexus\bin\dsh-gitnexus.mjs" setup .

Installing the local .tgz through the DSH plugin manager applies immediately (verified here: all 17 mcp__gitnexus__* tools showed up in the running session without a restart). Installing through dsh plugin ... add on the command line is best done with DSH closed; it takes effect on the next start.

setup runs npm install -g gitnexus@latest (npm 11 may skip install scripts, but prebuilt natives ship inside the tarball), then gitnexus analyze . --skip-agents-md --skip-skills (the defaults keep your AGENTS.md / CLAUDE.md / .claude/skills untouched; pass --agents-md for GitNexus's own repo integration), then checks that <repo>/.gitnexus exists. The mcp__gitnexus__* tools are available once the plugin is loaded.

Do not run gitnexus setup — that is GitNexus's own installer, which writes MCP entries for Cursor / Claude Code and installs its skills. The plugin's command is dsh-gitnexus setup.

Configuration

- insert:
    - id: gitnexus
      name: dsh-gitnexus
      config:
        serverName: gitnexus
        cliPath: ""              # explicit .../gitnexus/dist/cli/index.js
        nodePath: ""             # explicit real Node binary used for the MCP child
        autoInstall: false       # background `npm i -g gitnexus` when missing
        installScope: global     # global | local (local = plugin-private dir, no admin)
        toolCallTimeoutMs: 120000
        cwd: ""
        env: {}                  # extra child env, e.g. GITNEXUS_MCP_READ_ONLY=1
        skills: true
        skillProviderName: gitnexus
        debug: false

CLI discovery order: cliPath → GITNEXUS_CLI / GITNEXUS_BIN → plugin-private dir → npm global roots → nvm/volta/fnm → gitnexus(.cmd|.exe) on PATH (shim contents are parsed).

Node discovery order: nodePath → GITNEXUS_NODE → non-Electron process.execPath → PATH → common install dirs → nvm/volta/fnm version dirs. Each candidate is executed to validate version and to reject Electron.

Env var Purpose
GITNEXUS_CLI explicit CLI entry
GITNEXUS_BIN alias of the above
GITNEXUS_NODE explicit real Node binary for the MCP child

CLI

dsh-gitnexus status [--json]         Node / CLI / index status, tool prefix
dsh-gitnexus install [--local]       install gitnexus (--version, --dry-run)
dsh-gitnexus setup [repo]            install + index (--no-install, --embeddings, --agents-md)
dsh-gitnexus analyze [repo]          passthrough gitnexus analyze
dsh-gitnexus doctor | list | uninstall
dsh-gitnexus cli <subcommand>        passthrough any gitnexus subcommand

Tools and skills

Graph tools (exactly 17): list_repos, query, context, impact, detect_changes, trace, check, explain, pdg_query, cypher, rename, group_list, group_sync, route_map, tool_map, shape_check, api_impact. Resource URIs: gitnexus://repos, gitnexus://setup, gitnexus://repo/{name}/....

query is semantic search and returns empty results unless the index has embeddings; context / impact / trace / cypher / check / detect_changes work without them. Generate vectors with gitnexus embeddings sync <repo> or dsh-gitnexus setup . --embeddings.

Skills: gitnexus (overview), gitnexus-install (install/index/troubleshooting), gitnexus-explore (locate code), gitnexus-impact (regression scope, call paths, safe rename).

The index lives in <repo>/.gitnexus.

Development

node --test test/                       # 61 unit tests, no DSH runtime needed
node bin/dsh-gitnexus.mjs status
node ../scratch/verify-mcp-node.mjs     # end-to-end: real Node child, asserts 17 tools
npm pack --pack-destination dist

Plain ESM, zero runtime dependencies, no build step, no postinstall. @deepseek-ai/dsh-mcp-client and @deepseek-ai/dsh-skill-filesystem are optional peers provided by the DSH host.

License

Plugin code is MIT. GitNexus itself is PolyForm Noncommercial 1.0.0; this plugin only invokes its CLI and does not copy its code or skill files. Check that GitNexus licensing fits your use case before relying on it.

CLASSIFICATION EVIDENCE

分类依据

项目类型待识别
功能分类模型与 MCP
规则置信度高

系统优先读取 GitHub Topics,再与站内分类词典和词根规则比对。当前命中: mcp、deepseek-harness。