@alexgorbatchev/dotfiles 0.0.6 → 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.
- package/README.md +45 -47
- package/cli.js +157 -157
- package/cli.js.map +274 -274
- package/dashboard-vf1askzj.js +159 -0
- package/{dashboard-0ebz5sqb.js.map → dashboard-vf1askzj.js.map} +33 -33
- package/dashboard.js +11 -11
- package/package.json +1 -1
- package/schemas.d.ts +106 -100
- package/skill/SKILL.md +7 -5
- package/skill/references/api-reference.md +49 -49
- package/skill/references/configuration.md +184 -174
- package/skill/references/installation-methods/brew.md +18 -18
- package/skill/references/installation-methods/cargo.md +19 -19
- package/skill/references/installation-methods/curl-binary.md +29 -27
- package/skill/references/installation-methods/curl-script.md +28 -28
- package/skill/references/installation-methods/curl-tar.md +27 -19
- package/skill/references/installation-methods/dmg.md +24 -24
- package/skill/references/installation-methods/gitea-release.md +24 -24
- package/skill/references/installation-methods/github-release.md +20 -20
- package/skill/references/installation-methods/manual.md +18 -18
- package/skill/references/installation-methods/npm.md +19 -19
- package/skill/references/installation-methods/overview.md +74 -75
- package/skill/references/installation-methods/zsh-plugin.md +31 -32
- package/skill/references/make-tool.md +168 -167
- package/skill/references/shell-and-hooks.md +78 -77
- package/dashboard-0ebz5sqb.js +0 -159
|
@@ -76,18 +76,18 @@ For other context properties (`toolDir`, `currentDir`, `projectConfig`, etc.), u
|
|
|
76
76
|
|
|
77
77
|
```typescript
|
|
78
78
|
export default defineTool((install, ctx) =>
|
|
79
|
-
install(
|
|
80
|
-
.bin(
|
|
79
|
+
install("github-release", { repo: "owner/tool" })
|
|
80
|
+
.bin("tool")
|
|
81
81
|
.zsh((shell) =>
|
|
82
82
|
shell
|
|
83
83
|
.env({ TOOL_HOME: ctx.currentDir })
|
|
84
84
|
.path(`${ctx.currentDir}/bin`) // Add tool's bin directory to PATH
|
|
85
|
-
.aliases({ t:
|
|
86
|
-
.completions(
|
|
85
|
+
.aliases({ t: "tool", ts: "tool status" })
|
|
86
|
+
.completions("completions/_tool")
|
|
87
87
|
.functions({
|
|
88
|
-
|
|
89
|
-
})
|
|
90
|
-
)
|
|
88
|
+
"tool-helper": 'tool --config "$TOOL_HOME/config.toml" "$@"',
|
|
89
|
+
}),
|
|
90
|
+
),
|
|
91
91
|
);
|
|
92
92
|
```
|
|
93
93
|
|
|
@@ -259,13 +259,13 @@ For expensive operations:
|
|
|
259
259
|
|
|
260
260
|
```typescript
|
|
261
261
|
export default defineTool((install, ctx) =>
|
|
262
|
-
install(
|
|
263
|
-
.bin(
|
|
262
|
+
install("github-release", { repo: "owner/tool" })
|
|
263
|
+
.bin("tool")
|
|
264
264
|
.zsh((shell) =>
|
|
265
265
|
shell.once(`
|
|
266
266
|
tool gen-completions --zsh > "${ctx.projectConfig.paths.generatedDir}/completions/_tool"
|
|
267
|
-
`)
|
|
268
|
-
)
|
|
267
|
+
`),
|
|
268
|
+
),
|
|
269
269
|
);
|
|
270
270
|
```
|
|
271
271
|
|
|
@@ -275,9 +275,9 @@ Share configuration across shells using the outer `ctx` from `defineTool`:
|
|
|
275
275
|
|
|
276
276
|
```typescript
|
|
277
277
|
export default defineTool((install, ctx) => {
|
|
278
|
-
const configureShell = (shell) => shell.env({ TOOL_HOME: ctx.currentDir }).aliases({ t:
|
|
278
|
+
const configureShell = (shell) => shell.env({ TOOL_HOME: ctx.currentDir }).aliases({ t: "tool" });
|
|
279
279
|
|
|
280
|
-
return install(
|
|
280
|
+
return install("github-release", { repo: "owner/tool" }).bin("tool").zsh(configureShell).bash(configureShell);
|
|
281
281
|
});
|
|
282
282
|
```
|
|
283
283
|
|
|
@@ -287,17 +287,17 @@ Always use context variables from the outer `ctx`:
|
|
|
287
287
|
|
|
288
288
|
```typescript
|
|
289
289
|
export default defineTool((install, ctx) =>
|
|
290
|
-
install(
|
|
291
|
-
.bin(
|
|
290
|
+
install("github-release", { repo: "owner/tool" })
|
|
291
|
+
.bin("tool")
|
|
292
292
|
.zsh((shell) =>
|
|
293
293
|
shell.env({
|
|
294
294
|
TOOL_CONFIG: ctx.toolDir, // Tool config directory
|
|
295
|
-
TOOL_DATA:
|
|
295
|
+
TOOL_DATA: "~/.local/share/tool",
|
|
296
296
|
}).always(`
|
|
297
297
|
FZF_DIR="${ctx.projectConfig.paths.binariesDir}/fzf"
|
|
298
298
|
[[ -d "$FZF_DIR" ]] && export FZF_BASE="$FZF_DIR"
|
|
299
|
-
`)
|
|
300
|
-
)
|
|
299
|
+
`),
|
|
300
|
+
),
|
|
301
301
|
);
|
|
302
302
|
```
|
|
303
303
|
|
|
@@ -347,15 +347,15 @@ tools/my-tool/
|
|
|
347
347
|
|
|
348
348
|
```typescript
|
|
349
349
|
export default defineTool((install) =>
|
|
350
|
-
install(
|
|
351
|
-
.bin(
|
|
352
|
-
.symlink(
|
|
353
|
-
.symlink(
|
|
350
|
+
install("github-release", { repo: "owner/my-tool" })
|
|
351
|
+
.bin("my-tool")
|
|
352
|
+
.symlink("./config.toml", "~/.config/my-tool/config.toml")
|
|
353
|
+
.symlink("./themes/", "~/.config/my-tool/themes")
|
|
354
354
|
.zsh((shell) =>
|
|
355
355
|
shell.env({
|
|
356
|
-
MY_TOOL_CONFIG:
|
|
357
|
-
})
|
|
358
|
-
)
|
|
356
|
+
MY_TOOL_CONFIG: "~/.config/my-tool/config.toml",
|
|
357
|
+
}),
|
|
358
|
+
),
|
|
359
359
|
);
|
|
360
360
|
```
|
|
361
361
|
|
|
@@ -430,9 +430,9 @@ For other context properties (`toolDir`, `currentDir`, `projectConfig`, etc.), u
|
|
|
430
430
|
|
|
431
431
|
```typescript
|
|
432
432
|
export default defineTool((install, ctx) =>
|
|
433
|
-
install(
|
|
434
|
-
.bin(
|
|
435
|
-
.zsh((shell) => shell.completions(
|
|
433
|
+
install("github-release", { repo: "owner/tool" })
|
|
434
|
+
.bin("tool")
|
|
435
|
+
.zsh((shell) => shell.completions("completions/_tool.zsh")),
|
|
436
436
|
);
|
|
437
437
|
```
|
|
438
438
|
|
|
@@ -541,16 +541,16 @@ Hooks allow custom logic at different stages of the installation process.
|
|
|
541
541
|
## Basic Usage
|
|
542
542
|
|
|
543
543
|
```typescript
|
|
544
|
-
import { defineTool } from
|
|
544
|
+
import { defineTool } from "@alexgorbatchev/dotfiles";
|
|
545
545
|
|
|
546
546
|
export default defineTool((install, ctx) =>
|
|
547
|
-
install(
|
|
548
|
-
.bin(
|
|
549
|
-
.hook(
|
|
547
|
+
install("github-release", { repo: "owner/tool" })
|
|
548
|
+
.bin("tool")
|
|
549
|
+
.hook("after-install", async (context) => {
|
|
550
550
|
const { $, log, fileSystem } = context;
|
|
551
551
|
await $`./tool init`;
|
|
552
|
-
log.info(
|
|
553
|
-
})
|
|
552
|
+
log.info("Tool initialized");
|
|
553
|
+
}),
|
|
554
554
|
);
|
|
555
555
|
```
|
|
556
556
|
|
|
@@ -709,53 +709,53 @@ This logging happens regardless of whether `.quiet()` is used on the shell comma
|
|
|
709
709
|
### Custom Binary Processing
|
|
710
710
|
|
|
711
711
|
```typescript
|
|
712
|
-
import { defineTool } from
|
|
713
|
-
import path from
|
|
712
|
+
import { defineTool } from "@alexgorbatchev/dotfiles";
|
|
713
|
+
import path from "path";
|
|
714
714
|
|
|
715
715
|
export default defineTool((install, ctx) =>
|
|
716
|
-
install(
|
|
717
|
-
.bin(
|
|
718
|
-
.hook(
|
|
716
|
+
install("github-release", { repo: "owner/custom-tool" })
|
|
717
|
+
.bin("custom-tool")
|
|
718
|
+
.hook("after-extract", async ({ extractDir, stagingDir, fileSystem, log }) => {
|
|
719
719
|
if (extractDir) {
|
|
720
720
|
// Custom binary selection and processing
|
|
721
|
-
const binaries = await fileSystem.readdir(path.join(extractDir,
|
|
722
|
-
const mainBinary = binaries.find((name) => name.startsWith(
|
|
721
|
+
const binaries = await fileSystem.readdir(path.join(extractDir, "bin"));
|
|
722
|
+
const mainBinary = binaries.find((name) => name.startsWith("main-"));
|
|
723
723
|
|
|
724
724
|
if (mainBinary) {
|
|
725
|
-
const sourcePath = path.join(extractDir,
|
|
726
|
-
const targetPath = path.join(stagingDir ??
|
|
725
|
+
const sourcePath = path.join(extractDir, "bin", mainBinary);
|
|
726
|
+
const targetPath = path.join(stagingDir ?? "", "tool");
|
|
727
727
|
await fileSystem.copy(sourcePath, targetPath);
|
|
728
728
|
log.info(`Selected binary: ${mainBinary}`);
|
|
729
729
|
}
|
|
730
730
|
}
|
|
731
|
-
})
|
|
731
|
+
}),
|
|
732
732
|
);
|
|
733
733
|
```
|
|
734
734
|
|
|
735
735
|
### Environment-Specific Setup
|
|
736
736
|
|
|
737
737
|
```typescript
|
|
738
|
-
import { defineTool } from
|
|
738
|
+
import { defineTool } from "@alexgorbatchev/dotfiles";
|
|
739
739
|
|
|
740
740
|
export default defineTool((install, ctx) =>
|
|
741
|
-
install(
|
|
742
|
-
.bin(
|
|
743
|
-
.hook(
|
|
741
|
+
install("github-release", { repo: "owner/custom-tool" })
|
|
742
|
+
.bin("custom-tool")
|
|
743
|
+
.hook("after-install", async ({ systemInfo, fileSystem, log, $ }) => {
|
|
744
744
|
// Platform-specific setup
|
|
745
|
-
if (systemInfo.platform ===
|
|
745
|
+
if (systemInfo.platform === "darwin") {
|
|
746
746
|
// macOS-specific setup
|
|
747
747
|
await $`./setup-macos.sh`;
|
|
748
|
-
} else if (systemInfo.platform ===
|
|
748
|
+
} else if (systemInfo.platform === "linux") {
|
|
749
749
|
// Linux-specific setup
|
|
750
750
|
await $`./setup-linux.sh`;
|
|
751
751
|
}
|
|
752
752
|
|
|
753
753
|
// Architecture-specific setup
|
|
754
|
-
if (systemInfo.arch ===
|
|
755
|
-
log.info(
|
|
754
|
+
if (systemInfo.arch === "arm64") {
|
|
755
|
+
log.info("Configuring for ARM64 architecture");
|
|
756
756
|
await $`./configure-arm64.sh`;
|
|
757
757
|
}
|
|
758
|
-
})
|
|
758
|
+
}),
|
|
759
759
|
);
|
|
760
760
|
```
|
|
761
761
|
|
|
@@ -764,18 +764,18 @@ export default defineTool((install, ctx) =>
|
|
|
764
764
|
Set environment variables during installation (for curl-script installs):
|
|
765
765
|
|
|
766
766
|
```typescript
|
|
767
|
-
import { defineTool } from
|
|
767
|
+
import { defineTool } from "@alexgorbatchev/dotfiles";
|
|
768
768
|
|
|
769
769
|
export default defineTool((install) =>
|
|
770
|
-
install(
|
|
771
|
-
url:
|
|
772
|
-
shell:
|
|
770
|
+
install("curl-script", {
|
|
771
|
+
url: "https://example.com/install.sh",
|
|
772
|
+
shell: "bash",
|
|
773
773
|
env: {
|
|
774
|
-
INSTALL_DIR:
|
|
775
|
-
ENABLE_FEATURE:
|
|
776
|
-
API_KEY: process.env.TOOL_API_KEY ||
|
|
774
|
+
INSTALL_DIR: "~/.local/bin",
|
|
775
|
+
ENABLE_FEATURE: "true",
|
|
776
|
+
API_KEY: process.env.TOOL_API_KEY || "default",
|
|
777
777
|
},
|
|
778
|
-
}).bin(
|
|
778
|
+
}).bin("my-tool"),
|
|
779
779
|
);
|
|
780
780
|
```
|
|
781
781
|
|
|
@@ -803,38 +803,39 @@ export default defineTool((install) =>
|
|
|
803
803
|
## Complete Example
|
|
804
804
|
|
|
805
805
|
```typescript
|
|
806
|
-
import { defineTool } from
|
|
807
|
-
import path from
|
|
806
|
+
import { defineTool } from "@alexgorbatchev/dotfiles";
|
|
807
|
+
import path from "path";
|
|
808
808
|
|
|
809
809
|
export default defineTool((install, ctx) =>
|
|
810
|
-
install(
|
|
811
|
-
.bin(
|
|
812
|
-
.symlink(
|
|
813
|
-
.hook(
|
|
814
|
-
log.info(
|
|
810
|
+
install("github-release", { repo: "owner/custom-tool" })
|
|
811
|
+
.bin("custom-tool")
|
|
812
|
+
.symlink("./config.yml", "~/.config/custom-tool/config.yml")
|
|
813
|
+
.hook("before-install", async ({ log }) => {
|
|
814
|
+
log.info("Starting custom-tool installation...");
|
|
815
815
|
})
|
|
816
|
-
.hook(
|
|
816
|
+
.hook("after-extract", async ({ extractDir, log, $ }) => {
|
|
817
817
|
if (extractDir) {
|
|
818
818
|
// Build additional components
|
|
819
|
-
log.info(
|
|
819
|
+
log.info("Building plugins...");
|
|
820
820
|
await $`cd ${extractDir} && make plugins`;
|
|
821
821
|
}
|
|
822
822
|
})
|
|
823
|
-
.hook(
|
|
823
|
+
.hook("after-install", async ({ toolName, installedDir, systemInfo, fileSystem, log, $ }) => {
|
|
824
824
|
// Create data directory
|
|
825
|
-
const dataDir = path.join(systemInfo.homeDir,
|
|
825
|
+
const dataDir = path.join(systemInfo.homeDir, ".local/share", toolName);
|
|
826
826
|
await fileSystem.mkdir(dataDir, { recursive: true });
|
|
827
827
|
|
|
828
828
|
// Initialize tool
|
|
829
|
-
await $`${path.join(installedDir ??
|
|
829
|
+
await $`${path.join(installedDir ?? "", toolName)} init --data-dir ${dataDir}`;
|
|
830
830
|
|
|
831
831
|
// Set up completion
|
|
832
|
-
await $`${
|
|
833
|
-
|
|
834
|
-
|
|
832
|
+
await $`${path.join(
|
|
833
|
+
installedDir ?? "",
|
|
834
|
+
toolName,
|
|
835
|
+
)} completion zsh > ${ctx.projectConfig.paths.generatedDir}/completions/_${toolName}`;
|
|
835
836
|
|
|
836
837
|
log.info(`Initialized ${toolName} with data directory: ${dataDir}`);
|
|
837
838
|
})
|
|
838
|
-
.zsh((shell) => shell.env({ CUSTOM_TOOL_DATA:
|
|
839
|
+
.zsh((shell) => shell.env({ CUSTOM_TOOL_DATA: "~/.local/share/custom-tool" }).aliases({ ct: "custom-tool" })),
|
|
839
840
|
);
|
|
840
841
|
```
|