Skip to content

dmg

Install macOS applications distributed as DMG disk images. The plugin mounts the DMG, copies the .app bundle to /Applications, and is silently skipped on non-macOS platforms.

The DMG source is configured via a required source object. Sources can be direct URLs or GitHub releases.

If the resolved source points to a supported archive (.zip, .tar.gz, etc.) containing a .dmg file, the archive is automatically extracted first. This is common for GitHub releases that compress DMGs into zip files.

DMG is externally managed. Temporary files (download, mount point, optional archive extraction) use stagingDir, but the final .app is installed to /Applications.

Shims are not supported for DMG-installed applications. The .bin() method should not be used with this installer.

import { defineTool } from "@alexgorbatchev/dotfiles";
export default defineTool((install) =>
install("dmg", {
source: {
type: "url",
url: "https://example.com/MyApp-1.0.0.dmg",
},
}),
);
ParameterDescription
sourceRequired. DMG source definition (see source variants below)
appNameName of the .app bundle (e.g., 'MyApp.app'). Auto-detected if omitted
binaryPathRelative path to binary inside .app. Defaults to Contents/MacOS/{bin name}
versionArgsArguments for version check (e.g., ['--version'])
versionRegexRegex to extract version from output (string or RegExp)
envEnvironment variables (static or dynamic function)
Source typeRequired fieldsOptional fieldsNotes
urlurlDirect DMG URL or archive URL containing a DMG
github-releaserepoversion, assetPattern, assetSelector, ghCli, prereleaseResolves release asset first, then installs from the DMG
install("dmg", {
source: {
type: "url",
url: "https://example.com/MyApp-1.0.0.dmg",
},
appName: "MyApp.app",
}).version("1.0.0");
install("dmg", {
source: {
type: "url",
url: "https://github.com/example/app/releases/download/v1.0.0/MyApp.dmg.zip",
},
});
install("dmg", {
source: {
type: "github-release",
repo: "manaflow-ai/cmux",
assetPattern: "*macos*.dmg",
},
appName: "cmux.app",
});
install("dmg", {
source: {
type: "url",
url: "https://example.com/MyApp-1.0.0.dmg",
},
versionArgs: ["--version"],
versionRegex: /v(\d+\.\d+\.\d+)/,
});
PlatformBehavior
macOSFull installation via hdiutil
LinuxSilently skipped (returns empty binaries)
WindowsSilently skipped (returns empty binaries)

No .platform() wrapper is needed — the plugin handles platform detection internally.

  • macOS applications distributed as .dmg disk images
  • Tools that ship as .app bundles
  • GitHub releases that distribute .dmg files inside .zip or .tar.gz archives

Prefer brew when the tool is available as a Homebrew formula or cask. Prefer curl-binary or github-release for cross-platform tools.