@crystalplatforms/adm 0.2.3
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 +210 -0
- package/bin/adm +26 -0
- package/bin/adm-tui +13 -0
- package/package.json +62 -0
- package/scripts/completion/adm.bash +81 -0
- package/scripts/completion/adm.zsh +89 -0
- package/scripts/install.js +8 -0
- package/src/ai/knowledge.js +61 -0
- package/src/commands/connect.js +76 -0
- package/src/commands/dotfiles.js +72 -0
- package/src/commands/issue.js +80 -0
- package/src/commands/pr.js +55 -0
- package/src/commands/theme.js +103 -0
- package/src/commands/uninstall.js +72 -0
- package/src/commands/upgrade.js +114 -0
- package/src/config/index.js +32 -0
- package/src/data/extensions.json +358 -0
- package/src/installer/git-config.js +34 -0
- package/src/installer/node-installer.js +50 -0
- package/src/installer/package-manager-installer.js +31 -0
- package/src/installer/ssh-setup.js +31 -0
- package/src/installer/system-packages.js +49 -0
- package/src/installers/index.js +66 -0
- package/src/integrations/ai-backend.js +60 -0
- package/src/integrations/ai-providers/registry.js +261 -0
- package/src/integrations/github.js +107 -0
- package/src/integrations/gitlab.js +121 -0
- package/src/plugins/context.js +64 -0
- package/src/plugins/loader.js +50 -0
- package/src/plugins/runner.js +25 -0
- package/src/setup/catalog.js +13 -0
- package/src/setup/installer.js +192 -0
- package/src/setup/wizard.js +220 -0
- package/src/shell/detector.js +10 -0
- package/src/tui/app-state.js +374 -0
- package/src/tui/app.js +442 -0
- package/src/tui/autocomplete.js +57 -0
- package/src/tui/commands/registry.js +823 -0
- package/src/tui/components/SetupScreen.js +292 -0
- package/src/ui/animations.js +24 -0
- package/src/ui/spinner.js +34 -0
- package/src/ui/theme/cyberpunk.js +14 -0
- package/src/ui/theme/dark.js +14 -0
- package/src/ui/theme/forest.js +14 -0
- package/src/ui/theme/light.js +14 -0
- package/src/ui/theme/monokai.js +14 -0
- package/src/ui/theme/nord.js +14 -0
- package/src/ui/theme.js +49 -0
- package/src/utils/command-history.js +43 -0
- package/src/utils/dotfiles-sync.js +89 -0
- package/src/utils/error-handler.js +69 -0
- package/src/utils/file-conflict-handler.js +30 -0
- package/src/utils/fuzzy-search.js +20 -0
- package/src/utils/github-error-handler.js +26 -0
- package/src/utils/keychain.js +97 -0
- package/src/utils/open-url.js +15 -0
- package/src/utils/terminal-detection.js +26 -0
- package/src/utils/token-encryption.js +96 -0
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
{
|
|
2
|
+
"categories": [
|
|
3
|
+
{
|
|
4
|
+
"id": "js-ts",
|
|
5
|
+
"name": "JavaScript / TypeScript",
|
|
6
|
+
"icon": "🟨",
|
|
7
|
+
"tools": [
|
|
8
|
+
{ "id": "node", "name": "Node.js", "installMethod": "nvm" },
|
|
9
|
+
{ "id": "npm", "name": "npm", "installMethod": "node" },
|
|
10
|
+
{ "id": "yarn", "name": "Yarn", "installMethod": "npm" },
|
|
11
|
+
{ "id": "pnpm", "name": "pnpm", "installMethod": "npm" },
|
|
12
|
+
{ "id": "bun", "name": "Bun", "installMethod": "script" },
|
|
13
|
+
{ "id": "typescript", "name": "TypeScript", "installMethod": "npm" },
|
|
14
|
+
{ "id": "ts-node", "name": "ts-node", "installMethod": "npm" },
|
|
15
|
+
{ "id": "vite", "name": "Vite", "installMethod": "npm" },
|
|
16
|
+
{ "id": "esbuild", "name": "esbuild", "installMethod": "npm" },
|
|
17
|
+
{ "id": "webpack", "name": "webpack", "installMethod": "npm" },
|
|
18
|
+
{ "id": "rollup", "name": "Rollup", "installMethod": "npm" },
|
|
19
|
+
{ "id": "parcel", "name": "Parcel", "installMethod": "npm" },
|
|
20
|
+
{ "id": "next", "name": "Next.js CLI", "installMethod": "npm" },
|
|
21
|
+
{ "id": "nuxt", "name": "Nuxt CLI", "installMethod": "npm" },
|
|
22
|
+
{ "id": "react-native", "name": "React Native CLI", "installMethod": "npm" },
|
|
23
|
+
{ "id": "expo", "name": "Expo CLI", "installMethod": "npm" },
|
|
24
|
+
{ "id": "gatsby", "name": "Gatsby CLI", "installMethod": "npm" },
|
|
25
|
+
{ "id": "angular", "name": "Angular CLI", "installMethod": "npm" },
|
|
26
|
+
{ "id": "vue", "name": "Vue CLI", "installMethod": "npm" },
|
|
27
|
+
{ "id": "svelte", "name": "Svelte CLI", "installMethod": "npm" },
|
|
28
|
+
{ "id": "jest", "name": "Jest", "installMethod": "npm" },
|
|
29
|
+
{ "id": "vitest", "name": "Vitest", "installMethod": "npm" },
|
|
30
|
+
{ "id": "mocha", "name": "Mocha", "installMethod": "npm" },
|
|
31
|
+
{ "id": "cypress", "name": "Cypress", "installMethod": "npm" },
|
|
32
|
+
{ "id": "playwright", "name": "Playwright", "installMethod": "npm" }
|
|
33
|
+
]
|
|
34
|
+
},
|
|
35
|
+
{
|
|
36
|
+
"id": "python",
|
|
37
|
+
"name": "Python",
|
|
38
|
+
"icon": "🐍",
|
|
39
|
+
"tools": [
|
|
40
|
+
{ "id": "python3", "name": "Python 3", "installMethod": "brew" },
|
|
41
|
+
{ "id": "pip", "name": "pip", "installMethod": "python" },
|
|
42
|
+
{ "id": "pipx", "name": "pipx", "installMethod": "pip" },
|
|
43
|
+
{ "id": "poetry", "name": "Poetry", "installMethod": "pip" },
|
|
44
|
+
{ "id": "virtualenv", "name": "virtualenv", "installMethod": "pip" },
|
|
45
|
+
{ "id": "conda", "name": "Conda", "installMethod": "script" },
|
|
46
|
+
{ "id": "pyenv", "name": "pyenv", "installMethod": "brew" },
|
|
47
|
+
{ "id": "black", "name": "Black", "installMethod": "pip" },
|
|
48
|
+
{ "id": "flake8", "name": "Flake8", "installMethod": "pip" },
|
|
49
|
+
{ "id": "pylint", "name": "Pylint", "installMethod": "pip" },
|
|
50
|
+
{ "id": "mypy", "name": "Mypy", "installMethod": "pip" },
|
|
51
|
+
{ "id": "pytest", "name": "pytest", "installMethod": "pip" },
|
|
52
|
+
{ "id": "ipython", "name": "IPython", "installMethod": "pip" },
|
|
53
|
+
{ "id": "jupyter", "name": "Jupyter", "installMethod": "pip" },
|
|
54
|
+
{ "id": "django", "name": "Django CLI", "installMethod": "pip" },
|
|
55
|
+
{ "id": "flask", "name": "Flask CLI", "installMethod": "pip" },
|
|
56
|
+
{ "id": "fastapi", "name": "FastAPI CLI", "installMethod": "pip" },
|
|
57
|
+
{ "id": "celery", "name": "Celery", "installMethod": "pip" },
|
|
58
|
+
{ "id": "scrapy", "name": "Scrapy", "installMethod": "pip" },
|
|
59
|
+
{ "id": "httpie", "name": "HTTPie", "installMethod": "pip" },
|
|
60
|
+
{ "id": "ansible", "name": "Ansible", "installMethod": "pip" },
|
|
61
|
+
{ "id": "salt", "name": "SaltStack", "installMethod": "pip" },
|
|
62
|
+
{ "id": "awscli", "name": "AWS CLI", "installMethod": "pip" },
|
|
63
|
+
{ "id": "gcloud", "name": "gcloud CLI", "installMethod": "script" },
|
|
64
|
+
{ "id": "azure-cli", "name": "Azure CLI", "installMethod": "script" }
|
|
65
|
+
]
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
"id": "go",
|
|
69
|
+
"name": "Go",
|
|
70
|
+
"icon": "🔵",
|
|
71
|
+
"tools": [
|
|
72
|
+
{ "id": "go", "name": "Go", "installMethod": "brew" },
|
|
73
|
+
{ "id": "golangci-lint", "name": "golangci-lint", "installMethod": "go" },
|
|
74
|
+
{ "id": "goreleaser", "name": "GoReleaser", "installMethod": "go" },
|
|
75
|
+
{ "id": "air", "name": "Air (live reload)", "installMethod": "go" },
|
|
76
|
+
{ "id": "ginkgo", "name": "Ginkgo", "installMethod": "go" },
|
|
77
|
+
{ "id": "delve", "name": "Delve debugger", "installMethod": "go" },
|
|
78
|
+
{ "id": "gofumpt", "name": "gofumpt", "installMethod": "go" },
|
|
79
|
+
{ "id": "goimports", "name": "goimports", "installMethod": "go" },
|
|
80
|
+
{ "id": "gomock", "name": "gomock", "installMethod": "go" },
|
|
81
|
+
{ "id": "staticcheck", "name": "staticcheck", "installMethod": "go" },
|
|
82
|
+
{ "id": "gosec", "name": "gosec", "installMethod": "go" },
|
|
83
|
+
{ "id": "richgo", "name": "richgo", "installMethod": "go" },
|
|
84
|
+
{ "id": "gotestsum", "name": "gotestsum", "installMethod": "go" },
|
|
85
|
+
{ "id": "swag", "name": "swag (Swagger)", "installMethod": "go" },
|
|
86
|
+
{ "id": "protoc-gen-go", "name": "protoc-gen-go", "installMethod": "go" },
|
|
87
|
+
{ "id": "grpcurl", "name": "grpcurl", "installMethod": "go" },
|
|
88
|
+
{ "id": "ghq", "name": "ghq", "installMethod": "go" },
|
|
89
|
+
{ "id": "fzf", "name": "fzf", "installMethod": "go" },
|
|
90
|
+
{ "id": "lazygit", "name": "lazygit", "installMethod": "go" },
|
|
91
|
+
{ "id": "delta", "name": "delta", "installMethod": "cargo" },
|
|
92
|
+
{ "id": "hugo", "name": "Hugo", "installMethod": "go" },
|
|
93
|
+
{ "id": "temporal", "name": "Temporal CLI", "installMethod": "go" },
|
|
94
|
+
{ "id": "ko", "name": "ko", "installMethod": "go" },
|
|
95
|
+
{ "id": "buf", "name": "Buf CLI", "installMethod": "go" },
|
|
96
|
+
{ "id": "helm", "name": "Helm", "installMethod": "script" }
|
|
97
|
+
]
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
"id": "rust",
|
|
101
|
+
"name": "Rust",
|
|
102
|
+
"icon": "🦀",
|
|
103
|
+
"tools": [
|
|
104
|
+
{ "id": "rustup", "name": "rustup", "installMethod": "script" },
|
|
105
|
+
{ "id": "cargo", "name": "Cargo", "installMethod": "rustup" },
|
|
106
|
+
{ "id": "rust-analyzer", "name": "rust-analyzer", "installMethod": "cargo" },
|
|
107
|
+
{ "id": "clippy", "name": "Clippy", "installMethod": "rustup" },
|
|
108
|
+
{ "id": "rustfmt", "name": "rustfmt", "installMethod": "rustup" },
|
|
109
|
+
{ "id": "cargo-watch", "name": "cargo-watch", "installMethod": "cargo" },
|
|
110
|
+
{ "id": "cargo-edit", "name": "cargo-edit", "installMethod": "cargo" },
|
|
111
|
+
{ "id": "cargo-audit", "name": "cargo-audit", "installMethod": "cargo" },
|
|
112
|
+
{ "id": "cargo-outdated", "name": "cargo-outdated", "installMethod": "cargo" },
|
|
113
|
+
{ "id": "cargo-expand", "name": "cargo-expand", "installMethod": "cargo" },
|
|
114
|
+
{ "id": "cargo-flamegraph", "name": "cargo-flamegraph", "installMethod": "cargo" },
|
|
115
|
+
{ "id": "wasm-pack", "name": "wasm-pack", "installMethod": "cargo" },
|
|
116
|
+
{ "id": "tokio-console", "name": "tokio-console", "installMethod": "cargo" },
|
|
117
|
+
{ "id": "cargo-deny", "name": "cargo-deny", "installMethod": "cargo" },
|
|
118
|
+
{ "id": "cargo-nextest", "name": "cargo-nextest", "installMethod": "cargo" },
|
|
119
|
+
{ "id": "ripgrep", "name": "ripgrep (rg)", "installMethod": "cargo" },
|
|
120
|
+
{ "id": "fd-find", "name": "fd", "installMethod": "cargo" },
|
|
121
|
+
{ "id": "bat", "name": "bat", "installMethod": "cargo" },
|
|
122
|
+
{ "id": "eza", "name": "eza", "installMethod": "cargo" },
|
|
123
|
+
{ "id": "zoxide", "name": "zoxide", "installMethod": "cargo" },
|
|
124
|
+
{ "id": "starship", "name": "Starship prompt", "installMethod": "cargo" },
|
|
125
|
+
{ "id": "tokei", "name": "tokei", "installMethod": "cargo" },
|
|
126
|
+
{ "id": "hyperfine", "name": "hyperfine", "installMethod": "cargo" },
|
|
127
|
+
{ "id": "bottom", "name": "bottom (btm)", "installMethod": "cargo" },
|
|
128
|
+
{ "id": "du-dust", "name": "dust", "installMethod": "cargo" }
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
{
|
|
132
|
+
"id": "java",
|
|
133
|
+
"name": "Java / JVM",
|
|
134
|
+
"icon": "☕",
|
|
135
|
+
"tools": [
|
|
136
|
+
{ "id": "jdk", "name": "OpenJDK", "installMethod": "brew" },
|
|
137
|
+
{ "id": "gradle", "name": "Gradle", "installMethod": "brew" },
|
|
138
|
+
{ "id": "maven", "name": "Maven", "installMethod": "brew" },
|
|
139
|
+
{ "id": "sbt", "name": "sbt", "installMethod": "brew" },
|
|
140
|
+
{ "id": "kotlin", "name": "Kotlin", "installMethod": "brew" },
|
|
141
|
+
{ "id": "scala", "name": "Scala", "installMethod": "brew" },
|
|
142
|
+
{ "id": "clojure", "name": "Clojure", "installMethod": "brew" },
|
|
143
|
+
{ "id": "leiningen", "name": "Leiningen", "installMethod": "brew" },
|
|
144
|
+
{ "id": "jbang", "name": "jbang", "installMethod": "brew" },
|
|
145
|
+
{ "id": "spring-boot", "name": "Spring Boot CLI", "installMethod": "brew" },
|
|
146
|
+
{ "id": "quarkus", "name": "Quarkus CLI", "installMethod": "brew" },
|
|
147
|
+
{ "id": "micronaut", "name": "Micronaut CLI", "installMethod": "brew" },
|
|
148
|
+
{ "id": "ant", "name": "Apache Ant", "installMethod": "brew" },
|
|
149
|
+
{ "id": "bazel", "name": "Bazel", "installMethod": "script" },
|
|
150
|
+
{ "id": "visualvm", "name": "VisualVM", "installMethod": "brew" },
|
|
151
|
+
{ "id": "jmeter", "name": "JMeter", "installMethod": "brew" },
|
|
152
|
+
{ "id": "jolokia", "name": "Jolokia", "installMethod": "brew" },
|
|
153
|
+
{ "id": "flyway", "name": "Flyway", "installMethod": "brew" },
|
|
154
|
+
{ "id": "liquibase", "name": "Liquibase", "installMethod": "brew" },
|
|
155
|
+
{ "id": "coursier", "name": "Coursier", "installMethod": "brew" },
|
|
156
|
+
{ "id": "mill", "name": "Mill", "installMethod": "brew" },
|
|
157
|
+
{ "id": "ammonite", "name": "Ammonite", "installMethod": "brew" },
|
|
158
|
+
{ "id": "graalvm", "name": "GraalVM", "installMethod": "brew" },
|
|
159
|
+
{ "id": "ktlint", "name": "ktlint", "installMethod": "brew" },
|
|
160
|
+
{ "id": "detekt", "name": "Detekt", "installMethod": "brew" }
|
|
161
|
+
]
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
"id": "csharp-dotnet",
|
|
165
|
+
"name": "C# / .NET",
|
|
166
|
+
"icon": "🟣",
|
|
167
|
+
"tools": [
|
|
168
|
+
{ "id": "dotnet", "name": ".NET SDK", "installMethod": "brew" },
|
|
169
|
+
{ "id": "dotnet-ef", "name": "Entity Framework CLI", "installMethod": "dotnet" },
|
|
170
|
+
{ "id": "dotnet-format", "name": "dotnet-format", "installMethod": "dotnet" },
|
|
171
|
+
{ "id": "dotnet-outdated", "name": "dotnet-outdated", "installMethod": "dotnet" },
|
|
172
|
+
{ "id": "nuke", "name": "NUKE Build", "installMethod": "dotnet" },
|
|
173
|
+
{ "id": "csharpier", "name": "CSharpier", "installMethod": "dotnet" },
|
|
174
|
+
{ "id": "sonarscanner", "name": "SonarScanner", "installMethod": "dotnet" },
|
|
175
|
+
{ "id": "fake-cli", "name": "FAKE CLI", "installMethod": "dotnet" },
|
|
176
|
+
{ "id": "paket", "name": "Paket", "installMethod": "dotnet" },
|
|
177
|
+
{ "id": "fantomas", "name": "Fantomas", "installMethod": "dotnet" },
|
|
178
|
+
{ "id": "aardpack", "name": "aardpack", "installMethod": "dotnet" },
|
|
179
|
+
{ "id": "depends", "name": "depends", "installMethod": "dotnet" },
|
|
180
|
+
{ "id": "snitch", "name": "Snitch", "installMethod": "dotnet" },
|
|
181
|
+
{ "id": "roslynator", "name": "Roslynator", "installMethod": "dotnet" },
|
|
182
|
+
{ "id": "xunit-cli", "name": "xUnit CLI", "installMethod": "dotnet" },
|
|
183
|
+
{ "id": "coverlet", "name": "Coverlet", "installMethod": "dotnet" },
|
|
184
|
+
{ "id": "reportgenerator", "name": "ReportGenerator", "installMethod": "dotnet" },
|
|
185
|
+
{ "id": "bencher", "name": "BenchmarkDotNet", "installMethod": "dotnet" },
|
|
186
|
+
{ "id": "migrator", "name": "EF Core Migrations", "installMethod": "dotnet" },
|
|
187
|
+
{ "id": "powerpack", "name": "F# Power Pack", "installMethod": "dotnet" }
|
|
188
|
+
]
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"id": "ruby",
|
|
192
|
+
"name": "Ruby",
|
|
193
|
+
"icon": "💎",
|
|
194
|
+
"tools": [
|
|
195
|
+
{ "id": "ruby", "name": "Ruby", "installMethod": "brew" },
|
|
196
|
+
{ "id": "bundler", "name": "Bundler", "installMethod": "gem" },
|
|
197
|
+
{ "id": "rails", "name": "Ruby on Rails", "installMethod": "gem" },
|
|
198
|
+
{ "id": "rake", "name": "Rake", "installMethod": "gem" },
|
|
199
|
+
{ "id": "rspec", "name": "RSpec", "installMethod": "gem" },
|
|
200
|
+
{ "id": "rubocop", "name": "RuboCop", "installMethod": "gem" },
|
|
201
|
+
{ "id": "sorbet", "name": "Sorbet", "installMethod": "gem" },
|
|
202
|
+
{ "id": "brakeman", "name": "Brakeman", "installMethod": "gem" },
|
|
203
|
+
{ "id": "solargraph", "name": "Solargraph", "installMethod": "gem" },
|
|
204
|
+
{ "id": "pry", "name": "Pry", "installMethod": "gem" },
|
|
205
|
+
{ "id": "byebug", "name": "Byebug", "installMethod": "gem" },
|
|
206
|
+
{ "id": "capybara", "name": "Capybara", "installMethod": "gem" },
|
|
207
|
+
{ "id": "factory-bot", "name": "Factory Bot", "installMethod": "gem" },
|
|
208
|
+
{ "id": "sidekiq", "name": "Sidekiq", "installMethod": "gem" },
|
|
209
|
+
{ "id": "puma", "name": "Puma", "installMethod": "gem" },
|
|
210
|
+
{ "id": "sinatra", "name": "Sinatra", "installMethod": "gem" },
|
|
211
|
+
{ "id": "hanami", "name": "Hanami", "installMethod": "gem" },
|
|
212
|
+
{ "id": "dry-rb", "name": "dry-rb", "installMethod": "gem" },
|
|
213
|
+
{ "id": "overmind", "name": "Overmind (Procfile)", "installMethod": "brew" },
|
|
214
|
+
{ "id": "foreman", "name": "Foreman (Procfile)", "installMethod": "gem" }
|
|
215
|
+
]
|
|
216
|
+
},
|
|
217
|
+
{
|
|
218
|
+
"id": "php",
|
|
219
|
+
"name": "PHP",
|
|
220
|
+
"icon": "🐘",
|
|
221
|
+
"tools": [
|
|
222
|
+
{ "id": "php", "name": "PHP", "installMethod": "brew" },
|
|
223
|
+
{ "id": "composer", "name": "Composer", "installMethod": "script" },
|
|
224
|
+
{ "id": "php-cs-fixer", "name": "PHP CS Fixer", "installMethod": "composer" },
|
|
225
|
+
{ "id": "phpstan", "name": "PHPStan", "installMethod": "composer" },
|
|
226
|
+
{ "id": "psalm", "name": "Psalm", "installMethod": "composer" },
|
|
227
|
+
{ "id": "phpunit", "name": "PHPUnit", "installMethod": "composer" },
|
|
228
|
+
{ "id": "pest", "name": "Pest", "installMethod": "composer" },
|
|
229
|
+
{ "id": "infection", "name": "Infection (mutation)", "installMethod": "composer" },
|
|
230
|
+
{ "id": "laravel", "name": "Laravel Installer", "installMethod": "composer" },
|
|
231
|
+
{ "id": "symfony", "name": "Symfony CLI", "installMethod": "brew" },
|
|
232
|
+
{ "id": "wp-cli", "name": "WP-CLI", "installMethod": "brew" },
|
|
233
|
+
{ "id": "drush", "name": "Drush", "installMethod": "composer" },
|
|
234
|
+
{ "id": "deployer", "name": "Deployer", "installMethod": "composer" },
|
|
235
|
+
{ "id": "phan", "name": "Phan", "installMethod": "composer" },
|
|
236
|
+
{ "id": "rector", "name": "Rector", "installMethod": "composer" },
|
|
237
|
+
{ "id": "mockery", "name": "Mockery", "installMethod": "composer" },
|
|
238
|
+
{ "id": "behat", "name": "Behat", "installMethod": "composer" },
|
|
239
|
+
{ "id": "codeception", "name": "Codeception", "installMethod": "composer" },
|
|
240
|
+
{ "id": "paratest", "name": "Paratest", "installMethod": "composer" },
|
|
241
|
+
{ "id": "phpmd", "name": "PHPMD", "installMethod": "composer" }
|
|
242
|
+
]
|
|
243
|
+
},
|
|
244
|
+
{
|
|
245
|
+
"id": "c-cpp",
|
|
246
|
+
"name": "C / C++",
|
|
247
|
+
"icon": "⚙️",
|
|
248
|
+
"tools": [
|
|
249
|
+
{ "id": "gcc", "name": "GCC", "installMethod": "brew" },
|
|
250
|
+
{ "id": "clang", "name": "Clang/LLVM", "installMethod": "brew" },
|
|
251
|
+
{ "id": "cmake", "name": "CMake", "installMethod": "brew" },
|
|
252
|
+
{ "id": "make", "name": "GNU Make", "installMethod": "brew" },
|
|
253
|
+
{ "id": "ninja", "name": "Ninja", "installMethod": "brew" },
|
|
254
|
+
{ "id": "meson", "name": "Meson", "installMethod": "pip" },
|
|
255
|
+
{ "id": "conan", "name": "Conan", "installMethod": "pip" },
|
|
256
|
+
{ "id": "vcpkg", "name": "vcpkg", "installMethod": "script" },
|
|
257
|
+
{ "id": "bazelisk", "name": "Bazelisk", "installMethod": "brew" },
|
|
258
|
+
{ "id": "clang-format", "name": "clang-format", "installMethod": "brew" },
|
|
259
|
+
{ "id": "clang-tidy", "name": "clang-tidy", "installMethod": "brew" },
|
|
260
|
+
{ "id": "cppcheck", "name": "Cppcheck", "installMethod": "brew" },
|
|
261
|
+
{ "id": "valgrind", "name": "Valgrind", "installMethod": "brew" },
|
|
262
|
+
{ "id": "gdb", "name": "GDB", "installMethod": "brew" },
|
|
263
|
+
{ "id": "lldb", "name": "LLDB", "installMethod": "brew" },
|
|
264
|
+
{ "id": "ccache", "name": "ccache", "installMethod": "brew" },
|
|
265
|
+
{ "id": "distcc", "name": "distcc", "installMethod": "brew" },
|
|
266
|
+
{ "id": "bear", "name": "Bear", "installMethod": "brew" },
|
|
267
|
+
{ "id": "doxygen", "name": "Doxygen", "installMethod": "brew" },
|
|
268
|
+
{ "id": "scons", "name": "SCons", "installMethod": "pip" }
|
|
269
|
+
]
|
|
270
|
+
},
|
|
271
|
+
{
|
|
272
|
+
"id": "universal",
|
|
273
|
+
"name": "Universal / DevOps",
|
|
274
|
+
"icon": "🌐",
|
|
275
|
+
"tools": [
|
|
276
|
+
{ "id": "git", "name": "Git", "installMethod": "brew" },
|
|
277
|
+
{ "id": "gh", "name": "GitHub CLI", "installMethod": "brew" },
|
|
278
|
+
{ "id": "hub", "name": "hub", "installMethod": "brew" },
|
|
279
|
+
{ "id": "git-lfs", "name": "Git LFS", "installMethod": "brew" },
|
|
280
|
+
{ "id": "gitflow", "name": "gitflow", "installMethod": "brew" },
|
|
281
|
+
{ "id": "tig", "name": "Tig", "installMethod": "brew" },
|
|
282
|
+
{ "id": "lazydocker", "name": "lazydocker", "installMethod": "brew" },
|
|
283
|
+
{ "id": "docker", "name": "Docker", "installMethod": "brew" },
|
|
284
|
+
{ "id": "docker-compose", "name": "Docker Compose", "installMethod": "brew" },
|
|
285
|
+
{ "id": "kubectl", "name": "kubectl", "installMethod": "brew" },
|
|
286
|
+
{ "id": "k9s", "name": "k9s", "installMethod": "brew" },
|
|
287
|
+
{ "id": "terraform", "name": "Terraform", "installMethod": "brew" },
|
|
288
|
+
{ "id": "packer", "name": "Packer", "installMethod": "brew" },
|
|
289
|
+
{ "id": "vagrant", "name": "Vagrant", "installMethod": "brew" },
|
|
290
|
+
{ "id": "ansible-dev", "name": "Ansible (via brew)", "installMethod": "brew" },
|
|
291
|
+
{ "id": "neovim", "name": "Neovim", "installMethod": "brew" },
|
|
292
|
+
{ "id": "tmux", "name": "tmux", "installMethod": "brew" },
|
|
293
|
+
{ "id": "zsh", "name": "Zsh", "installMethod": "brew" },
|
|
294
|
+
{ "id": "oh-my-zsh", "name": "Oh My Zsh", "installMethod": "script" },
|
|
295
|
+
{ "id": "starship-brew", "name": "Starship (via brew)", "installMethod": "brew" },
|
|
296
|
+
{ "id": "htop", "name": "htop", "installMethod": "brew" },
|
|
297
|
+
{ "id": "ncdu", "name": "ncdu", "installMethod": "brew" },
|
|
298
|
+
{ "id": "tree", "name": "tree", "installMethod": "brew" },
|
|
299
|
+
{ "id": "jq", "name": "jq", "installMethod": "brew" },
|
|
300
|
+
{ "id": "yq", "name": "yq", "installMethod": "brew" },
|
|
301
|
+
{ "id": "curl", "name": "curl", "installMethod": "brew" },
|
|
302
|
+
{ "id": "wget", "name": "wget", "installMethod": "brew" },
|
|
303
|
+
{ "id": "rsync", "name": "rsync", "installMethod": "brew" },
|
|
304
|
+
{ "id": "openssl", "name": "OpenSSL", "installMethod": "brew" },
|
|
305
|
+
{ "id": "watchman", "name": "Watchman", "installMethod": "brew" },
|
|
306
|
+
{ "id": "ffmpeg", "name": "FFmpeg", "installMethod": "brew" },
|
|
307
|
+
{ "id": "imagemagick", "name": "ImageMagick", "installMethod": "brew" },
|
|
308
|
+
{ "id": "shellcheck", "name": "ShellCheck", "installMethod": "brew" },
|
|
309
|
+
{ "id": "shfmt", "name": "shfmt", "installMethod": "brew" },
|
|
310
|
+
{ "id": "hadolint", "name": "Hadolint", "installMethod": "brew" },
|
|
311
|
+
{ "id": "tfsec", "name": "tfsec", "installMethod": "brew" },
|
|
312
|
+
{ "id": "checkov", "name": "Checkov", "installMethod": "pip" },
|
|
313
|
+
{ "id": "trivy", "name": "Trivy", "installMethod": "brew" },
|
|
314
|
+
{ "id": "snyk", "name": "Snyk", "installMethod": "npm" },
|
|
315
|
+
{ "id": "sonarqube", "name": "SonarQube Scanner", "installMethod": "brew" }
|
|
316
|
+
]
|
|
317
|
+
},
|
|
318
|
+
{
|
|
319
|
+
"id": "artificial-intelligence",
|
|
320
|
+
"name": "Artificial Intelligence",
|
|
321
|
+
"icon": "💻",
|
|
322
|
+
"tools": [
|
|
323
|
+
{ "id": "@anthropic-ai/claude-code", "name": "Claude Code", "installMethod": "npm", "command": "claude" },
|
|
324
|
+
{ "id": "@openai/codex", "name": "OpenAI Codex CLI", "installMethod": "npm", "command": "codex" },
|
|
325
|
+
{ "id": "aider-chat", "name": "Aider", "installMethod": "pip", "command": "aider" },
|
|
326
|
+
{ "id": "@githubnext/github-copilot-cli", "name": "GitHub Copilot CLI", "installMethod": "npm", "command": "github-copilot-cli" },
|
|
327
|
+
{ "id": "@anthropic-ai/gemini-cli", "name": "Google Gemini CLI", "installMethod": "npm", "command": "gemini" },
|
|
328
|
+
{ "id": "amazon-q-developer-cli", "name": "Amazon Q Developer CLI", "installMethod": "pip", "command": "q" },
|
|
329
|
+
{ "id": "@plandex/cli", "name": "Plandex", "installMethod": "npm", "command": "plandex" },
|
|
330
|
+
{ "id": "mentat", "name": "Mentat", "installMethod": "pip", "command": "mentat" },
|
|
331
|
+
{ "id": "openhands", "name": "OpenHands CLI", "installMethod": "pip", "command": "openhands" },
|
|
332
|
+
{ "id": "sweagent", "name": "SWE-agent", "installMethod": "pip", "command": "sweagent" },
|
|
333
|
+
{ "id": "gpt-engineer", "name": "GPT Engineer", "installMethod": "pip", "command": "gpt-engineer" },
|
|
334
|
+
{ "id": "smol-developer", "name": "Smol Developer", "installMethod": "npm", "command": "smol-dev" },
|
|
335
|
+
{ "id": "llm", "name": "LLM (Simon Willison)", "installMethod": "pip", "command": "llm" },
|
|
336
|
+
{ "id": "ollama", "name": "Ollama", "installMethod": "brew", "command": "ollama" },
|
|
337
|
+
{ "id": "shell-gpt", "name": "Shell-GPT (sgpt)", "installMethod": "pip", "command": "sgpt" },
|
|
338
|
+
{ "id": "aichat", "name": "AIChat", "installMethod": "cargo", "command": "aichat" },
|
|
339
|
+
{ "id": "bito", "name": "Bito CLI", "installMethod": "npm", "command": "bito" },
|
|
340
|
+
{ "id": "copilot-ext", "name": "GitHub Copilot (IDE)", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=GitHub.copilot" },
|
|
341
|
+
{ "id": "claude-ide-ext", "name": "Claude for IDE", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=anthropic.claude-code" },
|
|
342
|
+
{ "id": "continue-ext", "name": "Continue", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=Continue.continue" },
|
|
343
|
+
{ "id": "tabnine-ext", "name": "Tabnine", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=TabNine.tabnine-vscode" },
|
|
344
|
+
{ "id": "codeium-ext", "name": "Codeium", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=Codeium.codeium" },
|
|
345
|
+
{ "id": "cody-ext", "name": "Sourcegraph Cody", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=sourcegraph.cody-ai" },
|
|
346
|
+
{ "id": "supermaven-ext", "name": "Supermaven", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=supermaven.supermaven-vscode" },
|
|
347
|
+
{ "id": "blackbox-ext", "name": "Blackbox AI", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=Blackboxapp.blackbox" },
|
|
348
|
+
{ "id": "codegeex-ext", "name": "CodeGeeX", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=aminer.codegeex" },
|
|
349
|
+
{ "id": "askcodi-ext", "name": "AskCodi", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=AskCodi.askcodi" },
|
|
350
|
+
{ "id": "safurai-ext", "name": "Safurai", "installMethod": "link", "url": "https://plugins.jetbrains.com/plugin/23446-safurai" },
|
|
351
|
+
{ "id": "pieces-ext", "name": "Pieces for Developers", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=MeshIntelligentTechnologiesInc.pieces-vscode" },
|
|
352
|
+
{ "id": "mutable-ext", "name": "Mutable AI", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=MutableAI.mutableai" },
|
|
353
|
+
{ "id": "twinny-ext", "name": "Twinny", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=rjmacarthy.twinny" },
|
|
354
|
+
{ "id": "localpilot-ext", "name": "LocalPilot", "installMethod": "link", "url": "https://marketplace.visualstudio.com/items?itemName=shengchen.localpilot" }
|
|
355
|
+
]
|
|
356
|
+
}
|
|
357
|
+
]
|
|
358
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
const child_process = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('os').homedir;
|
|
4
|
+
|
|
5
|
+
function getCurrentGitConfig() {
|
|
6
|
+
const name = tryExec('git config --global user.name');
|
|
7
|
+
const email = tryExec('git config --global user.email');
|
|
8
|
+
const gpgsign = tryExec('git config --global commit.gpgsign');
|
|
9
|
+
return { name, email, gpgsign };
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function setGitConfig(key, value) {
|
|
13
|
+
if (!value) return false;
|
|
14
|
+
child_process.execSync(`git config --global ${key} "${value}"`, { stdio: 'pipe' });
|
|
15
|
+
return true;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async function configureGit({ name, email, gpgsign }) {
|
|
19
|
+
const results = {};
|
|
20
|
+
if (name) results.name = setGitConfig('user.name', name);
|
|
21
|
+
if (email) results.email = setGitConfig('user.email', email);
|
|
22
|
+
if (gpgsign) results.gpgsign = setGitConfig('commit.gpgsign', gpgsign);
|
|
23
|
+
return results;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
function tryExec(cmd) {
|
|
27
|
+
try {
|
|
28
|
+
return child_process.execSync(cmd, { encoding: 'utf8', stdio: 'pipe' }).trim() || null;
|
|
29
|
+
} catch {
|
|
30
|
+
return null;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
module.exports = { getCurrentGitConfig, setGitConfig, configureGit };
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
const child_process = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
const NVM_DIR = path.join(os.homedir(), '.nvm');
|
|
7
|
+
|
|
8
|
+
function isNodeInstalled() {
|
|
9
|
+
try {
|
|
10
|
+
child_process.execSync('command -v node >/dev/null 2>&1', { shell: '/bin/bash', stdio: 'pipe' });
|
|
11
|
+
const version = child_process.execSync('node -v', { encoding: 'utf8' }).trim();
|
|
12
|
+
return { installed: true, version };
|
|
13
|
+
} catch {
|
|
14
|
+
return { installed: false, version: null };
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
function isNvmInstalled() {
|
|
19
|
+
return fs.existsSync(path.join(NVM_DIR, 'nvm.sh'));
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
async function installNvm() {
|
|
23
|
+
const cmd = 'curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash';
|
|
24
|
+
child_process.execSync(cmd, { shell: '/bin/bash', stdio: 'pipe' });
|
|
25
|
+
return true;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function installNode(version = '--lts') {
|
|
29
|
+
const nvmSource = isNvmInstalled()
|
|
30
|
+
? `source "${NVM_DIR}/nvm.sh"`
|
|
31
|
+
: '';
|
|
32
|
+
|
|
33
|
+
if (!isNvmInstalled()) {
|
|
34
|
+
await installNvm();
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
const cmd = `${nvmSource || `source "${NVM_DIR}/nvm.sh"`} && nvm install ${version}`;
|
|
38
|
+
const out = child_process.execSync(cmd, { shell: '/bin/bash', encoding: 'utf8', stdio: 'pipe' });
|
|
39
|
+
return out.trim();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function getNodeVersion() {
|
|
43
|
+
try {
|
|
44
|
+
return child_process.execSync('node -v', { encoding: 'utf8' }).trim();
|
|
45
|
+
} catch {
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
module.exports = { isNodeInstalled, isNvmInstalled, installNvm, installNode, getNodeVersion };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const child_process = require('child_process');
|
|
2
|
+
|
|
3
|
+
function isPnpmInstalled() {
|
|
4
|
+
try {
|
|
5
|
+
const v = child_process.execSync('pnpm -v', { encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
6
|
+
return { installed: true, version: v };
|
|
7
|
+
} catch {
|
|
8
|
+
return { installed: false, version: null };
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
function isNpmInstalled() {
|
|
13
|
+
try {
|
|
14
|
+
const v = child_process.execSync('npm -v', { encoding: 'utf8', stdio: 'pipe' }).trim();
|
|
15
|
+
return { installed: true, version: v };
|
|
16
|
+
} catch {
|
|
17
|
+
return { installed: false, version: null };
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
async function installPnpm() {
|
|
22
|
+
child_process.execSync('npm install -g pnpm', { encoding: 'utf8', stdio: 'pipe' });
|
|
23
|
+
return isPnpmInstalled();
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function installNpm() {
|
|
27
|
+
// npm comes with node; just verify
|
|
28
|
+
return isNpmInstalled();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = { isPnpmInstalled, isNpmInstalled, installPnpm, installNpm };
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
const child_process = require('child_process');
|
|
2
|
+
const fs = require('fs');
|
|
3
|
+
const path = require('path');
|
|
4
|
+
const os = require('os');
|
|
5
|
+
|
|
6
|
+
const SSH_DIR = path.join(os.homedir(), '.ssh');
|
|
7
|
+
const DEFAULT_KEY = path.join(SSH_DIR, 'id_ed25519');
|
|
8
|
+
|
|
9
|
+
function sshKeyExists(keyPath = DEFAULT_KEY) {
|
|
10
|
+
return fs.existsSync(keyPath) || fs.existsSync(keyPath + '.pub');
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
function generateSshKey(email, keyPath = DEFAULT_KEY) {
|
|
14
|
+
if (sshKeyExists(keyPath)) {
|
|
15
|
+
return { skipped: true, reason: 'Key already exists' };
|
|
16
|
+
}
|
|
17
|
+
if (!fs.existsSync(SSH_DIR)) {
|
|
18
|
+
fs.mkdirSync(SSH_DIR, { recursive: true, mode: 0o700 });
|
|
19
|
+
}
|
|
20
|
+
const cmd = `ssh-keygen -t ed25519 -C "${email}" -f "${keyPath}" -N ""`;
|
|
21
|
+
child_process.execSync(cmd, { stdio: 'pipe' });
|
|
22
|
+
return { skipped: false, keyPath };
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
function getPublicKey(keyPath = DEFAULT_KEY) {
|
|
26
|
+
const pubPath = keyPath + '.pub';
|
|
27
|
+
if (!fs.existsSync(pubPath)) return null;
|
|
28
|
+
return fs.readFileSync(pubPath, 'utf8').trim();
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
module.exports = { sshKeyExists, generateSshKey, getPublicKey };
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
const child_process = require('child_process');
|
|
2
|
+
const os = require('os');
|
|
3
|
+
|
|
4
|
+
function detectPlatform() {
|
|
5
|
+
return os.platform();
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
function isBrewInstalled() {
|
|
9
|
+
try {
|
|
10
|
+
child_process.execSync('brew --version', { stdio: 'pipe' });
|
|
11
|
+
return true;
|
|
12
|
+
} catch {
|
|
13
|
+
return false;
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
function isAptInstalled() {
|
|
18
|
+
try {
|
|
19
|
+
child_process.execSync('dpkg -l apt', { stdio: 'pipe' });
|
|
20
|
+
return true;
|
|
21
|
+
} catch {
|
|
22
|
+
return false;
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
async function installBrew() {
|
|
27
|
+
const cmd = '/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"';
|
|
28
|
+
child_process.execSync(cmd, { shell: '/bin/bash', stdio: 'pipe' });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
async function installAptPackages(packages = ['git', 'curl', 'build-essential']) {
|
|
32
|
+
const pkg = packages.join(' ');
|
|
33
|
+
child_process.execSync(`sudo apt-get update && sudo apt-get install -y ${pkg}`, {
|
|
34
|
+
shell: '/bin/bash', stdio: 'pipe',
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
async function installSystemPackage(pkg) {
|
|
39
|
+
const platform = detectPlatform();
|
|
40
|
+
const cmd = platform === 'darwin'
|
|
41
|
+
? `brew install ${pkg}`
|
|
42
|
+
: `sudo apt-get install -y ${pkg}`;
|
|
43
|
+
child_process.execSync(cmd, { shell: '/bin/bash', stdio: 'pipe' });
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
module.exports = {
|
|
47
|
+
detectPlatform, isBrewInstalled, isAptInstalled,
|
|
48
|
+
installBrew, installAptPackages, installSystemPackage,
|
|
49
|
+
};
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
const os = require('os');
|
|
2
|
+
const child_process = require('child_process');
|
|
3
|
+
|
|
4
|
+
function detectOS(env = process.env) {
|
|
5
|
+
const platform = env.ADM_PLATFORM_OVERRIDE || os.platform();
|
|
6
|
+
if (platform === 'darwin') return 'darwin';
|
|
7
|
+
if (platform === 'linux') return 'linux';
|
|
8
|
+
return 'unknown';
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
function planInstallers(platform) {
|
|
12
|
+
platform = platform || detectOS();
|
|
13
|
+
const actions = [];
|
|
14
|
+
// Node (via nvm), pnpm/npm, git always recommended
|
|
15
|
+
actions.push({ name: 'git', reason: 'required for repos' });
|
|
16
|
+
actions.push({ name: 'node', method: 'nvm', reason: 'runtime for tools' });
|
|
17
|
+
actions.push({ name: 'pnpm', method: 'pnpm', reason: 'fast package manager' });
|
|
18
|
+
|
|
19
|
+
if (platform === 'darwin') {
|
|
20
|
+
actions.unshift({ name: 'brew', reason: 'Homebrew package manager' });
|
|
21
|
+
} else if (platform === 'linux') {
|
|
22
|
+
actions.unshift({ name: 'apt', reason: 'APT package manager (Debian/Ubuntu)' });
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
return actions;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
async function runInstallers(opts = {}) {
|
|
29
|
+
const dry = opts.dryRun || process.env.ADM_DRY_RUN === '1';
|
|
30
|
+
const plat = detectOS(opts.env);
|
|
31
|
+
const planned = planInstallers(plat);
|
|
32
|
+
if (dry) {
|
|
33
|
+
return { dryRun: true, platform: plat, planned };
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
// By default do NOT perform network or sudo actions unless ADM_EXECUTE=1 is set.
|
|
37
|
+
const execute = process.env.ADM_EXECUTE === '1' || opts.execute;
|
|
38
|
+
const results = [];
|
|
39
|
+
for (const a of planned) {
|
|
40
|
+
const cmd = commandForAction(a, plat);
|
|
41
|
+
if (!execute) {
|
|
42
|
+
results.push({ name: a.name, command: cmd, status: 'skipped' });
|
|
43
|
+
continue;
|
|
44
|
+
}
|
|
45
|
+
try {
|
|
46
|
+
// run command synchronously; caller must ensure ADM_EXECUTE=1 intentionally
|
|
47
|
+
const out = child_process.execSync(cmd, { encoding: 'utf8', stdio: 'pipe' });
|
|
48
|
+
results.push({ name: a.name, command: cmd, status: 'executed', stdout: out });
|
|
49
|
+
} catch (err) {
|
|
50
|
+
results.push({ name: a.name, command: cmd, status: 'failed', error: err.message });
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
return { dryRun: false, platform: plat, planned, executed: results };
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
function commandForAction(a, platform) {
|
|
57
|
+
// Return a shell command that would perform the action (idempotent when possible)
|
|
58
|
+
if (a.name === 'brew') return 'brew update && brew --version >/dev/null 2>&1 || /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"';
|
|
59
|
+
if (a.name === 'apt') return 'sudo apt-get update && sudo apt-get install -y git curl';
|
|
60
|
+
if (a.name === 'git') return 'git --version || sudo apt-get install -y git || brew install git';
|
|
61
|
+
if (a.name === 'node') return 'command -v node >/dev/null 2>&1 || curl -fsSL https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.4/install.sh | bash';
|
|
62
|
+
if (a.name === 'pnpm') return 'command -v pnpm >/dev/null 2>&1 || npm install -g pnpm';
|
|
63
|
+
return '# unknown action';
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
module.exports = { detectOS, planInstallers, runInstallers };
|