| name | dev-link |
| description | Swap between local n-dx development build and published npm version |
| argument-hint | [local|npm] |
Swap between using the local development build of n-dx and the published npm version.
Commands
/dev-link local — Link the local packages/core build globally so ndx uses your dev code
/dev-link npm — Unlink local and install @n-dx/core from the npm registry
/dev-link (no argument) — Show which version is currently active and where it resolves from
Switch to local dev build
- Ensure the local build is current:
pnpm build --filter @n-dx/core
- Remove the npm-installed version if present:
pnpm remove -g @n-dx/core
- Link from the core package directory:
cd packages/core && pnpm link --global
- Verify:
pnpm ls -g --depth=0 should show @n-dx/core link:...packages/core
- Verify binaries:
which ndx should resolve to the pnpm global bin, ndx --version should match local
Switch to npm registry version
- Remove the global link:
pnpm remove -g @n-dx/core
- Install from npm:
pnpm add -g @n-dx/core
- Verify:
pnpm ls -g --depth=0 should show @n-dx/core X.Y.Z (a version number, not a link)
- Verify binaries:
ndx --version should match the published version
Show current state
- Run
pnpm ls -g --depth=0 and check @n-dx/core entry
- If it shows
link:... — local dev build is active
- If it shows a version number — npm registry version is active
- Also check
which ndx and ndx --version to confirm binary resolution
- Report clearly: "Currently using: local dev (linked from packages/core)" or "Currently using: npm v{X.Y.Z}"
- Show the command to swap to the OTHER mode:
- If currently local: "To switch to npm:
/dev-link npm"
- If currently npm: "To switch to local dev:
/dev-link local"
Windows (PowerShell / cmd)
The pnpm commands above are cross-platform and identical on Windows. Only two things differ: the binary-resolution check (which → Get-Command/where) and command chaining (&& is not valid in cmd or Windows PowerShell 5.1). Run the cd as its own step.
Switch to local dev build:
pnpm build --filter @n-dx/core
pnpm remove -g @n-dx/core # ignore error if not installed
cd packages\core
pnpm link --global
cd ..\..
pnpm ls -g --depth=0 # expect: @n-dx/core link:...\packages\core
Get-Command ndx # PowerShell — resolves to the pnpm global bin
ndx --version # should match local
Switch to npm registry version:
pnpm remove -g @n-dx/core
pnpm add -g @n-dx/core
pnpm ls -g --depth=0 # expect: @n-dx/core X.Y.Z (a version, not a link)
ndx --version # should match published version
Notes for Windows:
- Binary check:
Get-Command ndx in PowerShell, or where.exe ndx in cmd (the which equivalent).
- Chaining: PowerShell 7+ accepts
&&; cmd accepts &&; Windows PowerShell 5.1 does not — use ; or separate lines.
- Path separators: use
packages\core (or packages/core — pnpm accepts both).
- Ensure pnpm's global bin is on
PATH. Run pnpm setup once if ndx is not found after linking, then restart the shell.
Important notes
- Always use
pnpm (not npm) for global link/install — this repo uses pnpm and binaries resolve through pnpm's global bin directory
- The global package name must be
@n-dx/core (from packages/core/package.json) — never link from the monorepo root (which has name n-dx and no bin entries)
- After switching to local, remember to
pnpm build after code changes for them to take effect via the global link
- The link registers these binaries:
ndx, n-dx, rex, hench, sourcevision, sv