# dsh-skill-viewer
English | [简体中文](README.md)
A DSH plugin for managing skills right from the web UI and terminal
## Features
- Skill card list: preview installed skills; expand a card to read the full content
- Status tags: Enabled / Disabled, styled like the built-in plugin list
- Management: hot enable/disable switch, delete, search by name; the page refreshes on entry
- Add skills (0.7.0 unified entry): click “+” and pick files (`.md` / `.zip`), or drag files, archives or skill folders straight onto the page — the structure is auto-detected (bundle / flat files / archive) and invalid content is rejected with a reason
- **Workspace views** (0.3.0): a skill's files live directly where they belong — global skills in `~/.dsh/skills`, workspace skills in that workspace's `.dsh/skills`. A workspace bar below “Skills” (Global + each workspace, horizontally scrollable) filters the list to one scope.
- **Batch migration**: the button left of “+” opens a dialog where you pick the source workspace, one or more target workspaces, and the skills yourself, then batch-**copy** or batch-**move** them (nothing pre-selected; items migrate independently — one failure never aborts the rest; move mode allows a single target). When the source scope has groups, you can filter skills by group above the list (0.7.0).
- **Skill groups** (0.5.0): a second bar below the scope bar (All + group names, horizontally scrollable) filters the list to one group. The “Groups” button (left of the migrate button) opens the group editor: create/rename/delete groups, pick a scope, name the group and batch-check members. Groups live only in the plugin's own display config (`~/.dsh/skills/.system/skill-viewer/groups.json`) — skill directories are never touched.
- **Scope-exact operations** (0.6.4): when the same skill name exists in both the global scope and a workspace, delete, enable/disable and content views act on exactly the (name, scope) row you clicked — each row expands and operates independently, other copies are never touched. Missing entries in the given scope fail loudly instead of falling back. The CLI likewise requires `--global` / `--project` / `--workspace` to disambiguate same-name skills in `enable`/`disable`/`delete`.
## Install
1. Install the package (its bundle layer auto-mounts it — no config editing)
```bash
dsh plugin --profile web add https://github.com/Fishquito7/dsh-skill-viewer/releases/download/v0.7.0/dsh-skill-viewer-0.7.0.tgz
```
> Prefer the release tarball: no git involved, no pnpm v11 build-script
> restriction. Installing from git also works (git-hosted dependencies are
> blocked from running their prepare build scripts by default; if you see
> “git-hosted plugins build on install...”, add the key pnpm printed above
> under `allowBuilds` in the profile's `pnpm-workspace.yaml` and re-run):
>
> ```bash
> dsh plugin --profile web add github:Fishquito7/dsh-skill-viewer
> ```
2. Restart the gateway
```bash
dsh-restart
```
Then refresh the page: Settings → Skills appears right below Plugins.
## CLI
The package ships a `dsh-skill` command for terminal-based management (also hot; works while the gateway is down):
```bash
dsh-skill list # list skills (with scope: global / workspace)
dsh-skill add # add to global (.md file, bundle dir, or .zip archive)
dsh-skill add --workspace D:\projA # add directly into a workspace
dsh-skill scope --global # migrate one skill to global
dsh-skill scope --workspace D:\projA # migrate one skill into a workspace (--copy to copy)
dsh-skill migrate --from --to [--copy] [--yes]
dsh-skill update [--profile ] # check for updates and install (default profile: web)
# batch migrate (copy or move)
dsh-skill disable # disable
dsh-skill enable # enable
dsh-skill delete # delete (asks for confirmation)
```
The CLI only scans the cwd-anchored project roots and the user roots; add `--cwd ` to manage a different workspace's skills. If a skill name exists in several scopes, `enable`/`disable`/`delete` require `--global`/`--project`/`--workspace` to pick which copy to operate on.
## How it works
The plugin doesn't parse skills itself — it's just a management surface over the skill files: every action in the page (or via `dsh-skill`) ends up as a change to the skill files on disk (`SKILL.md`), and DSH's own file watcher notices immediately. That's why enable/disable, add, delete and migration are all hot — no gateway restart.
- A skill's entity lives directly in its scope folder: global = `~/.dsh/skills`, workspace = `/.dsh/skills` — no hidden store, no junctions: after uninstalling the plugin the skills are plain files DSH keeps discovering
- Disable = rename `SKILL.md` to `SKILL.md.disabled`, enable = rename it back
- Changing where a skill lives = physically copying/moving the files into the target workspace folder (validated first, rolled back on failure)
- Deployment-bundled skills are read-only: they cannot be disabled or deleted
## Development
The source is TypeScript under `src/`; the compiled `lib/*.js` is committed with the repo (so git installs keep working). After editing, run `pnpm build`: `tsc` compiles to `lib/` and strips the extra module marker from the browser bundle. `npm pack` rebuilds automatically via prepack — no manual compile step.
## Uninstall
```bash
dsh plugin --profile web remove dsh-skill-viewer
```
## License
MIT