@fredlackey/devutils 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.
Files changed (200) hide show
  1. package/README.md +156 -0
  2. package/bin/dev.js +16 -0
  3. package/files/README.md +0 -0
  4. package/files/claude/.claude/commands/setup-context.md +3 -0
  5. package/files/monorepos/_archive/README.md +36 -0
  6. package/files/monorepos/_legacy/README.md +36 -0
  7. package/files/monorepos/ai-docs/README.md +33 -0
  8. package/files/monorepos/apps/README.md +24 -0
  9. package/files/monorepos/docs/README.md +40 -0
  10. package/files/monorepos/packages/README.md +25 -0
  11. package/files/monorepos/research/README.md +29 -0
  12. package/files/monorepos/scripts/README.md +24 -0
  13. package/package.json +39 -0
  14. package/src/cli.js +68 -0
  15. package/src/commands/README.md +41 -0
  16. package/src/commands/configure.js +199 -0
  17. package/src/commands/identity.js +1630 -0
  18. package/src/commands/ignore.js +247 -0
  19. package/src/commands/install.js +173 -0
  20. package/src/commands/setup.js +212 -0
  21. package/src/commands/status.js +223 -0
  22. package/src/completion.js +284 -0
  23. package/src/constants.js +45 -0
  24. package/src/ignore/claude-code.txt +10 -0
  25. package/src/ignore/docker.txt +18 -0
  26. package/src/ignore/linux.txt +23 -0
  27. package/src/ignore/macos.txt +36 -0
  28. package/src/ignore/node.txt +55 -0
  29. package/src/ignore/terraform.txt +37 -0
  30. package/src/ignore/vscode.txt +18 -0
  31. package/src/ignore/windows.txt +35 -0
  32. package/src/index.js +0 -0
  33. package/src/installs/README.md +399 -0
  34. package/src/installs/adobe-creative-cloud.js +44 -0
  35. package/src/installs/appcleaner.js +44 -0
  36. package/src/installs/atomicparsley.js +44 -0
  37. package/src/installs/aws-cli.js +44 -0
  38. package/src/installs/balena-etcher.js +44 -0
  39. package/src/installs/bambu-studio.js +44 -0
  40. package/src/installs/bash-completion.js +44 -0
  41. package/src/installs/bash.js +44 -0
  42. package/src/installs/beyond-compare.js +44 -0
  43. package/src/installs/build-essential.js +44 -0
  44. package/src/installs/caffeine.js +44 -0
  45. package/src/installs/camtasia.js +44 -0
  46. package/src/installs/chatgpt.js +44 -0
  47. package/src/installs/chrome-canary.js +44 -0
  48. package/src/installs/chromium.js +44 -0
  49. package/src/installs/claude-code.js +44 -0
  50. package/src/installs/curl.js +44 -0
  51. package/src/installs/cursor.js +44 -0
  52. package/src/installs/dbschema.js +44 -0
  53. package/src/installs/docker.js +44 -0
  54. package/src/installs/drawio.js +44 -0
  55. package/src/installs/elmedia-player.js +44 -0
  56. package/src/installs/ffmpeg.js +44 -0
  57. package/src/installs/gemini-cli.js +44 -0
  58. package/src/installs/git.js +44 -0
  59. package/src/installs/gitego.js +44 -0
  60. package/src/installs/go.js +44 -0
  61. package/src/installs/google-chrome.js +44 -0
  62. package/src/installs/gpg.js +141 -0
  63. package/src/installs/homebrew.js +44 -0
  64. package/src/installs/imageoptim.js +44 -0
  65. package/src/installs/jq.js +44 -0
  66. package/src/installs/keyboard-maestro.js +44 -0
  67. package/src/installs/latex.js +44 -0
  68. package/src/installs/lftp.js +44 -0
  69. package/src/installs/messenger.js +44 -0
  70. package/src/installs/microsoft-office.js +44 -0
  71. package/src/installs/microsoft-teams.js +44 -0
  72. package/src/installs/node.js +44 -0
  73. package/src/installs/nordpass.js +44 -0
  74. package/src/installs/nvm.js +44 -0
  75. package/src/installs/openssh.js +134 -0
  76. package/src/installs/pandoc.js +44 -0
  77. package/src/installs/pinentry.js +44 -0
  78. package/src/installs/pngyu.js +44 -0
  79. package/src/installs/postman.js +44 -0
  80. package/src/installs/safari-tech-preview.js +44 -0
  81. package/src/installs/sfnt2woff.js +44 -0
  82. package/src/installs/shellcheck.js +44 -0
  83. package/src/installs/slack.js +44 -0
  84. package/src/installs/snagit.js +44 -0
  85. package/src/installs/spotify.js +44 -0
  86. package/src/installs/studio-3t.js +44 -0
  87. package/src/installs/sublime-text.js +44 -0
  88. package/src/installs/superwhisper.js +44 -0
  89. package/src/installs/tailscale.js +44 -0
  90. package/src/installs/termius.js +44 -0
  91. package/src/installs/terraform.js +44 -0
  92. package/src/installs/tidal.js +44 -0
  93. package/src/installs/tmux.js +44 -0
  94. package/src/installs/tree.js +44 -0
  95. package/src/installs/vim.js +44 -0
  96. package/src/installs/vlc.js +44 -0
  97. package/src/installs/vscode.js +44 -0
  98. package/src/installs/whatsapp.js +44 -0
  99. package/src/installs/woff2.js +44 -0
  100. package/src/installs/xcode.js +44 -0
  101. package/src/installs/yarn.js +44 -0
  102. package/src/installs/yq.js +44 -0
  103. package/src/installs/yt-dlp.js +44 -0
  104. package/src/installs/zoom.js +44 -0
  105. package/src/scripts/README.md +95 -0
  106. package/src/scripts/afk.js +23 -0
  107. package/src/scripts/backup-all.js +24 -0
  108. package/src/scripts/backup-source.js +24 -0
  109. package/src/scripts/brewd.js +23 -0
  110. package/src/scripts/brewi.js +24 -0
  111. package/src/scripts/brewr.js +24 -0
  112. package/src/scripts/brews.js +24 -0
  113. package/src/scripts/brewu.js +23 -0
  114. package/src/scripts/c.js +23 -0
  115. package/src/scripts/ccurl.js +24 -0
  116. package/src/scripts/certbot-crontab-init.js +24 -0
  117. package/src/scripts/certbot-init.js +25 -0
  118. package/src/scripts/ch.js +23 -0
  119. package/src/scripts/claude-danger.js +23 -0
  120. package/src/scripts/clean-dev.js +24 -0
  121. package/src/scripts/clear-dns-cache.js +23 -0
  122. package/src/scripts/clone.js +25 -0
  123. package/src/scripts/code-all.js +24 -0
  124. package/src/scripts/count-files.js +24 -0
  125. package/src/scripts/count-folders.js +24 -0
  126. package/src/scripts/count.js +24 -0
  127. package/src/scripts/d.js +23 -0
  128. package/src/scripts/datauri.js +24 -0
  129. package/src/scripts/delete-files.js +24 -0
  130. package/src/scripts/docker-clean.js +24 -0
  131. package/src/scripts/dp.js +23 -0
  132. package/src/scripts/e.js +24 -0
  133. package/src/scripts/empty-trash.js +23 -0
  134. package/src/scripts/evm.js +25 -0
  135. package/src/scripts/fetch-github-repos.js +25 -0
  136. package/src/scripts/get-channel.js +24 -0
  137. package/src/scripts/get-course.js +26 -0
  138. package/src/scripts/get-dependencies.js +25 -0
  139. package/src/scripts/get-folder.js +26 -0
  140. package/src/scripts/get-tunes.js +25 -0
  141. package/src/scripts/get-video.js +24 -0
  142. package/src/scripts/git-backup.js +25 -0
  143. package/src/scripts/git-clone.js +25 -0
  144. package/src/scripts/git-pup.js +23 -0
  145. package/src/scripts/git-push.js +24 -0
  146. package/src/scripts/h.js +24 -0
  147. package/src/scripts/hide-desktop-icons.js +23 -0
  148. package/src/scripts/hide-hidden-files.js +23 -0
  149. package/src/scripts/install-dependencies-from.js +25 -0
  150. package/src/scripts/ips.js +26 -0
  151. package/src/scripts/iso.js +24 -0
  152. package/src/scripts/killni.js +23 -0
  153. package/src/scripts/ll.js +24 -0
  154. package/src/scripts/local-ip.js +23 -0
  155. package/src/scripts/m.js +24 -0
  156. package/src/scripts/map.js +24 -0
  157. package/src/scripts/mkd.js +24 -0
  158. package/src/scripts/ncu-update-all.js +24 -0
  159. package/src/scripts/nginx-init.js +28 -0
  160. package/src/scripts/npmi.js +23 -0
  161. package/src/scripts/o.js +24 -0
  162. package/src/scripts/org-by-date.js +24 -0
  163. package/src/scripts/p.js +23 -0
  164. package/src/scripts/packages.js +25 -0
  165. package/src/scripts/path.js +23 -0
  166. package/src/scripts/ports.js +23 -0
  167. package/src/scripts/q.js +23 -0
  168. package/src/scripts/refresh-files.js +26 -0
  169. package/src/scripts/remove-smaller-files.js +24 -0
  170. package/src/scripts/rename-files-with-date.js +25 -0
  171. package/src/scripts/resize-image.js +25 -0
  172. package/src/scripts/rm-safe.js +24 -0
  173. package/src/scripts/s.js +24 -0
  174. package/src/scripts/set-git-public.js +23 -0
  175. package/src/scripts/show-desktop-icons.js +23 -0
  176. package/src/scripts/show-hidden-files.js +23 -0
  177. package/src/scripts/tpa.js +23 -0
  178. package/src/scripts/tpo.js +23 -0
  179. package/src/scripts/u.js +23 -0
  180. package/src/scripts/vpush.js +23 -0
  181. package/src/scripts/y.js +23 -0
  182. package/src/utils/README.md +95 -0
  183. package/src/utils/common/apps.js +143 -0
  184. package/src/utils/common/display.js +157 -0
  185. package/src/utils/common/network.js +185 -0
  186. package/src/utils/common/os.js +202 -0
  187. package/src/utils/common/package-manager.js +301 -0
  188. package/src/utils/common/privileges.js +138 -0
  189. package/src/utils/common/shell.js +195 -0
  190. package/src/utils/macos/apps.js +228 -0
  191. package/src/utils/macos/brew.js +315 -0
  192. package/src/utils/ubuntu/apt.js +301 -0
  193. package/src/utils/ubuntu/desktop.js +292 -0
  194. package/src/utils/ubuntu/snap.js +302 -0
  195. package/src/utils/ubuntu/systemd.js +286 -0
  196. package/src/utils/windows/choco.js +327 -0
  197. package/src/utils/windows/env.js +246 -0
  198. package/src/utils/windows/registry.js +269 -0
  199. package/src/utils/windows/shell.js +240 -0
  200. package/src/utils/windows/winget.js +378 -0
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Navigate to the projects directory.
5
+ * @module scripts/p
6
+ */
7
+
8
+ /**
9
+ * Changes the current working directory to the user's projects folder.
10
+ * Outputs the path for use with shell integration (e.g., cd $(p)).
11
+ *
12
+ * @param {string[]} args - Command line arguments (unused)
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement projects folder navigation
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Find all package.json files with modification dates.
5
+ * @module scripts/packages
6
+ */
7
+
8
+ /**
9
+ * Recursively finds all package.json files in the current directory
10
+ * and displays them with their modification timestamps, sorted by date.
11
+ * Excludes node_modules directories.
12
+ *
13
+ * @param {string[]} args - Command line arguments
14
+ * @param {string} [args.0] - Optional path to search (defaults to current directory)
15
+ * @returns {Promise<void>}
16
+ */
17
+ async function main(args) {
18
+ // TODO: Implement package.json finder
19
+ }
20
+
21
+ module.exports = { main };
22
+
23
+ if (require.main === module) {
24
+ main(process.argv.slice(2));
25
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Display PATH entries one per line.
5
+ * @module scripts/path
6
+ */
7
+
8
+ /**
9
+ * Outputs each directory in the system PATH environment variable
10
+ * on a separate line for easier reading.
11
+ *
12
+ * @param {string[]} args - Command line arguments (unused)
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement PATH display
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview List open network ports.
5
+ * @module scripts/ports
6
+ */
7
+
8
+ /**
9
+ * Displays a list of open network ports and the processes using them.
10
+ * Uses platform-specific commands (lsof, netstat, ss).
11
+ *
12
+ * @param {string[]} args - Command line arguments (unused)
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement port listing
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Exit the current shell session.
5
+ * @module scripts/q
6
+ */
7
+
8
+ /**
9
+ * Exits the current shell session.
10
+ * Provides a quick way to close the terminal.
11
+ *
12
+ * @param {string[]} args - Command line arguments (unused)
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement shell exit
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,26 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Copy matching files from source to target directory.
5
+ * @module scripts/refresh-files
6
+ */
7
+
8
+ /**
9
+ * Compares files in the target directory with a source directory
10
+ * and copies over files that exist in both locations from the source.
11
+ * Useful for refreshing files from a stable/reference project.
12
+ *
13
+ * @param {string[]} args - Command line arguments
14
+ * @param {string} args.0 - Source folder path
15
+ * @param {string} [args.1] - Target folder path (defaults to current directory)
16
+ * @returns {Promise<void>}
17
+ */
18
+ async function main(args) {
19
+ // TODO: Implement file refresh from source
20
+ }
21
+
22
+ module.exports = { main };
23
+
24
+ if (require.main === module) {
25
+ main(process.argv.slice(2));
26
+ }
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Compare directories and remove smaller duplicates.
5
+ * @module scripts/remove-smaller-files
6
+ */
7
+
8
+ /**
9
+ * Compares files between two directories and removes the smaller
10
+ * version of each matching file pair. Useful for deduplication.
11
+ *
12
+ * @param {string[]} args - Command line arguments
13
+ * @param {string} args.0 - Path to comparison directory
14
+ * @returns {Promise<void>}
15
+ */
16
+ async function main(args) {
17
+ // TODO: Implement duplicate removal by size
18
+ }
19
+
20
+ module.exports = { main };
21
+
22
+ if (require.main === module) {
23
+ main(process.argv.slice(2));
24
+ }
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Normalize date-based filenames.
5
+ * @module scripts/rename-files-with-date
6
+ */
7
+
8
+ /**
9
+ * Renames files containing dates in their filenames to a standardized
10
+ * format: "YYYY-MM-DD HH.MM.SS.ext". Handles various input formats
11
+ * like timestamps from cameras and screenshots.
12
+ *
13
+ * @param {string[]} args - Command line arguments
14
+ * @param {string} [args.0] - Path to process (defaults to current directory)
15
+ * @returns {Promise<void>}
16
+ */
17
+ async function main(args) {
18
+ // TODO: Implement filename date normalization
19
+ }
20
+
21
+ module.exports = { main };
22
+
23
+ if (require.main === module) {
24
+ main(process.argv.slice(2));
25
+ }
@@ -0,0 +1,25 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Resize image using ImageMagick.
5
+ * @module scripts/resize-image
6
+ */
7
+
8
+ /**
9
+ * Resizes an image using ImageMagick's convert command with
10
+ * high-quality settings. Creates a new file with underscore prefix.
11
+ *
12
+ * @param {string[]} args - Command line arguments
13
+ * @param {string} args.0 - Path to the image file
14
+ * @param {string} [args.1] - Resize geometry (default: "50%")
15
+ * @returns {Promise<void>}
16
+ */
17
+ async function main(args) {
18
+ // TODO: Implement image resizing
19
+ }
20
+
21
+ module.exports = { main };
22
+
23
+ if (require.main === module) {
24
+ main(process.argv.slice(2));
25
+ }
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Safe wrapper for rm preventing dangerous operations.
5
+ * @module scripts/rm-safe
6
+ */
7
+
8
+ /**
9
+ * A safer version of rm that prevents accidental removal of
10
+ * root directories, top-level system directories, and blocks
11
+ * dangerous flags like --no-preserve-root.
12
+ *
13
+ * @param {string[]} args - Command line arguments (passed to rm)
14
+ * @returns {Promise<void>}
15
+ */
16
+ async function main(args) {
17
+ // TODO: Implement safe rm wrapper
18
+ }
19
+
20
+ module.exports = { main };
21
+
22
+ if (require.main === module) {
23
+ main(process.argv.slice(2));
24
+ }
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Search text in current directory.
5
+ * @module scripts/s
6
+ */
7
+
8
+ /**
9
+ * Recursively searches for text matching the specified pattern
10
+ * in the current directory, excluding .git and node_modules.
11
+ *
12
+ * @param {string[]} args - Command line arguments
13
+ * @param {string} args.0 - Search pattern
14
+ * @returns {Promise<void>}
15
+ */
16
+ async function main(args) {
17
+ // TODO: Implement recursive text search
18
+ }
19
+
20
+ module.exports = { main };
21
+
22
+ if (require.main === module) {
23
+ main(process.argv.slice(2));
24
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Set git user to public identity.
5
+ * @module scripts/set-git-public
6
+ */
7
+
8
+ /**
9
+ * Configures the local git repository to use the public identity
10
+ * stored in the ~/.devutils configuration file.
11
+ *
12
+ * @param {string[]} args - Command line arguments (unused)
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement git identity configuration
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Show desktop icons in Finder.
5
+ * @module scripts/show-desktop-icons
6
+ */
7
+
8
+ /**
9
+ * Shows all icons on the macOS desktop by modifying Finder preferences
10
+ * and restarting Finder.
11
+ *
12
+ * @param {string[]} args - Command line arguments (unused)
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement desktop icon showing
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Show dotfiles in Finder.
5
+ * @module scripts/show-hidden-files
6
+ */
7
+
8
+ /**
9
+ * Configures Finder to show hidden files (dotfiles) and restarts Finder
10
+ * to apply the change.
11
+ *
12
+ * @param {string[]} args - Command line arguments (unused)
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement hidden file showing
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Terraform apply from plan file.
5
+ * @module scripts/tpa
6
+ */
7
+
8
+ /**
9
+ * Executes `terraform apply` using the previously saved "tfplan" file
10
+ * created by `tpo`.
11
+ *
12
+ * @param {string[]} args - Command line arguments to pass to terraform apply
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement terraform apply from plan
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Terraform plan with output file.
5
+ * @module scripts/tpo
6
+ */
7
+
8
+ /**
9
+ * Executes `terraform plan` and saves the plan to a file named "tfplan"
10
+ * for later application with `terraform apply`.
11
+ *
12
+ * @param {string[]} args - Command line arguments to pass to terraform plan
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement terraform plan with output
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Update system packages and tools.
5
+ * @module scripts/u
6
+ */
7
+
8
+ /**
9
+ * Updates the system's package manager and installed packages.
10
+ * Platform-specific: macOS (softwareupdate + Homebrew), Linux (apt/yum).
11
+ *
12
+ * @param {string[]} args - Command line arguments (unused)
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement system update
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Commit with package.json version as message.
5
+ * @module scripts/vpush
6
+ */
7
+
8
+ /**
9
+ * Stages all changes, commits using the version from package.json
10
+ * as the commit message, and pushes to the remote.
11
+ *
12
+ * @param {string[]} args - Command line arguments (unused)
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement version-based commit and push
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,23 @@
1
+ #!/usr/bin/env node
2
+
3
+ /**
4
+ * @fileoverview Shortcut for yarn commands.
5
+ * @module scripts/y
6
+ */
7
+
8
+ /**
9
+ * Executes yarn with the provided arguments.
10
+ * Acts as a shorthand for common yarn operations.
11
+ *
12
+ * @param {string[]} args - Command line arguments to pass to yarn
13
+ * @returns {Promise<void>}
14
+ */
15
+ async function main(args) {
16
+ // TODO: Implement yarn shortcut
17
+ }
18
+
19
+ module.exports = { main };
20
+
21
+ if (require.main === module) {
22
+ main(process.argv.slice(2));
23
+ }
@@ -0,0 +1,95 @@
1
+ # Utils
2
+
3
+ This folder contains internal shared utilities used by Commands, Scripts, and Installs.
4
+
5
+ ## Purpose
6
+
7
+ Utils provide common functionality that is reused across the package. These are **not** directly invokable by users — they are internal helpers.
8
+
9
+ ## Planned Utilities
10
+
11
+ | File | Description |
12
+ |------|-------------|
13
+ | `os.js` | Operating system detection (macOS, Debian, RHEL, Windows, WSL) |
14
+ | `shell.js` | Shell command execution wrappers |
15
+ | `config.js` | Read/write `~/.devutils` configuration file |
16
+ | `prompts.js` | Interactive user prompts and wizards |
17
+ | `logger.js` | Consistent logging and output formatting |
18
+ | `paths.js` | Path resolution and home directory helpers |
19
+ | `git.js` | Git repository detection and operations |
20
+ | `npm.js` | npm/package.json utilities |
21
+
22
+ ## Example: OS Detection
23
+
24
+ ```javascript
25
+ // utils/os.js
26
+
27
+ function detect() {
28
+ const platform = process.platform;
29
+
30
+ if (platform === 'darwin') {
31
+ return { type: 'macos', packageManager: 'brew' };
32
+ }
33
+
34
+ if (platform === 'linux') {
35
+ // Check for WSL
36
+ if (process.env.WSL_DISTRO_NAME) {
37
+ return { type: 'windows-wsl', packageManager: 'apt' };
38
+ }
39
+ // Check for Debian-based (apt)
40
+ if (fs.existsSync('/etc/debian_version')) {
41
+ return { type: 'debian', packageManager: 'apt' };
42
+ }
43
+ // Check for RHEL-based (yum/dnf)
44
+ if (fs.existsSync('/etc/redhat-release')) {
45
+ return { type: 'rhel', packageManager: 'dnf' };
46
+ }
47
+ }
48
+
49
+ if (platform === 'win32') {
50
+ return { type: 'windows', packageManager: 'choco' };
51
+ }
52
+
53
+ return { type: 'unknown', packageManager: null };
54
+ }
55
+
56
+ module.exports = { detect };
57
+ ```
58
+
59
+ ## Example: Config Helper
60
+
61
+ ```javascript
62
+ // utils/config.js
63
+ const fs = require('fs');
64
+ const path = require('path');
65
+ const os = require('os');
66
+
67
+ const CONFIG_PATH = path.join(os.homedir(), '.devutils');
68
+
69
+ function read() {
70
+ if (!fs.existsSync(CONFIG_PATH)) {
71
+ return null;
72
+ }
73
+ return JSON.parse(fs.readFileSync(CONFIG_PATH, 'utf8'));
74
+ }
75
+
76
+ function write(config) {
77
+ config.updated = new Date().toISOString();
78
+ fs.writeFileSync(CONFIG_PATH, JSON.stringify(config, null, 2));
79
+ }
80
+
81
+ module.exports = { read, write, CONFIG_PATH };
82
+ ```
83
+
84
+ ## Guidelines
85
+
86
+ 1. **Single responsibility** — Each util should do one thing well
87
+ 2. **No side effects** — Avoid global state; return values instead
88
+ 3. **Error handling** — Throw descriptive errors; let callers handle them
89
+ 4. **Platform-aware** — Consider cross-platform compatibility
90
+
91
+ ## Related
92
+
93
+ - **Commands** (`../commands/`) — Use utils for common operations
94
+ - **Scripts** (`../scripts/`) — Use utils for OS detection, shell execution
95
+ - **Installs** (`../installs/`) — Use `os.js` for platform detection