Introduction

The philosophy of DSH is “Everything is a plugin”. While session-level dynamic plugins can be used directly in dsh, if you want to solidify them into repeatable dsh installation packages or save them as portable packages that can be imported across sessions, you still need to organize the artifacts. To address this step, dsh-mycordis provides Cordis plugin management and one-click packaging capabilities.

What is this

dsh-mycordis is a dsh session-level dynamic plugin. It is used to manage Cordis plugins and pack dsh session-level dynamic Cordis plugins into dsh installation packages (.tgz) or portable packages (.dshplugin.json).

The license is MIT. The repository address is:

https://github.com/LA7-F/dsh-MyCordis

Core Features

  • Pack dsh session-level dynamic Cordis plugins into dsh installation packages (.tgz)
  • Generate portable packages (.dshplugin.json) for cross-session import or registration
  • Support single and batch one-click packing, and switch between dsh package/portable package/whole package types
  • Install / Uninstall dsh plugins (real installation at profile level)
  • Import portable packages (register only, do not run, can restore to start)
  • Favorites, pinning, recovery, copy cross-session location info, de-duplicate plugins with the same name
  • Security hardening: Trust fence, request body limits, error sanitization, etc.

Installation & Enablement

One of the recommended installation methods provided is as follows. The first line installs from the npm registry, and the second line restarts dsh:

pnpm dsh plugin --profile web add dsh-mycordis
pnpm dsh --profile web

Real installation writes to:

$DSH_HOME/profiles/<profile>

It takes effect after restarting dsh.

Typical Usage

Pack Whole Package

First, set the output directory, then select the “Whole Package” type. Then check the plugins, click “One-click Pack” to batch pack; you can also click “Pack” on each row for individual packing.

Packing a whole package produces both a dsh installation package (.tgz) and a portable package (.dshplugin.json), one subdirectory per plugin.

Install dsh Package

Select and upload a .tgz file, and execute:

dsh plugin add

You may need to approve elevated sandbox permissions, and it takes effect after restarting dsh.

Call HTTP API

You can also call the interface to complete whole package packing:

POST /api/pack-whole

This interface generates .tgz and .dshplugin.json, one subdirectory per plugin.

Applicable Scenarios & Notes

Suitable for people who use dsh session-level dynamic plugins, need to solidify plugins into installation packages or portable packages, and manage these plugins across multiple sessions.

Notes before use:

  • Preview version: Cordis portable packages currently likely only support the Windows platform.
  • Session-level dynamic plugins are process-level states; they need to be re-imported after DSH restarts.
  • Real installation writes to $DSH_HOME/profiles/<profile>, requiring a dsh restart to take effect.
  • Installation, uninstallation, and output outside the workspace require elevated sandbox permissions (popup approval).
  • Import executes the code inside the package within the dsh process; only import portable packages from trusted sources.
  • Request body limits are inconsistent in the documentation: README mentions 10MB and unifies to 413; package.json description mentions 80MB. It is recommended to verify the source code and actual configuration before use.
  • Plugins run with the current dsh process permissions; you should check the source code and license before installing. The license is MIT.

Ending

The value of dsh-mycordis lies in handling the packing, installation, import, and management of session-level dynamic Cordis plugins within the same dsh plugin, reducing the steps of manually organizing artifacts.

Repository address:

https://github.com/LA7-F/dsh-MyCordis