@alexgorbatchev/dotfiles 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +397 -0
- package/cli-fj2hdbnx.js +5 -0
- package/cli-fj2hdbnx.js.map +9 -0
- package/cli-w822cqdk.js +4 -0
- package/cli-w822cqdk.js.map +10 -0
- package/cli.js +449 -0
- package/cli.js.map +283 -0
- package/dashboard-0ebz5sqb.js +159 -0
- package/dashboard-0ebz5sqb.js.map +102 -0
- package/dashboard-3axqywva.css +1 -0
- package/dashboard.js +13 -0
- package/package.json +63 -0
- package/prerender-kpxyx916.js +3 -0
- package/prerender-kpxyx916.js.map +11 -0
- package/schemas.d.ts +2730 -0
- package/skill/SKILL.md +74 -0
- package/skill/references/api-reference.md +614 -0
- package/skill/references/configuration.md +1154 -0
- package/skill/references/installation-methods/brew.md +62 -0
- package/skill/references/installation-methods/cargo.md +86 -0
- package/skill/references/installation-methods/curl-binary.md +73 -0
- package/skill/references/installation-methods/curl-script.md +132 -0
- package/skill/references/installation-methods/curl-tar.md +58 -0
- package/skill/references/installation-methods/dmg.md +113 -0
- package/skill/references/installation-methods/gitea-release.md +106 -0
- package/skill/references/installation-methods/github-release.md +97 -0
- package/skill/references/installation-methods/manual.md +74 -0
- package/skill/references/installation-methods/npm.md +75 -0
- package/skill/references/installation-methods/overview.md +293 -0
- package/skill/references/installation-methods/zsh-plugin.md +156 -0
- package/skill/references/make-tool.md +866 -0
- package/skill/references/shell-and-hooks.md +833 -0
- package/tool-types.d.ts +14 -0
- package/wasm-n3cagcre.js +3 -0
- package/wasm-n3cagcre.js.map +10 -0
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# Homebrew Installation
|
|
2
|
+
|
|
3
|
+
Install tools using Homebrew package manager on macOS and Linux.
|
|
4
|
+
|
|
5
|
+
Shims are not supported for Homebrew-installed tools. The `.bin()` method should not be used with this installer. Homebrew manages binary placement and PATH integration natively.
|
|
6
|
+
|
|
7
|
+
## Basic Usage
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
import { defineTool } from '@alexgorbatchev/dotfiles';
|
|
11
|
+
|
|
12
|
+
export default defineTool((install) => install('brew', { formula: 'ripgrep' }));
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Description |
|
|
18
|
+
| -------------- | --------------------------------------------------- |
|
|
19
|
+
| `formula` | Formula or cask name (defaults to tool name) |
|
|
20
|
+
| `cask` | Set `true` for cask installation |
|
|
21
|
+
| `tap` | Tap(s) to add before installing |
|
|
22
|
+
| `versionArgs` | Arguments for version check (e.g., `['--version']`) |
|
|
23
|
+
| `versionRegex` | Regex to extract version from output |
|
|
24
|
+
| `env` | Environment variables (static or dynamic function) |
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
### Homebrew Cask
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
install('brew', {
|
|
32
|
+
formula: 'visual-studio-code',
|
|
33
|
+
cask: true,
|
|
34
|
+
});
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
### With Custom Tap
|
|
38
|
+
|
|
39
|
+
```typescript
|
|
40
|
+
install('brew', {
|
|
41
|
+
formula: 'aerospace',
|
|
42
|
+
cask: true,
|
|
43
|
+
tap: 'nikitabobko/tap',
|
|
44
|
+
});
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
### Multiple Taps
|
|
48
|
+
|
|
49
|
+
```typescript
|
|
50
|
+
install('brew', {
|
|
51
|
+
formula: 'custom-tool',
|
|
52
|
+
tap: ['custom/tap', 'another/tap'],
|
|
53
|
+
});
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
## Platform Support
|
|
57
|
+
|
|
58
|
+
| Platform | Support |
|
|
59
|
+
| -------- | ----------------------- |
|
|
60
|
+
| macOS | Full (formulas + casks) |
|
|
61
|
+
| Linux | Formulas only |
|
|
62
|
+
| Windows | Not supported |
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
# Cargo Installation
|
|
2
|
+
|
|
3
|
+
Installs Rust tools from crates.io using pre-compiled binaries via cargo-quickinstall or GitHub releases.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { defineTool } from '@alexgorbatchev/dotfiles';
|
|
9
|
+
|
|
10
|
+
export default defineTool((install, ctx) =>
|
|
11
|
+
install('cargo', {
|
|
12
|
+
crateName: 'ripgrep',
|
|
13
|
+
}).bin('rg')
|
|
14
|
+
);
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Type | Required | Description |
|
|
20
|
+
| ---------------- | -------------------------------------------------- | -------- | ------------------------------------------------------ |
|
|
21
|
+
| `crateName` | `string` | Yes | Name of the Rust crate |
|
|
22
|
+
| `binarySource` | `'cargo-quickinstall' \| 'github-releases'` | No | Binary download source (default: `cargo-quickinstall`) |
|
|
23
|
+
| `versionSource` | `'cargo-toml' \| 'crates-io' \| 'github-releases'` | No | Version detection source (default: `cargo-toml`) |
|
|
24
|
+
| `githubRepo` | `string` | No | GitHub repo in `owner/repo` format |
|
|
25
|
+
| `assetPattern` | `string` | No | Pattern for GitHub release assets |
|
|
26
|
+
| `cargoTomlUrl` | `string` | No | Custom Cargo.toml URL |
|
|
27
|
+
| `customBinaries` | `string[]` | No | Custom binary names if different from crate |
|
|
28
|
+
| `env` | `Record<string, string> \| (ctx) => Record<...>` | No | Environment variables (static or dynamic function) |
|
|
29
|
+
|
|
30
|
+
### Asset Pattern Placeholders
|
|
31
|
+
|
|
32
|
+
| Placeholder | Description |
|
|
33
|
+
| ------------- | -------------------- |
|
|
34
|
+
| `{version}` | Resolved version |
|
|
35
|
+
| `{platform}` | Current platform |
|
|
36
|
+
| `{arch}` | Current architecture |
|
|
37
|
+
| `{crateName}` | Crate name |
|
|
38
|
+
|
|
39
|
+
## Examples
|
|
40
|
+
|
|
41
|
+
### From GitHub Releases
|
|
42
|
+
|
|
43
|
+
```typescript
|
|
44
|
+
export default defineTool((install, ctx) =>
|
|
45
|
+
install('cargo', {
|
|
46
|
+
crateName: 'bat',
|
|
47
|
+
binarySource: 'github-releases',
|
|
48
|
+
githubRepo: 'sharkdp/bat',
|
|
49
|
+
assetPattern: 'bat-v{version}-{arch}-{platform}.tar.gz',
|
|
50
|
+
}).bin('bat')
|
|
51
|
+
);
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
### Custom Binary Names
|
|
55
|
+
|
|
56
|
+
```typescript
|
|
57
|
+
export default defineTool((install, ctx) =>
|
|
58
|
+
install('cargo', {
|
|
59
|
+
crateName: 'fd-find',
|
|
60
|
+
customBinaries: ['fd'],
|
|
61
|
+
}).bin('fd')
|
|
62
|
+
);
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
### With Hooks
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
export default defineTool((install, ctx) =>
|
|
69
|
+
install('cargo', {
|
|
70
|
+
crateName: 'tool',
|
|
71
|
+
})
|
|
72
|
+
.bin('tool')
|
|
73
|
+
.hook('after-install', async (ctx) => {
|
|
74
|
+
// Post-installation setup
|
|
75
|
+
})
|
|
76
|
+
);
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
## Platform Mapping
|
|
80
|
+
|
|
81
|
+
| System | Architecture | Rust Target Triple |
|
|
82
|
+
| ------ | ------------ | --------------------------- |
|
|
83
|
+
| macOS | arm64 | `aarch64-apple-darwin` |
|
|
84
|
+
| macOS | x64 | `x86_64-apple-darwin` |
|
|
85
|
+
| Linux | x64 | `x86_64-unknown-linux-gnu` |
|
|
86
|
+
| Linux | arm64 | `aarch64-unknown-linux-gnu` |
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
# Curl Binary Installation
|
|
2
|
+
|
|
3
|
+
Download standalone binary files directly from URLs. Unlike `curl-tar`, this method does **not** extract an archive — the downloaded file is the binary itself.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { defineTool } from '@alexgorbatchev/dotfiles';
|
|
9
|
+
|
|
10
|
+
export default defineTool((install) =>
|
|
11
|
+
install('curl-binary', {
|
|
12
|
+
url: 'https://example.com/tool-v1.0.0-linux-amd64',
|
|
13
|
+
}).bin('tool')
|
|
14
|
+
);
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Description |
|
|
20
|
+
| -------------- | --------------------------------------------------- |
|
|
21
|
+
| `url` | **Required**. Direct URL to the binary file |
|
|
22
|
+
| `versionArgs` | Arguments for version check (e.g., `['--version']`) |
|
|
23
|
+
| `versionRegex` | Regex to extract version from output |
|
|
24
|
+
| `env` | Environment variables (static or dynamic function) |
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
### With Version Detection
|
|
29
|
+
|
|
30
|
+
```typescript
|
|
31
|
+
install('curl-binary', {
|
|
32
|
+
url: 'https://example.com/tool-v1.0.0-linux-amd64',
|
|
33
|
+
versionArgs: ['--version'],
|
|
34
|
+
versionRegex: 'v(\\d+\\.\\d+\\.\\d+)',
|
|
35
|
+
}).bin('tool');
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### With Shell Configuration
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
install('curl-binary', {
|
|
42
|
+
url: 'https://example.com/tool-v1.0.0-linux-amd64',
|
|
43
|
+
})
|
|
44
|
+
.bin('tool')
|
|
45
|
+
.zsh((shell) => shell.aliases({ t: 'tool' }));
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### Platform-Specific URLs
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
import { Architecture, defineTool, Platform } from '@alexgorbatchev/dotfiles';
|
|
52
|
+
|
|
53
|
+
export default defineTool((install) =>
|
|
54
|
+
install()
|
|
55
|
+
.bin('tool')
|
|
56
|
+
.platform(Platform.MacOS, Architecture.Arm64, (install) =>
|
|
57
|
+
install('curl-binary', {
|
|
58
|
+
url: 'https://example.com/tool-darwin-arm64',
|
|
59
|
+
}))
|
|
60
|
+
.platform(Platform.Linux, Architecture.X86_64, (install) =>
|
|
61
|
+
install('curl-binary', {
|
|
62
|
+
url: 'https://example.com/tool-linux-amd64',
|
|
63
|
+
}))
|
|
64
|
+
);
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## When to Use
|
|
68
|
+
|
|
69
|
+
- Direct binary file downloads (single executable, no archive)
|
|
70
|
+
- Tools that distribute platform-specific binaries as standalone files
|
|
71
|
+
- Single-file Go or Rust binaries provided as direct downloads
|
|
72
|
+
|
|
73
|
+
Prefer `github-release` when GitHub releases are available. Prefer `curl-tar` when the download is an archive.
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# Curl Script Installation
|
|
2
|
+
|
|
3
|
+
Downloads and executes shell installation scripts.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { defineTool } from '@alexgorbatchev/dotfiles';
|
|
9
|
+
|
|
10
|
+
export default defineTool((install, ctx) =>
|
|
11
|
+
install('curl-script', {
|
|
12
|
+
url: 'https://bun.sh/install',
|
|
13
|
+
shell: 'bash',
|
|
14
|
+
}).bin('bun')
|
|
15
|
+
);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Parameters
|
|
19
|
+
|
|
20
|
+
| Parameter | Type | Required | Description |
|
|
21
|
+
| -------------- | ------------------------------------------------ | -------- | ----------------------------------------- |
|
|
22
|
+
| `url` | `string` | Yes | URL of the installation script |
|
|
23
|
+
| `shell` | `'bash' \| 'sh'` | Yes | Shell interpreter to use |
|
|
24
|
+
| `args` | `string[] \| (ctx) => string[]` | No | Arguments to pass to the script |
|
|
25
|
+
| `env` | `Record<string, string> \| (ctx) => Record<...>` | No | Environment variables (static or dynamic) |
|
|
26
|
+
| `versionArgs` | `string[]` | No | Args to pass to binary for version check |
|
|
27
|
+
| `versionRegex` | `string` | No | Regex to extract version from output |
|
|
28
|
+
|
|
29
|
+
> **Note:** The `env` and `args` parameters support both static values and dynamic functions. Dynamic functions receive a context with `projectConfig`, `scriptPath`, and `stagingDir`.
|
|
30
|
+
|
|
31
|
+
## Understanding `stagingDir`
|
|
32
|
+
|
|
33
|
+
When the curl-script installer runs, it creates a temporary **staging directory** where the installation takes place. This is critical to understand because:
|
|
34
|
+
|
|
35
|
+
1. **The system expects binaries in `stagingDir`** - After your installation script completes, the tool installer looks for the declared binaries (from `.bin()`) inside `stagingDir`. If they are not there, installation fails.
|
|
36
|
+
|
|
37
|
+
2. **`stagingDir` becomes the versioned directory** - After successful installation, the entire staging directory is renamed to the final versioned path (e.g., `~/.dotfiles/tools/fnm/1.2.3`). All files in `stagingDir` are preserved.
|
|
38
|
+
|
|
39
|
+
3. **Most scripts need to be redirected** - By default, installation scripts install to their own preferred locations (like `~/.local/bin` or `~/.<tool>`). You must redirect them to `stagingDir` using the script's configuration options.
|
|
40
|
+
|
|
41
|
+
### How to Redirect Installation
|
|
42
|
+
|
|
43
|
+
Check the installation script's source to find the right argument or environment variable:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
# Download and inspect the script
|
|
47
|
+
curl -fsSL https://fly.io/install.sh | less
|
|
48
|
+
|
|
49
|
+
# Look for variables like:
|
|
50
|
+
# INSTALL_DIR, PREFIX, BIN_DIR, FLYCTL_INSTALL, etc.
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
Then use `args` or `env` with the dynamic context to redirect:
|
|
54
|
+
|
|
55
|
+
```typescript
|
|
56
|
+
// Using args (if script accepts command-line arguments)
|
|
57
|
+
args: ((ctx) => ['--install-dir', ctx.stagingDir]);
|
|
58
|
+
|
|
59
|
+
// Using env (if script reads environment variables)
|
|
60
|
+
env: ((ctx) => ({ FLYCTL_INSTALL: ctx.stagingDir }));
|
|
61
|
+
```
|
|
62
|
+
|
|
63
|
+
## Examples
|
|
64
|
+
|
|
65
|
+
### With Static Arguments
|
|
66
|
+
|
|
67
|
+
```typescript
|
|
68
|
+
export default defineTool((install, ctx) =>
|
|
69
|
+
install('curl-script', {
|
|
70
|
+
url: 'https://fnm.vercel.app/install',
|
|
71
|
+
shell: 'bash',
|
|
72
|
+
args: ['--skip-shell', '--install-dir', '$LOCAL_BIN'],
|
|
73
|
+
}).bin('fnm')
|
|
74
|
+
);
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
### With Dynamic Arguments
|
|
78
|
+
|
|
79
|
+
```typescript
|
|
80
|
+
export default defineTool((install, ctx) =>
|
|
81
|
+
install('curl-script', {
|
|
82
|
+
url: 'https://fnm.vercel.app/install',
|
|
83
|
+
shell: 'bash',
|
|
84
|
+
args: (argsCtx) => ['--install-dir', argsCtx.stagingDir],
|
|
85
|
+
}).bin('fnm')
|
|
86
|
+
);
|
|
87
|
+
```
|
|
88
|
+
|
|
89
|
+
The `args` function receives a context with:
|
|
90
|
+
|
|
91
|
+
- `projectConfig` - Project configuration with paths and settings
|
|
92
|
+
- `scriptPath` - Absolute path to the downloaded script (in `stagingDir`, already chmod +x)
|
|
93
|
+
- `stagingDir` - Temporary directory for this installation attempt. The script is downloaded here, along with any files your code creates. After successful installation, the entire directory is renamed to the versioned path (e.g., `<tool-name>/1.2.3`), preserving all contents.
|
|
94
|
+
|
|
95
|
+
### With Environment Variables
|
|
96
|
+
|
|
97
|
+
Use dynamic `env` to redirect installation to `stagingDir`:
|
|
98
|
+
|
|
99
|
+
```typescript
|
|
100
|
+
export default defineTool((install, ctx) =>
|
|
101
|
+
install('curl-script', {
|
|
102
|
+
url: 'https://fly.io/install.sh',
|
|
103
|
+
shell: 'sh',
|
|
104
|
+
env: (ctx) => ({ FLYCTL_INSTALL: ctx.stagingDir }),
|
|
105
|
+
}).bin('flyctl', 'fly')
|
|
106
|
+
);
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Note: The fly.io script installs `flyctl` as the main binary. The second argument to `.bin()` creates `fly` as a symlink alias.
|
|
110
|
+
|
|
111
|
+
The `env` context provides:
|
|
112
|
+
|
|
113
|
+
- `projectConfig` - Project configuration with paths and settings
|
|
114
|
+
- `stagingDir` - Temporary directory for installation (becomes versioned path after success)
|
|
115
|
+
- `scriptPath` - Absolute path to the downloaded script (curl-script specific)
|
|
116
|
+
|
|
117
|
+
### With Hooks
|
|
118
|
+
|
|
119
|
+
```typescript
|
|
120
|
+
export default defineTool((install, ctx) =>
|
|
121
|
+
install('curl-script', {
|
|
122
|
+
url: 'https://example.com/install.sh',
|
|
123
|
+
shell: 'bash',
|
|
124
|
+
})
|
|
125
|
+
.bin('tool')
|
|
126
|
+
.hook('after-download', async (ctx) => {
|
|
127
|
+
// Verify script before execution
|
|
128
|
+
})
|
|
129
|
+
);
|
|
130
|
+
```
|
|
131
|
+
|
|
132
|
+
**Security Note**: Curl scripts execute arbitrary code. Only use trusted sources with HTTPS URLs.
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
# Curl Tar Installation
|
|
2
|
+
|
|
3
|
+
Download and extract tarballs directly from URLs.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { defineTool } from '@alexgorbatchev/dotfiles';
|
|
9
|
+
|
|
10
|
+
export default defineTool((install) =>
|
|
11
|
+
install('curl-tar', {
|
|
12
|
+
url: 'https://example.com/tool.tar.gz',
|
|
13
|
+
}).bin('tool')
|
|
14
|
+
);
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
## Parameters
|
|
18
|
+
|
|
19
|
+
| Parameter | Description |
|
|
20
|
+
| ----------------- | --------------------------------------------------- |
|
|
21
|
+
| `url` | **Required**. Direct URL to the tarball |
|
|
22
|
+
| `extractPath` | Path to binary within extracted archive |
|
|
23
|
+
| `stripComponents` | Directory levels to strip during extraction |
|
|
24
|
+
| `versionArgs` | Arguments for version check (e.g., `['--version']`) |
|
|
25
|
+
| `versionRegex` | Regex to extract version from output |
|
|
26
|
+
| `env` | Environment variables (static or dynamic function) |
|
|
27
|
+
|
|
28
|
+
## Examples
|
|
29
|
+
|
|
30
|
+
### Binary in Subdirectory
|
|
31
|
+
|
|
32
|
+
```typescript
|
|
33
|
+
install('curl-tar', {
|
|
34
|
+
url: 'https://releases.example.com/tool-v1.0.0.tar.gz',
|
|
35
|
+
}).bin('tool', 'bin/tool'); // Binary at bin/tool in archive
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### With Shell Configuration
|
|
39
|
+
|
|
40
|
+
```typescript
|
|
41
|
+
install('curl-tar', {
|
|
42
|
+
url: 'https://releases.example.com/tool-v1.0.0.tar.gz',
|
|
43
|
+
})
|
|
44
|
+
.bin('tool')
|
|
45
|
+
.zsh((shell) => shell.aliases({ t: 'tool' }));
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
## Supported Formats
|
|
49
|
+
|
|
50
|
+
`.tar.gz`, `.tgz`, `.tar.bz2`, `.tbz2`, `.tar.xz`, `.txz`, `.tar`
|
|
51
|
+
|
|
52
|
+
## When to Use
|
|
53
|
+
|
|
54
|
+
- Direct tarball downloads from known URLs
|
|
55
|
+
- Tools without GitHub releases
|
|
56
|
+
- Simple archive structures
|
|
57
|
+
|
|
58
|
+
Prefer `github-release` when GitHub releases are available.
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
# DMG Installation
|
|
2
|
+
|
|
3
|
+
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.
|
|
4
|
+
|
|
5
|
+
The DMG source is configured via a required `source` object. Sources can be direct URLs or GitHub releases.
|
|
6
|
+
|
|
7
|
+
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.
|
|
8
|
+
|
|
9
|
+
DMG is externally managed. Temporary files (download, mount point, optional archive extraction) use `stagingDir`, but the final `.app` is installed to `/Applications`.
|
|
10
|
+
|
|
11
|
+
Shims are not supported for DMG-installed applications. The `.bin()` method should not be used with this installer.
|
|
12
|
+
|
|
13
|
+
## Basic Usage
|
|
14
|
+
|
|
15
|
+
```typescript
|
|
16
|
+
import { defineTool } from '@alexgorbatchev/dotfiles';
|
|
17
|
+
|
|
18
|
+
export default defineTool((install) =>
|
|
19
|
+
install('dmg', {
|
|
20
|
+
source: {
|
|
21
|
+
type: 'url',
|
|
22
|
+
url: 'https://example.com/MyApp-1.0.0.dmg',
|
|
23
|
+
},
|
|
24
|
+
})
|
|
25
|
+
);
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
## Parameters
|
|
29
|
+
|
|
30
|
+
| Parameter | Description |
|
|
31
|
+
| -------------- | ------------------------------------------------------------------------------ |
|
|
32
|
+
| `source` | **Required**. DMG source definition (see source variants below) |
|
|
33
|
+
| `appName` | Name of the `.app` bundle (e.g., `'MyApp.app'`). Auto-detected if omitted |
|
|
34
|
+
| `binaryPath` | Relative path to binary inside `.app`. Defaults to `Contents/MacOS/{bin name}` |
|
|
35
|
+
| `versionArgs` | Arguments for version check (e.g., `['--version']`) |
|
|
36
|
+
| `versionRegex` | Regex to extract version from output |
|
|
37
|
+
| `env` | Environment variables (static or dynamic function) |
|
|
38
|
+
|
|
39
|
+
### Source Variants
|
|
40
|
+
|
|
41
|
+
| Source type | Required fields | Optional fields | Notes |
|
|
42
|
+
| ---------------- | --------------- | ----------------------------------------------------------------- | -------------------------------------------------------- |
|
|
43
|
+
| `url` | `url` | — | Direct DMG URL or archive URL containing a DMG |
|
|
44
|
+
| `github-release` | `repo` | `version`, `assetPattern`, `assetSelector`, `ghCli`, `prerelease` | Resolves release asset first, then installs from the DMG |
|
|
45
|
+
|
|
46
|
+
## Examples
|
|
47
|
+
|
|
48
|
+
### Explicit App Name
|
|
49
|
+
|
|
50
|
+
```typescript
|
|
51
|
+
install('dmg', {
|
|
52
|
+
source: {
|
|
53
|
+
type: 'url',
|
|
54
|
+
url: 'https://example.com/MyApp-1.0.0.dmg',
|
|
55
|
+
},
|
|
56
|
+
appName: 'MyApp.app',
|
|
57
|
+
}).version('1.0.0');
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
### From Archive Containing DMG
|
|
61
|
+
|
|
62
|
+
```typescript
|
|
63
|
+
install('dmg', {
|
|
64
|
+
source: {
|
|
65
|
+
type: 'url',
|
|
66
|
+
url: 'https://github.com/example/app/releases/download/v1.0.0/MyApp.dmg.zip',
|
|
67
|
+
},
|
|
68
|
+
});
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
### GitHub Release Source
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
install('dmg', {
|
|
75
|
+
source: {
|
|
76
|
+
type: 'github-release',
|
|
77
|
+
repo: 'manaflow-ai/cmux',
|
|
78
|
+
assetPattern: '*macos*.dmg',
|
|
79
|
+
},
|
|
80
|
+
appName: 'cmux.app',
|
|
81
|
+
});
|
|
82
|
+
```
|
|
83
|
+
|
|
84
|
+
### With Version Detection
|
|
85
|
+
|
|
86
|
+
```typescript
|
|
87
|
+
install('dmg', {
|
|
88
|
+
source: {
|
|
89
|
+
type: 'url',
|
|
90
|
+
url: 'https://example.com/MyApp-1.0.0.dmg',
|
|
91
|
+
},
|
|
92
|
+
versionArgs: ['--version'],
|
|
93
|
+
versionRegex: 'v(\\d+\\.\\d+\\.\\d+)',
|
|
94
|
+
});
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
## Platform Behavior
|
|
98
|
+
|
|
99
|
+
| Platform | Behavior |
|
|
100
|
+
| -------- | ----------------------------------------- |
|
|
101
|
+
| macOS | Full installation via hdiutil |
|
|
102
|
+
| Linux | Silently skipped (returns empty binaries) |
|
|
103
|
+
| Windows | Silently skipped (returns empty binaries) |
|
|
104
|
+
|
|
105
|
+
No `.platform()` wrapper is needed — the plugin handles platform detection internally.
|
|
106
|
+
|
|
107
|
+
## When to Use
|
|
108
|
+
|
|
109
|
+
- macOS applications distributed as `.dmg` disk images
|
|
110
|
+
- Tools that ship as `.app` bundles
|
|
111
|
+
- GitHub releases that distribute `.dmg` files inside `.zip` or `.tar.gz` archives
|
|
112
|
+
|
|
113
|
+
Prefer `brew` when the tool is available as a Homebrew formula or cask. Prefer `curl-binary` or `github-release` for cross-platform tools.
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
# Gitea/Forgejo Release Installation
|
|
2
|
+
|
|
3
|
+
Download and install tools from Gitea or Forgejo instance releases with automatic platform asset selection. Supports any Gitea-compatible instance including Codeberg, Forgejo, and self-hosted Gitea.
|
|
4
|
+
|
|
5
|
+
## Basic Usage
|
|
6
|
+
|
|
7
|
+
```typescript
|
|
8
|
+
import { defineTool } from '@alexgorbatchev/dotfiles';
|
|
9
|
+
|
|
10
|
+
export default defineTool((install) =>
|
|
11
|
+
install('gitea-release', {
|
|
12
|
+
instanceUrl: 'https://codeberg.org',
|
|
13
|
+
repo: 'Codeberg/pages-server',
|
|
14
|
+
}).bin('pages-server')
|
|
15
|
+
);
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Parameters
|
|
19
|
+
|
|
20
|
+
| Parameter | Description |
|
|
21
|
+
| --------------- | --------------------------------------------------------- |
|
|
22
|
+
| `instanceUrl` | **Required**. Base URL of the Gitea/Forgejo instance |
|
|
23
|
+
| `repo` | **Required**. Repository in "owner/repo" format |
|
|
24
|
+
| `assetPattern` | Glob or regex pattern to match release assets |
|
|
25
|
+
| `assetSelector` | Custom function to select the correct asset |
|
|
26
|
+
| `version` | Specific version (e.g., `'v1.2.3'`) |
|
|
27
|
+
| `prerelease` | Include prereleases when fetching latest (default: false) |
|
|
28
|
+
| `token` | API token for authentication with the instance |
|
|
29
|
+
| `env` | Environment variables (static or dynamic function) |
|
|
30
|
+
|
|
31
|
+
## Examples
|
|
32
|
+
|
|
33
|
+
### With Asset Pattern
|
|
34
|
+
|
|
35
|
+
```typescript
|
|
36
|
+
install('gitea-release', {
|
|
37
|
+
instanceUrl: 'https://codeberg.org',
|
|
38
|
+
repo: 'owner/tool',
|
|
39
|
+
assetPattern: '*linux_amd64.tar.gz',
|
|
40
|
+
}).bin('tool');
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
### Custom Asset Selector
|
|
44
|
+
|
|
45
|
+
```typescript
|
|
46
|
+
install('gitea-release', {
|
|
47
|
+
instanceUrl: 'https://codeberg.org',
|
|
48
|
+
repo: 'owner/tool',
|
|
49
|
+
assetSelector: ({ assets, systemInfo }) => {
|
|
50
|
+
const platform = systemInfo.platform === 'darwin' ? 'macos' : systemInfo.platform;
|
|
51
|
+
return assets.find((a) => a.name.includes(platform));
|
|
52
|
+
},
|
|
53
|
+
}).bin('tool');
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### Specific Version
|
|
57
|
+
|
|
58
|
+
```typescript
|
|
59
|
+
install('gitea-release', {
|
|
60
|
+
instanceUrl: 'https://codeberg.org',
|
|
61
|
+
repo: 'owner/tool',
|
|
62
|
+
version: 'v2.1.0',
|
|
63
|
+
}).bin('tool');
|
|
64
|
+
```
|
|
65
|
+
|
|
66
|
+
### With Authentication Token
|
|
67
|
+
|
|
68
|
+
For private repositories or to avoid rate limits:
|
|
69
|
+
|
|
70
|
+
```typescript
|
|
71
|
+
install('gitea-release', {
|
|
72
|
+
instanceUrl: 'https://gitea.example.com',
|
|
73
|
+
repo: 'org/private-tool',
|
|
74
|
+
token: process.env.GITEA_TOKEN,
|
|
75
|
+
}).bin('tool');
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Asset Pattern Matching
|
|
79
|
+
|
|
80
|
+
| Pattern | Matches |
|
|
81
|
+
| ---------------------- | ------------------- |
|
|
82
|
+
| `*linux*amd64*.tar.gz` | Linux x64 tarballs |
|
|
83
|
+
| `*darwin*arm64*.zip` | macOS ARM64 zips |
|
|
84
|
+
| `*windows*.exe` | Windows executables |
|
|
85
|
+
|
|
86
|
+
Glob syntax: `*` (any chars), `?` (single char), `[abc]` (char class), `{a,b}` (alternation)
|
|
87
|
+
|
|
88
|
+
Regex patterns can also be used by wrapping in forward slashes: `/tool-v\d+.*linux/`
|
|
89
|
+
|
|
90
|
+
## Platform Detection
|
|
91
|
+
|
|
92
|
+
Available in `assetSelector` as `systemInfo`:
|
|
93
|
+
|
|
94
|
+
| Property | Values |
|
|
95
|
+
| ---------- | -------------------------- |
|
|
96
|
+
| `platform` | `darwin`, `linux`, `win32` |
|
|
97
|
+
| `arch` | `x64`, `arm64` |
|
|
98
|
+
|
|
99
|
+
## Supported Instances
|
|
100
|
+
|
|
101
|
+
Any server running the Gitea API v1 is supported:
|
|
102
|
+
|
|
103
|
+
- Codeberg — Free hosting for open source projects
|
|
104
|
+
- Forgejo — Community fork of Gitea
|
|
105
|
+
- Gitea — Self-hosted Git service
|
|
106
|
+
- Self-hosted instances
|