gitarsenal-cli 1.9.32 → 1.9.33

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/.venv_status.json CHANGED
@@ -1 +1 @@
1
- {"created":"2025-08-10T17:44:29.632Z","packages":["modal","gitingest","requests","anthropic"],"uv_version":"uv 0.8.4 (Homebrew 2025-07-30)"}
1
+ {"created":"2025-08-10T17:52:52.499Z","packages":["modal","gitingest","requests","anthropic"],"uv_version":"uv 0.8.4 (Homebrew 2025-07-30)"}
package/bin/gitarsenal.js CHANGED
@@ -104,6 +104,145 @@ function activateVirtualEnvironment() {
104
104
  return true;
105
105
  }
106
106
 
107
+ // Lightweight preview of GPU/Torch/CUDA recommendations prior to GPU selection
108
+ async function previewRecommendations(repoUrl) {
109
+ const spinner = ora('Analyzing repository for GPU/Torch/CUDA recommendations...').start();
110
+ try {
111
+ const apiUrl = process.env.GITARSENAL_API_URL || 'https://www.gitarsenal.dev/api/gitingest-setup-commands';
112
+ const payload = {
113
+ repoUrl,
114
+ // Minimal GitIngest data to allow backend to run LLM analysis
115
+ gitingestData: {
116
+ system_info: {
117
+ platform: process.platform,
118
+ python_version: process.version,
119
+ detected_language: 'Unknown',
120
+ detected_technologies: [],
121
+ file_count: 0,
122
+ repo_stars: 0,
123
+ repo_forks: 0,
124
+ primary_package_manager: 'Unknown',
125
+ complexity_level: 'Unknown'
126
+ },
127
+ repository_analysis: {
128
+ summary: `Repository: ${repoUrl}`,
129
+ tree: '',
130
+ content_preview: ''
131
+ },
132
+ success: true
133
+ }
134
+ };
135
+
136
+ const res = await httpPostJson(apiUrl, payload);
137
+ spinner.stop();
138
+
139
+ if (!res) {
140
+ console.log(chalk.yellow('⚠️ Could not fetch recommendations preview.'));
141
+ return null;
142
+ }
143
+
144
+ printGpuTorchCudaSummary(res);
145
+ return res;
146
+ } catch (e) {
147
+ spinner.stop();
148
+ console.log(chalk.yellow(`⚠️ Preview failed: ${e.message}`));
149
+ return null;
150
+ }
151
+ }
152
+
153
+ function httpPostJson(urlString, body) {
154
+ return new Promise((resolve) => {
155
+ try {
156
+ const urlObj = new URL(urlString);
157
+ const data = JSON.stringify(body);
158
+ const options = {
159
+ hostname: urlObj.hostname,
160
+ port: urlObj.port || (urlObj.protocol === 'https:' ? 443 : 80),
161
+ path: urlObj.pathname,
162
+ method: 'POST',
163
+ headers: {
164
+ 'Content-Type': 'application/json',
165
+ 'Content-Length': Buffer.byteLength(data),
166
+ 'User-Agent': 'GitArsenal-CLI/1.0'
167
+ }
168
+ };
169
+ const client = urlObj.protocol === 'https:' ? https : http;
170
+ const req = client.request(options, (res) => {
171
+ let responseData = '';
172
+ res.on('data', (chunk) => {
173
+ responseData += chunk;
174
+ });
175
+ res.on('end', () => {
176
+ try {
177
+ const parsed = JSON.parse(responseData);
178
+ resolve(parsed);
179
+ } catch (err) {
180
+ resolve(null);
181
+ }
182
+ });
183
+ });
184
+ req.on('error', () => resolve(null));
185
+ req.write(data);
186
+ req.end();
187
+ } catch (e) {
188
+ resolve(null);
189
+ }
190
+ });
191
+ }
192
+
193
+ function printGpuTorchCudaSummary(result) {
194
+ try {
195
+ console.log(chalk.bold('\n📊 API RESULT SUMMARY (GPU/Torch/CUDA)'));
196
+ console.log('────────────────────────────────────────────────────────');
197
+
198
+ const cuda = result.cudaRecommendation;
199
+ if (cuda) {
200
+ console.log(chalk.bold('🎯 CUDA Recommendation'));
201
+ if (cuda.recommendedCudaVersion) console.log(` - CUDA: ${cuda.recommendedCudaVersion}`);
202
+ if (Array.isArray(cuda.compatibleTorchVersions) && cuda.compatibleTorchVersions.length)
203
+ console.log(` - Torch Compatibility: ${cuda.compatibleTorchVersions.join(', ')}`);
204
+ if (cuda.dockerImage) console.log(` - Docker Image: ${cuda.dockerImage}`);
205
+ if (Array.isArray(cuda.installCommands) && cuda.installCommands.length) {
206
+ console.log(' - Install Commands:');
207
+ cuda.installCommands.forEach((c) => console.log(` $ ${c}`));
208
+ }
209
+ if (cuda.notes) console.log(` - Notes: ${cuda.notes}`);
210
+ console.log();
211
+ }
212
+
213
+ const torch = result.torchRecommendation;
214
+ if (torch) {
215
+ console.log(chalk.bold('🔥 PyTorch Recommendation'));
216
+ if (torch.recommendedTorchVersion) console.log(` - Torch: ${torch.recommendedTorchVersion}`);
217
+ if (torch.cudaVariant) console.log(` - CUDA Variant: ${torch.cudaVariant}`);
218
+ if (torch.pipInstallCommand) {
219
+ console.log(' - Install:');
220
+ console.log(` $ ${torch.pipInstallCommand}`);
221
+ }
222
+ if (Array.isArray(torch.extraPackages) && torch.extraPackages.length)
223
+ console.log(` - Extra Packages: ${torch.extraPackages.join(', ')}`);
224
+ if (torch.notes) console.log(` - Notes: ${torch.notes}`);
225
+ console.log();
226
+ }
227
+
228
+ const gpu = result.gpuRecommendation;
229
+ if (gpu) {
230
+ console.log(chalk.bold('🖥️ GPU Recommendation'));
231
+ if (gpu.minimumVramGb !== undefined) console.log(` - Min VRAM: ${gpu.minimumVramGb} GB`);
232
+ if (gpu.recommendedVramGb !== undefined) console.log(` - Recommended VRAM: ${gpu.recommendedVramGb} GB`);
233
+ if (gpu.minComputeCapability) console.log(` - Min Compute Capability: ${gpu.minComputeCapability}`);
234
+ if (Array.isArray(gpu.recommendedModels) && gpu.recommendedModels.length)
235
+ console.log(` - Recommended Models: ${gpu.recommendedModels.join(', ')}`);
236
+ if (Array.isArray(gpu.budgetOptions) && gpu.budgetOptions.length)
237
+ console.log(` - Budget Options: ${gpu.budgetOptions.join(', ')}`);
238
+ if (Array.isArray(gpu.cloudInstances) && gpu.cloudInstances.length)
239
+ console.log(` - Cloud Instances: ${gpu.cloudInstances.join(', ')}`);
240
+ if (gpu.notes) console.log(` - Notes: ${gpu.notes}`);
241
+ console.log();
242
+ }
243
+ } catch {}
244
+ }
245
+
107
246
  // Function to send user data to web application
108
247
  async function sendUserData(userId, userName) {
109
248
  try {
@@ -189,7 +328,7 @@ async function sendUserData(userId, userName) {
189
328
  resolve();
190
329
  });
191
330
 
192
- req.write(data);
331
+ req.write(JSON.stringify(userData));
193
332
  req.end();
194
333
  });
195
334
  } catch (error) {
@@ -406,6 +545,11 @@ async function runContainerCommand(options) {
406
545
  repoUrl = answers.repoUrl;
407
546
  }
408
547
 
548
+ // NEW: Preview CUDA/Torch/GPU recommendations before choosing GPU (only if auto-detect enabled)
549
+ if (useApi && repoUrl) {
550
+ await previewRecommendations(repoUrl);
551
+ }
552
+
409
553
  // Prompt for GPU type if not specified
410
554
  if (!gpuType) {
411
555
  const gpuAnswers = await inquirer.prompt([
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitarsenal-cli",
3
- "version": "1.9.32",
3
+ "version": "1.9.33",
4
4
  "description": "CLI tool for creating Modal sandboxes with GitHub repositories",
5
5
  "main": "index.js",
6
6
  "bin": {