Skip to main content
Version: 3.14 Beta (Latest)

OHIF CLI removal

platform/cli (@ohif/cli) and the root cli script were deleted. The CLI was never published (it was private: true) and its link commands had been broken since the pnpm migration (they spawned yarn link).

Everything the CLI did is now covered by four things you can use directly:

  • pnpm add -w <pkg> to install a plugin at the workspace root,
  • an entry in platform/app/pluginConfig.json to register it (edit the file directly, or use the helper),
  • create-ohif (pnpm create ohif) to scaffold a new extension or mode,
  • a directory entry in pluginConfig.json to point at a local checkout in place of the old link commands.

Command replacements​

Old commandReplacement
create-extension / create-modepnpm create ohif (Create an Extension or Mode)
add-extension / add-modepnpm add -w <pkg> + a pluginConfig.json entry, or pnpm run plugin add <pkg>
remove-extension / remove-modepnpm run plugin remove <pkg>
link-extension / link-modedirectory entry in pluginConfig.json (pnpm run plugin link <path>)
unlink-extension / unlink-modepnpm run plugin unlink <pkg>
listpnpm run plugin list
searchnpm search keywords:ohif-extension / npm search keywords:ohif-mode

pnpm run plugin add still brings in a mode's extensions: it installs and declares the OHIF extensions and modes the package lists as peers (--no-peers to skip). plugin remove removes only the package you name; pnpm run plugin doctor flags anything left missing or undeclared. See Extension installation for the from-npm, from-checkout, and in-tree forms of a registration entry.

Porting an extension or mode generated by the old CLI​

An extension or mode scaffolded by the old CLI will not build or load as-is under the current contract. The mechanical rewrites are done for you by pnpm create ohif migrate ./path-to-your-plugin --dry-run, and the deep, item-by-item walkthrough — with the CLI-era template quoted verbatim — lives in CLI-era extension → 2026 plugin contract. The short version:

  1. Broken dev script. The extension template's "dev" pointed at .webpack/webpack.dev.js but the template shipped only .webpack/webpack.prod.js; the mode template shipped no .webpack/ directory at all. Re-scaffold with pnpm create ohif and move src/ across, or, if you keep the old config, point dev at the file that exists:

    - "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.dev.js --watch --output-pathinfo",
    + "dev": "cross-env NODE_ENV=development webpack --config .webpack/webpack.prod.js --watch --output-pathinfo",
  2. Drop the @ohif/ui external. The template externalized @ohif/ui, a package that no longer exists (@ohif/ui-next replaced it). Align with the host contract instead:

    externals: [/\b(vtk.js)/, /\b(dcmjs)/, /\b(gl-matrix)/, /^@ohif/, /^@cornerstonejs/, 'react', 'react-dom', 'react/jsx-runtime', 'react-router', 'react-router-dom', 'i18next', 'react-i18next'],

    React was not external in the old templates' effective builds — adding it is the contract change. Never bundle React. React Router and i18next are new externals too: the viewer shares its copies, so a plugin uses the viewer's Router and translations.

  3. Modern library shape. Replace the template's split library: / library.type output — which declared library twice, so the old build never reliably emitted the UMD bundle it documented — with:

    output: { library: { name: pkg.name, type: 'umd' } },
  4. Adopt publishConfig. See Publish an Extension or Mode. Working-tree entries stay on src/*; the tarball entries are rewritten to dist/*. Publish with pnpm publish only — the npm CLI ignores the rewrites.

  5. Early-3.13 template typo. If your scripts contain pnpm rundev / pnpm runbuild, add the missing space.

  6. Keep the keywords. ohif-extension / ohif-mode remain the discovery convention and are what npm search and pnpm run plugin doctor key off.

For the reasoning behind each rewrite — the duplicate output.library key, the externals before/after, and the package.json shape — read the full porting guide.

If your customizations live inside a fork of the Viewers repo rather than in a standalone extension, see the De-forking guide for moving them out into a plugin you register through pluginConfig.json.