@alexgorbatchev/dotfiles 0.0.5 → 0.0.10

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.
@@ -88,28 +88,28 @@ Files must be named `{tool-name}.tool.ts` and export a default using `defineTool
88
88
  ## Minimal Configuration
89
89
 
90
90
  ```typescript
91
- import { defineTool } from '@alexgorbatchev/dotfiles';
91
+ import { defineTool } from "@alexgorbatchev/dotfiles";
92
92
 
93
93
  export default defineTool((install, ctx) =>
94
- install('github-release', {
95
- repo: 'junegunn/fzf',
96
- }).bin('fzf')
94
+ install("github-release", {
95
+ repo: "junegunn/fzf",
96
+ }).bin("fzf"),
97
97
  );
98
98
  ```
99
99
 
100
100
  ## Complete Example
101
101
 
102
102
  ```typescript
103
- import { defineTool } from '@alexgorbatchev/dotfiles';
103
+ import { defineTool } from "@alexgorbatchev/dotfiles";
104
104
 
105
105
  export default defineTool((install, ctx) =>
106
- install('github-release', {
107
- repo: 'BurntSushi/ripgrep',
106
+ install("github-release", {
107
+ repo: "BurntSushi/ripgrep",
108
108
  })
109
- .bin('rg')
110
- .dependsOn('pcre2')
111
- .symlink('./ripgreprc', '~/.ripgreprc')
112
- .zsh((shell) => shell.env({ RIPGREP_CONFIG_PATH: '~/.ripgreprc' }).aliases({ rgi: 'rg -i' }))
109
+ .bin("rg")
110
+ .dependsOn("pcre2")
111
+ .symlink("./ripgreprc", "~/.ripgreprc")
112
+ .zsh((shell) => shell.env({ RIPGREP_CONFIG_PATH: "~/.ripgreprc" }).aliases({ rgi: "rg -i" })),
113
113
  );
114
114
  ```
115
115
 
@@ -134,7 +134,7 @@ After calling `install()`, these methods are available:
134
134
  ### Imports
135
135
 
136
136
  ```typescript
137
- import { Architecture, defineTool, Platform } from '@alexgorbatchev/dotfiles';
137
+ import { Architecture, defineTool, Platform } from "@alexgorbatchev/dotfiles";
138
138
  ```
139
139
 
140
140
  | Export | Description |
@@ -148,7 +148,7 @@ import { Architecture, defineTool, Platform } from '@alexgorbatchev/dotfiles';
148
148
  Tools that only contribute shell configuration (no binary installation):
149
149
 
150
150
  ```typescript
151
- export default defineTool((install) => install().zsh((shell) => shell.env({ FOO: 'bar' })));
151
+ export default defineTool((install) => install().zsh((shell) => shell.env({ FOO: "bar" })));
152
152
  ```
153
153
 
154
154
  ### Orphaned Artifact Cleanup
@@ -189,14 +189,14 @@ The project configuration file defines paths, features, and API settings for you
189
189
  ## Basic Configuration
190
190
 
191
191
  ```typescript
192
- import { defineConfig } from '@alexgorbatchev/dotfiles';
192
+ import { defineConfig } from "@alexgorbatchev/dotfiles";
193
193
 
194
194
  export default defineConfig(() => ({
195
195
  paths: {
196
- dotfilesDir: '~/.dotfiles',
197
- toolConfigsDir: '~/.dotfiles/tools',
198
- generatedDir: '~/.dotfiles/.generated',
199
- targetDir: '~/.local/bin',
196
+ dotfilesDir: "~/.dotfiles",
197
+ toolConfigsDir: "~/.dotfiles/tools",
198
+ generatedDir: "~/.dotfiles/.generated",
199
+ targetDir: "~/.local/bin",
200
200
  },
201
201
  }));
202
202
  ```
@@ -209,7 +209,7 @@ export default defineConfig(() => ({
209
209
  export default defineConfig(async () => {
210
210
  const token = await loadTokenFromVault();
211
211
  return {
212
- paths: { dotfilesDir: '~/.dotfiles' },
212
+ paths: { dotfilesDir: "~/.dotfiles" },
213
213
  github: { token },
214
214
  };
215
215
  });
@@ -339,13 +339,13 @@ updates: {
339
339
  ```typescript
340
340
  export default defineConfig(() => ({
341
341
  paths: {
342
- targetDir: '~/.local/bin',
342
+ targetDir: "~/.local/bin",
343
343
  },
344
344
  platform: [
345
345
  {
346
- match: [{ platform: 'darwin', arch: 'arm64' }],
346
+ match: [{ platform: "darwin", arch: "arm64" }],
347
347
  config: {
348
- paths: { targetDir: '/opt/homebrew/bin' },
348
+ paths: { targetDir: "/opt/homebrew/bin" },
349
349
  },
350
350
  },
351
351
  ],
@@ -355,15 +355,15 @@ export default defineConfig(() => ({
355
355
  ## CLI Usage
356
356
 
357
357
  ```bash
358
- dotfiles --config ~/.dotfiles/config.ts install
359
- dotfiles install # Uses config.ts in current directory
358
+ dotfiles --config ~/.dotfiles/dotfiles.config.ts install
359
+ dotfiles install # Uses dotfiles.config.ts in current directory
360
360
  ```
361
361
 
362
362
  ## Directory Structure
363
363
 
364
364
  ```
365
365
  ~/.dotfiles/
366
- ├── config.ts # Project configuration
366
+ ├── dotfiles.config.ts # Project configuration
367
367
  ├── tools/ # Tool definitions (*.tool.ts)
368
368
  ├── CATALOG.md # Auto-generated
369
369
  └── .generated/ # Not version controlled
@@ -381,7 +381,7 @@ Use `.platform()` for cross-platform tool configurations.
381
381
  ## Platform and Architecture Enums
382
382
 
383
383
  ```typescript
384
- import { Architecture, Platform } from '@alexgorbatchev/dotfiles';
384
+ import { Architecture, Platform } from "@alexgorbatchev/dotfiles";
385
385
 
386
386
  // Platforms (bitwise flags)
387
387
  Platform.Linux; // 1
@@ -399,44 +399,48 @@ Architecture.All; // Both (3)
399
399
  ## Basic Usage
400
400
 
401
401
  ```typescript
402
- import { defineTool, Platform } from '@alexgorbatchev/dotfiles';
402
+ import { defineTool, Platform } from "@alexgorbatchev/dotfiles";
403
403
 
404
404
  export default defineTool((install) =>
405
405
  install()
406
- .bin('tool')
407
- .platform(Platform.MacOS, (install) => install('brew', { formula: 'tool' }))
406
+ .bin("tool")
407
+ .platform(Platform.MacOS, (install) => install("brew", { formula: "tool" }))
408
408
  .platform(Platform.Linux, (install) =>
409
- install('github-release', {
410
- repo: 'owner/tool',
411
- assetPattern: '*linux*.tar.gz',
412
- }))
409
+ install("github-release", {
410
+ repo: "owner/tool",
411
+ assetPattern: "*linux*.tar.gz",
412
+ }),
413
+ )
413
414
  .platform(Platform.Windows, (install) =>
414
- install('github-release', {
415
- repo: 'owner/tool',
416
- assetPattern: '*windows*.zip',
417
- }))
415
+ install("github-release", {
416
+ repo: "owner/tool",
417
+ assetPattern: "*windows*.zip",
418
+ }),
419
+ ),
418
420
  );
419
421
  ```
420
422
 
421
423
  ## With Architecture
422
424
 
423
425
  ```typescript
424
- import { Architecture, defineTool, Platform } from '@alexgorbatchev/dotfiles';
426
+ import { Architecture, defineTool, Platform } from "@alexgorbatchev/dotfiles";
425
427
 
426
428
  export default defineTool((install) =>
427
429
  install()
428
- .bin('tool')
430
+ .bin("tool")
429
431
  .platform(Platform.Linux, Architecture.X86_64, (install) =>
430
- install('github-release', {
431
- repo: 'owner/tool',
432
- assetPattern: '*linux-amd64*.tar.gz',
433
- }))
432
+ install("github-release", {
433
+ repo: "owner/tool",
434
+ assetPattern: "*linux-amd64*.tar.gz",
435
+ }),
436
+ )
434
437
  .platform(Platform.Linux, Architecture.Arm64, (install) =>
435
- install('github-release', {
436
- repo: 'owner/tool',
437
- assetPattern: '*linux-arm64*.tar.gz',
438
- }))
439
- .platform(Platform.MacOS, Architecture.All, (install) => install('brew', { formula: 'tool' }))
438
+ install("github-release", {
439
+ repo: "owner/tool",
440
+ assetPattern: "*linux-arm64*.tar.gz",
441
+ }),
442
+ )
443
+ .platform(Platform.MacOS, Architecture.All, (install) => install("brew", { formula: "tool" })),
440
444
  );
441
445
  ```
442
446
 
@@ -447,17 +451,19 @@ Use `Platform.Unix` for shared Linux/macOS configuration:
447
451
  ```typescript
448
452
  export default defineTool((install) =>
449
453
  install()
450
- .bin('tool')
454
+ .bin("tool")
451
455
  .platform(Platform.Unix, (install) =>
452
- install('github-release', {
453
- repo: 'owner/tool',
454
- assetPattern: '*unix*.tar.gz',
455
- }))
456
+ install("github-release", {
457
+ repo: "owner/tool",
458
+ assetPattern: "*unix*.tar.gz",
459
+ }),
460
+ )
456
461
  .platform(Platform.Windows, (install) =>
457
- install('github-release', {
458
- repo: 'owner/tool',
459
- assetPattern: '*windows*.zip',
460
- }))
462
+ install("github-release", {
463
+ repo: "owner/tool",
464
+ assetPattern: "*windows*.zip",
465
+ }),
466
+ ),
461
467
  );
462
468
  ```
463
469
 
@@ -465,20 +471,22 @@ export default defineTool((install) =>
465
471
 
466
472
  ```typescript
467
473
  export default defineTool((install) =>
468
- install('github-release', { repo: 'owner/tool' })
469
- .bin('tool')
474
+ install("github-release", { repo: "owner/tool" })
475
+ .bin("tool")
470
476
  .platform(Platform.Unix, (install) =>
471
477
  install().zsh((shell) =>
472
478
  shell.env({
473
- TOOL_CONFIG: '~/.config/tool',
474
- })
475
- ))
479
+ TOOL_CONFIG: "~/.config/tool",
480
+ }),
481
+ ),
482
+ )
476
483
  .platform(Platform.Windows, (install) =>
477
484
  install().powershell((shell) =>
478
485
  shell.env({
479
- TOOL_CONFIG: '~\\.config\\tool',
480
- })
481
- ))
486
+ TOOL_CONFIG: "~\\.config\\tool",
487
+ }),
488
+ ),
489
+ ),
482
490
  );
483
491
  ```
484
492
 
@@ -486,19 +494,19 @@ export default defineTool((install) =>
486
494
 
487
495
  ```typescript
488
496
  export default defineTool((install) =>
489
- install('github-release', { repo: 'owner/tool' })
490
- .bin('tool')
491
- .hook('after-install', async ({ systemInfo, $ }) => {
492
- if (systemInfo.platform === 'darwin') {
497
+ install("github-release", { repo: "owner/tool" })
498
+ .bin("tool")
499
+ .hook("after-install", async ({ systemInfo, $ }) => {
500
+ if (systemInfo.platform === "darwin") {
493
501
  await $`./setup-macos.sh`;
494
- } else if (systemInfo.platform === 'linux') {
502
+ } else if (systemInfo.platform === "linux") {
495
503
  await $`./setup-linux.sh`;
496
504
  }
497
505
 
498
- if (systemInfo.arch === 'arm64') {
506
+ if (systemInfo.arch === "arm64") {
499
507
  await $`./configure-arm64.sh`;
500
508
  }
501
- })
509
+ }),
502
510
  );
503
511
  ```
504
512
 
@@ -544,11 +552,11 @@ This creates:
544
552
 
545
553
  ```
546
554
  env/
547
- ├── source # POSIX shell activation script
548
- ├── source.ps1 # PowerShell activation script
549
- ├── config.ts # Dotfiles configuration
550
- ├── .config/ # XDG_CONFIG_HOME for tool configs
551
- └── tools/ # Tool configuration directory
555
+ ├── source # POSIX shell activation script
556
+ ├── source.ps1 # PowerShell activation script
557
+ ├── dotfiles.config.ts # Dotfiles configuration
558
+ ├── .config/ # XDG_CONFIG_HOME for tool configs
559
+ └── tools/ # Tool configuration directory
552
560
  ```
553
561
 
554
562
  ## Activating an Environment
@@ -581,13 +589,13 @@ Once activated, all dotfiles commands use the environment's configuration automa
581
589
  ```bash
582
590
  source env/source
583
591
 
584
- # These all use env/config.ts automatically
592
+ # These all use env/dotfiles.config.ts automatically
585
593
  dotfiles generate
586
594
  dotfiles install
587
595
  dotfiles update fd
588
596
  ```
589
597
 
590
- No need to pass `--config` - the CLI detects `DOTFILES_ENV_DIR` and uses its `config.ts`.
598
+ No need to pass `--config` - the CLI detects `DOTFILES_ENV_DIR` and uses its `dotfiles.config.ts`.
591
599
 
592
600
  ## Adding Tools
593
601
 
@@ -669,7 +677,7 @@ dotfiles env create .devenv
669
677
 
670
678
  # Add to version control
671
679
  echo ".devenv/.generated" >> .gitignore
672
- git add .devenv/config.ts .devenv/tools/ .devenv/source .devenv/source.ps1
680
+ git add .devenv/dotfiles.config.ts .devenv/tools/ .devenv/source .devenv/source.ps1
673
681
  git commit -m "Add development environment"
674
682
  ```
675
683
 
@@ -732,7 +740,7 @@ env/
732
740
  │ └── <installed tools>
733
741
  ├── source
734
742
  ├── source.ps1
735
- ├── config.ts
743
+ ├── dotfiles.config.ts
736
744
  ├── .config/
737
745
  └── tools/
738
746
  ```
@@ -748,13 +756,13 @@ Real-world examples for common tool configuration scenarios.
748
756
  ## GitHub Tool with Shell Integration
749
757
 
750
758
  ```typescript
751
- import { defineTool } from '@alexgorbatchev/dotfiles';
759
+ import { defineTool } from "@alexgorbatchev/dotfiles";
752
760
 
753
761
  export default defineTool((install, ctx) =>
754
- install('github-release', { repo: 'BurntSushi/ripgrep' })
755
- .bin('rg')
756
- .zsh((shell) => shell.completions('complete/_rg').aliases({ rg: 'ripgrep' }))
757
- .bash((shell) => shell.completions('complete/rg.bash'))
762
+ install("github-release", { repo: "BurntSushi/ripgrep" })
763
+ .bin("rg")
764
+ .zsh((shell) => shell.completions("complete/_rg").aliases({ rg: "ripgrep" }))
765
+ .bash((shell) => shell.completions("complete/rg.bash")),
758
766
  );
759
767
  ```
760
768
 
@@ -764,29 +772,29 @@ Use `.dependsOn()` when a tool needs other binaries to exist first:
764
772
 
765
773
  ```typescript
766
774
  // provider.tool.ts
767
- export default defineTool((install) => install('manual', { binaryPath: './bin/provider' }).bin('provider'));
775
+ export default defineTool((install) => install("manual", { binaryPath: "./bin/provider" }).bin("provider"));
768
776
 
769
777
  // consumer.tool.ts
770
778
  export default defineTool((install) =>
771
- install('github-release', { repo: 'owner/consumer' }).bin('consumer').dependsOn('provider')
779
+ install("github-release", { repo: "owner/consumer" }).bin("consumer").dependsOn("provider"),
772
780
  );
773
781
  ```
774
782
 
775
783
  ## Complex Shell Integration
776
784
 
777
785
  ```typescript
778
- import { defineTool } from '@alexgorbatchev/dotfiles';
786
+ import { defineTool } from "@alexgorbatchev/dotfiles";
779
787
 
780
788
  export default defineTool((install, ctx) =>
781
- install('github-release', { repo: 'junegunn/fzf' })
782
- .bin('fzf')
789
+ install("github-release", { repo: "junegunn/fzf" })
790
+ .bin("fzf")
783
791
  .zsh((shell) =>
784
- shell.env({ FZF_DEFAULT_OPTS: '--color=fg+:cyan' }).completions('shell/completion.zsh').always(/* zsh */ `
792
+ shell.env({ FZF_DEFAULT_OPTS: "--color=fg+:cyan" }).completions("shell/completion.zsh").always(/* zsh */ `
785
793
  if [[ -f "${ctx.currentDir}/shell/key-bindings.zsh" ]]; then
786
794
  source "${ctx.currentDir}/shell/key-bindings.zsh"
787
795
  fi
788
- `)
789
- )
796
+ `),
797
+ ),
790
798
  );
791
799
  ```
792
800
 
@@ -794,51 +802,53 @@ export default defineTool((install, ctx) =>
794
802
 
795
803
  ```typescript
796
804
  export default defineTool((install) =>
797
- install('github-release', { repo: 'owner/tool' })
798
- .bin('tool')
805
+ install("github-release", { repo: "owner/tool" })
806
+ .bin("tool")
799
807
  .zsh((shell) =>
800
- shell.completions('completions/_tool').env({ TOOL_CONFIG: '~/.config/tool' }).aliases({ t: 'tool' })
808
+ shell.completions("completions/_tool").env({ TOOL_CONFIG: "~/.config/tool" }).aliases({ t: "tool" }),
801
809
  )
802
810
  .bash((shell) =>
803
- shell.completions('completions/tool.bash').env({ TOOL_CONFIG: '~/.config/tool' }).aliases({ t: 'tool' })
804
- )
811
+ shell.completions("completions/tool.bash").env({ TOOL_CONFIG: "~/.config/tool" }).aliases({ t: "tool" }),
812
+ ),
805
813
  );
806
814
  ```
807
815
 
808
816
  ## With Hooks
809
817
 
810
818
  ```typescript
811
- import { defineTool } from '@alexgorbatchev/dotfiles';
819
+ import { defineTool } from "@alexgorbatchev/dotfiles";
812
820
 
813
821
  export default defineTool((install) =>
814
- install('github-release', { repo: 'owner/tool' })
815
- .bin('tool')
816
- .symlink('./config.yml', '~/.config/tool/config.yml')
817
- .hook('after-install', async ({ installedDir, fileSystem, $ }) => {
822
+ install("github-release", { repo: "owner/tool" })
823
+ .bin("tool")
824
+ .symlink("./config.yml", "~/.config/tool/config.yml")
825
+ .hook("after-install", async ({ installedDir, fileSystem, $ }) => {
818
826
  await $`${installedDir}/tool init`;
819
- })
827
+ }),
820
828
  );
821
829
  ```
822
830
 
823
831
  ## Platform-Specific Installation
824
832
 
825
833
  ```typescript
826
- import { Architecture, defineTool, Platform } from '@alexgorbatchev/dotfiles';
834
+ import { Architecture, defineTool, Platform } from "@alexgorbatchev/dotfiles";
827
835
 
828
836
  export default defineTool((install, ctx) =>
829
- install('github-release', { repo: 'owner/tool' })
830
- .bin('tool')
831
- .platform(Platform.MacOS, (installMac) => installMac('brew', { formula: 'tool' }))
837
+ install("github-release", { repo: "owner/tool" })
838
+ .bin("tool")
839
+ .platform(Platform.MacOS, (installMac) => installMac("brew", { formula: "tool" }))
832
840
  .platform(Platform.Linux, (installLinux) =>
833
- installLinux('github-release', {
834
- repo: 'owner/tool',
835
- assetPattern: '*linux*.tar.gz',
836
- }))
841
+ installLinux("github-release", {
842
+ repo: "owner/tool",
843
+ assetPattern: "*linux*.tar.gz",
844
+ }),
845
+ )
837
846
  .platform(Platform.Windows, Architecture.Arm64, (installWin) =>
838
- installWin('github-release', {
839
- repo: 'owner/tool',
840
- assetPattern: '*windows-arm64.zip',
841
- }))
847
+ installWin("github-release", {
848
+ repo: "owner/tool",
849
+ assetPattern: "*windows-arm64.zip",
850
+ }),
851
+ ),
842
852
  );
843
853
  ```
844
854
 
@@ -846,12 +856,12 @@ export default defineTool((install, ctx) =>
846
856
 
847
857
  ```typescript
848
858
  export default defineTool((install) =>
849
- install('cargo', {
850
- crateName: 'eza',
851
- githubRepo: 'eza-community/eza',
859
+ install("cargo", {
860
+ crateName: "eza",
861
+ githubRepo: "eza-community/eza",
852
862
  })
853
- .bin('eza')
854
- .zsh((shell) => shell.completions('completions/eza.zsh').aliases({ ls: 'eza', ll: 'eza -l', la: 'eza -la' }))
863
+ .bin("eza")
864
+ .zsh((shell) => shell.completions("completions/eza.zsh").aliases({ ls: "eza", ll: "eza -l", la: "eza -la" })),
855
865
  );
856
866
  ```
857
867
 
@@ -859,15 +869,15 @@ export default defineTool((install) =>
859
869
 
860
870
  ```typescript
861
871
  export default defineTool((install) =>
862
- install('manual', { binaryPath: './scripts/deploy.sh' })
863
- .bin('deploy')
864
- .symlink('./deploy.config.yaml', '~/.config/deploy/config.yaml')
872
+ install("manual", { binaryPath: "./scripts/deploy.sh" })
873
+ .bin("deploy")
874
+ .symlink("./deploy.config.yaml", "~/.config/deploy/config.yaml")
865
875
  .zsh((shell) =>
866
876
  shell.aliases({
867
- dp: 'deploy',
868
- 'deploy-prod': 'deploy --env production',
869
- })
870
- )
877
+ dp: "deploy",
878
+ "deploy-prod": "deploy --env production",
879
+ }),
880
+ ),
871
881
  );
872
882
  ```
873
883
 
@@ -876,8 +886,8 @@ export default defineTool((install) =>
876
886
  ```typescript
877
887
  export default defineTool((install) =>
878
888
  install()
879
- .symlink('./gitconfig', '~/.gitconfig')
880
- .zsh((shell) => shell.aliases({ g: 'git', gs: 'git status', ga: 'git add' }).env({ GIT_EDITOR: 'nvim' }))
889
+ .symlink("./gitconfig", "~/.gitconfig")
890
+ .zsh((shell) => shell.aliases({ g: "git", gs: "git status", ga: "git add" }).env({ GIT_EDITOR: "nvim" })),
881
891
  );
882
892
  ```
883
893
 
@@ -885,16 +895,16 @@ export default defineTool((install) =>
885
895
 
886
896
  ```typescript
887
897
  export default defineTool((install) =>
888
- install('github-release', {
889
- repo: 'owner/tool',
898
+ install("github-release", {
899
+ repo: "owner/tool",
890
900
  assetSelector: ({ assets, systemInfo }) => {
891
- const platformMap: Record<string, string> = { darwin: 'macos', linux: 'linux' };
892
- const archMap: Record<string, string> = { x64: 'amd64', arm64: 'arm64' };
901
+ const platformMap: Record<string, string> = { darwin: "macos", linux: "linux" };
902
+ const archMap: Record<string, string> = { x64: "amd64", arm64: "arm64" };
893
903
  const platform = platformMap[systemInfo.platform];
894
904
  const arch = archMap[systemInfo.arch];
895
- return assets.find((a) => a.name.includes(platform) && a.name.includes(arch) && a.name.endsWith('.tar.gz'));
905
+ return assets.find((a) => a.name.includes(platform) && a.name.includes(arch) && a.name.endsWith(".tar.gz"));
896
906
  },
897
- }).bin('tool')
907
+ }).bin("tool"),
898
908
  );
899
909
  ```
900
910
 
@@ -924,20 +934,20 @@ For non-standard release naming, use `assetSelector`:
924
934
 
925
935
  ```typescript
926
936
  export default defineTool((install) =>
927
- install('github-release', {
928
- repo: 'owner/tool',
937
+ install("github-release", {
938
+ repo: "owner/tool",
929
939
  assetSelector: ({ assets, systemInfo, release, log }) => {
930
- const osMap: Record<string, string> = { darwin: 'macos', linux: 'linux' };
931
- const archMap: Record<string, string> = { x64: 'amd64', arm64: 'arm64' };
940
+ const osMap: Record<string, string> = { darwin: "macos", linux: "linux" };
941
+ const archMap: Record<string, string> = { x64: "amd64", arm64: "arm64" };
932
942
 
933
943
  return assets.find(
934
944
  (a) =>
935
945
  a.name.includes(osMap[systemInfo.platform]) &&
936
946
  a.name.includes(archMap[systemInfo.arch]) &&
937
- a.name.endsWith('.tar.gz'),
947
+ a.name.endsWith(".tar.gz"),
938
948
  );
939
949
  },
940
- }).bin('tool')
950
+ }).bin("tool"),
941
951
  );
942
952
  ```
943
953
 
@@ -946,13 +956,13 @@ export default defineTool((install) =>
946
956
  Use environment variables for runtime configuration:
947
957
 
948
958
  ```typescript
949
- const isDev = process.env.NODE_ENV === 'development';
959
+ const isDev = process.env.NODE_ENV === "development";
950
960
 
951
961
  export default defineTool((install) =>
952
- install('github-release', { repo: 'owner/tool' })
953
- .bin('tool')
954
- .version(isDev ? 'latest' : 'v1.2.3')
955
- .zsh((shell) => shell.env({ TOOL_LOG_LEVEL: isDev ? 'debug' : 'info' }))
962
+ install("github-release", { repo: "owner/tool" })
963
+ .bin("tool")
964
+ .version(isDev ? "latest" : "v1.2.3")
965
+ .zsh((shell) => shell.env({ TOOL_LOG_LEVEL: isDev ? "debug" : "info" })),
956
966
  );
957
967
  ```
958
968
 
@@ -962,10 +972,10 @@ Choose methods based on system capabilities:
962
972
 
963
973
  ```typescript
964
974
  export default defineTool((install) => {
965
- if (process.platform === 'darwin' && process.env.HOMEBREW_PREFIX) {
966
- return install('brew', { formula: 'tool' }).bin('tool');
975
+ if (process.platform === "darwin" && process.env.HOMEBREW_PREFIX) {
976
+ return install("brew", { formula: "tool" }).bin("tool");
967
977
  }
968
- return install('github-release', { repo: 'owner/tool' }).bin('tool');
978
+ return install("github-release", { repo: "owner/tool" }).bin("tool");
969
979
  });
970
980
  ```
971
981
 
@@ -973,15 +983,15 @@ export default defineTool((install) => {
973
983
 
974
984
  ```typescript
975
985
  export default defineTool((install) =>
976
- install('github-release', { repo: 'owner/tool' })
977
- .bin('tool')
978
- .hook('after-extract', async ({ extractDir, stagingDir, $ }) => {
986
+ install("github-release", { repo: "owner/tool" })
987
+ .bin("tool")
988
+ .hook("after-extract", async ({ extractDir, stagingDir, $ }) => {
979
989
  if (extractDir && stagingDir) {
980
990
  await $`cd ${extractDir} && ./configure --prefix=${stagingDir}`;
981
991
  await $`cd ${extractDir} && make -j$(nproc)`;
982
992
  await $`cd ${extractDir} && make install`;
983
993
  }
984
- })
994
+ }),
985
995
  );
986
996
  ```
987
997
 
@@ -991,16 +1001,16 @@ Combine `.dependsOn()` with hooks for version checks:
991
1001
 
992
1002
  ```typescript
993
1003
  export default defineTool((install) =>
994
- install('github-release', { repo: 'owner/tool' })
995
- .bin('tool')
996
- .dependsOn('node')
997
- .hook('before-install', async ({ log, $ }) => {
1004
+ install("github-release", { repo: "owner/tool" })
1005
+ .bin("tool")
1006
+ .dependsOn("node")
1007
+ .hook("before-install", async ({ log, $ }) => {
998
1008
  const result = await $`node --version`.nothrow();
999
1009
  if (result.exitCode !== 0) {
1000
- throw new Error('Node is required but not available');
1010
+ throw new Error("Node is required but not available");
1001
1011
  }
1002
1012
  log.info(`Using Node ${result.stdout.toString().trim()}`);
1003
- })
1013
+ }),
1004
1014
  );
1005
1015
  ```
1006
1016
 
@@ -1008,8 +1018,8 @@ export default defineTool((install) =>
1008
1018
 
1009
1019
  ```typescript
1010
1020
  export default defineTool((install, ctx) =>
1011
- install('github-release', { repo: 'owner/tool' })
1012
- .bin('tool')
1021
+ install("github-release", { repo: "owner/tool" })
1022
+ .bin("tool")
1013
1023
  .zsh((shell) =>
1014
1024
  shell.always(`
1015
1025
  function expensive-fn() {
@@ -1017,8 +1027,8 @@ export default defineTool((install, ctx) =>
1017
1027
  source "${ctx.currentDir}/expensive.zsh"
1018
1028
  expensive-fn "$@"
1019
1029
  }
1020
- `)
1021
- )
1030
+ `),
1031
+ ),
1022
1032
  );
1023
1033
  ```
1024
1034
 
@@ -1026,8 +1036,8 @@ export default defineTool((install, ctx) =>
1026
1036
 
1027
1037
  ```typescript
1028
1038
  export default defineTool((install, ctx) =>
1029
- install('github-release', { repo: 'owner/tool' })
1030
- .bin('tool')
1039
+ install("github-release", { repo: "owner/tool" })
1040
+ .bin("tool")
1031
1041
  .zsh((shell) =>
1032
1042
  shell
1033
1043
  .once(
@@ -1035,8 +1045,8 @@ export default defineTool((install, ctx) =>
1035
1045
  tool completion zsh > "${ctx.projectConfig.paths.generatedDir}/completions/_tool"
1036
1046
  `,
1037
1047
  )
1038
- .completions(`${ctx.projectConfig.paths.generatedDir}/completions/_tool`)
1039
- )
1048
+ .completions(`${ctx.projectConfig.paths.generatedDir}/completions/_tool`),
1049
+ ),
1040
1050
  );
1041
1051
  ```
1042
1052
 
@@ -1044,12 +1054,12 @@ export default defineTool((install, ctx) =>
1044
1054
 
1045
1055
  ```typescript
1046
1056
  export default defineTool((install) =>
1047
- install('github-release', { repo: 'owner/tool' })
1048
- .bin('tool')
1049
- .hook('after-install', async ({ $, log }) => {
1057
+ install("github-release", { repo: "owner/tool" })
1058
+ .bin("tool")
1059
+ .hook("after-install", async ({ $, log }) => {
1050
1060
  await Promise.all([$`tool setup-task-1`, $`tool setup-task-2`, $`tool setup-task-3`]);
1051
- log.info('All setup tasks completed');
1052
- })
1061
+ log.info("All setup tasks completed");
1062
+ }),
1053
1063
  );
1054
1064
  ```
1055
1065