Dor Tools

@dor-tools/suite

Dormouse's built-in Tools: builtin:file (the local-file viewer with its text, Markdown, and image editors), builtin:code (the source editor), and builtin:folder. Dormouse bundles them. This folder's dormouse.yml also declares them as file, code, and folder, so a copy you change runs from here as your own Tools. The bundled ones stay the default, and stay reachable as builtin:file, builtin:code, and builtin:folder.

Build

From the root of this repository:

pnpm install
pnpm --filter @dor-tools/suite build

Each Tool runs node dist/main.js <file|code|folder> <target> with the node on your PATH. Rebuild after a change, then close the open Tool and open the file again.

Use your copy

Import the Tools into your user file, ~/.config/dormouse/dormouse.yml (or $XDG_CONFIG_HOME/dormouse/dormouse.yml), and add open rules sending files and folders to them. from is this folder, relative to the user file or absolute, with no ~ or $; this example has this repository cloned at ~/.config/dormouse/dor-tools. An entry's name is its name here unless it adds tool:.

tools:
  # My copy of builtin:file.
  file:
    from: dor-tools/suite
  # My copy of builtin:code.
  code:
    from: dor-tools/suite
  # My copy of builtin:folder.
  folder:
    from: dor-tools/suite

open:
  - match: "*.{md,markdown}"
    tool: file
  - match: "*.{png,jpg,jpeg,gif,webp,avif,svg}"
    tool: file
  - match: "*.{txt,json,yaml,yml,toml,css,js,ts,tsx,py,rs,go,sh}"
    tool: file
  - match: "*.๐Ÿ“"
    tool: folder

The first matching rule wins. A file or folder no rule matches still opens in the bundled built-in, and dor open --tool builtin:file <file> picks the bundled one by name; dor open --tool code <file> picks your copy. Imports need no approval. dor tool --list shows what resolved.

What still differs from the bundled Tools is listed in Dormouse's docs/specs/dor-tools-suite.md under ## Future.