gitarsenal-cli 1.8.5 → 1.8.6

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/activate_venv.sh CHANGED
@@ -1,4 +1,4 @@
1
1
  #!/bin/bash
2
2
  cd "$(dirname "$0")"
3
- source "/Users/rohansharma/RepoStarter/gitarsenal-cli/venv/bin/activate"
3
+ source ".venv/bin/activate"
4
4
  exec "$@"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitarsenal-cli",
3
- "version": "1.8.5",
3
+ "version": "1.8.6",
4
4
  "description": "CLI tool for creating Modal sandboxes with GitHub repositories",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -65,74 +65,67 @@ async function checkAndInstallUv() {
65
65
  }
66
66
  }
67
67
 
68
- // Function to create and activate virtual environment
68
+ // Function to create and activate virtual environment using uv
69
69
  async function createVirtualEnvironment() {
70
- const venvPath = path.join(__dirname, '..', 'venv');
71
70
  const packages = ['modal', 'gitingest', 'requests'];
72
71
 
73
- console.log(chalk.yellow(`📦 Creating virtual environment and installing packages: ${packages.join(', ')}`));
72
+ console.log(chalk.yellow(`📦 Creating virtual environment with uv and installing packages: ${packages.join(', ')}`));
74
73
 
75
74
  try {
76
- // Create virtual environment directory
77
- await fs.ensureDir(path.dirname(venvPath));
78
-
79
- // Try different Python commands to create virtual environment
80
- const pythonCommands = ['python3', 'python', 'py'];
81
- let pythonCmd = null;
82
-
83
- for (const cmd of pythonCommands) {
75
+ // First, ensure uv is available
76
+ let uvAvailable = false;
77
+ try {
78
+ await execAsync('uv --version');
79
+ uvAvailable = true;
80
+ } catch (error) {
81
+ console.log(chalk.yellow('⚠️ uv not found, attempting to install...'));
82
+ await checkAndInstallUv();
84
83
  try {
85
- await execAsync(`${cmd} --version`);
86
- pythonCmd = cmd;
87
- break;
88
- } catch (error) {
89
- // Continue to next command
84
+ await execAsync('uv --version');
85
+ uvAvailable = true;
86
+ } catch (installError) {
87
+ console.log(chalk.red('❌ Failed to install uv'));
88
+ return false;
90
89
  }
91
90
  }
92
91
 
93
- if (!pythonCmd) {
94
- console.log(chalk.red('❌ No Python command found'));
92
+ if (!uvAvailable) {
93
+ console.log(chalk.red('❌ uv is required but not available'));
95
94
  return false;
96
95
  }
97
96
 
98
- console.log(chalk.gray(`🔄 Creating virtual environment with ${pythonCmd}...`));
97
+ console.log(chalk.gray(`🔄 Creating virtual environment with uv...`));
99
98
 
100
- // Create virtual environment
101
- await execAsync(`${pythonCmd} -m venv "${venvPath}"`, {
99
+ // Create virtual environment using uv
100
+ await execAsync('uv venv', {
101
+ cwd: path.join(__dirname, '..'),
102
102
  env: { ...process.env, PYTHONIOENCODING: 'utf-8' }
103
103
  });
104
104
 
105
- console.log(chalk.green('✅ Virtual environment created successfully!'));
105
+ console.log(chalk.green('✅ Virtual environment created successfully with uv!'));
106
106
 
107
- // Determine the pip path based on OS
108
- const isWindows = process.platform === 'win32';
109
- const pipPath = isWindows ? path.join(venvPath, 'Scripts', 'pip.exe') : path.join(venvPath, 'bin', 'pip');
110
- const pythonPath = isWindows ? path.join(venvPath, 'Scripts', 'python.exe') : path.join(venvPath, 'bin', 'python');
107
+ console.log(chalk.gray(`🔄 Installing packages in virtual environment with uv...`));
111
108
 
112
- // Verify virtual environment was created properly
113
- if (!(await fs.pathExists(pipPath))) {
114
- console.log(chalk.red('❌ Virtual environment pip not found'));
115
- return false;
116
- }
117
-
118
- console.log(chalk.gray(`🔄 Installing packages in virtual environment...`));
119
-
120
- // Install packages in virtual environment
121
- await execAsync(`"${pipPath}" install ${packages.join(' ')}`, {
109
+ // Install packages using uv pip
110
+ await execAsync(`uv pip install ${packages.join(' ')}`, {
111
+ cwd: path.join(__dirname, '..'),
122
112
  env: { ...process.env, PYTHONIOENCODING: 'utf-8' }
123
113
  });
124
114
 
125
115
  console.log(chalk.green('✅ Python packages installed successfully in virtual environment!'));
126
116
 
127
117
  // Create a script to activate the virtual environment
118
+ const isWindows = process.platform === 'win32';
119
+ const venvPath = path.join(__dirname, '..', '.venv');
120
+
128
121
  const activateScript = isWindows ?
129
122
  `@echo off
130
123
  cd /d "%~dp0"
131
- call "${venvPath.replace(/\\/g, '\\\\')}\\Scripts\\activate.bat"
124
+ call ".venv\\Scripts\\activate.bat"
132
125
  %*` :
133
126
  `#!/bin/bash
134
127
  cd "$(dirname "$0")"
135
- source "${venvPath}/bin/activate"
128
+ source ".venv/bin/activate"
136
129
  exec "$@"`;
137
130
 
138
131
  const activateScriptPath = path.join(__dirname, '..', 'activate_venv' + (isWindows ? '.bat' : '.sh'));
@@ -146,12 +139,12 @@ exec "$@"`;
146
139
 
147
140
  return true;
148
141
  } catch (error) {
149
- console.log(chalk.red(`❌ Error creating virtual environment: ${error.message}`));
142
+ console.log(chalk.red(`❌ Error creating virtual environment with uv: ${error.message}`));
150
143
  console.log(chalk.yellow('💡 Please run manually:'));
151
- console.log(chalk.yellow(' python3 -m venv venv'));
152
- console.log(chalk.yellow(' source venv/bin/activate # On Unix/macOS'));
153
- console.log(chalk.yellow(' venv\\Scripts\\activate.bat # On Windows'));
154
- console.log(chalk.yellow(' pip install modal gitingest requests'));
144
+ console.log(chalk.yellow(' uv venv'));
145
+ console.log(chalk.yellow(' uv pip install modal gitingest requests'));
146
+ console.log(chalk.yellow(' source .venv/bin/activate # On Unix/macOS'));
147
+ console.log(chalk.yellow(' .venv\\Scripts\\activate.bat # On Windows'));
155
148
  return false;
156
149
  }
157
150
  }
@@ -338,8 +331,8 @@ if __name__ == "__main__":
338
331
  • Visit: https://gitarsenal.dev
339
332
 
340
333
  💡 To activate the virtual environment:
341
- • Unix/macOS: source venv/bin/activate
342
- • Windows: venv\\Scripts\\activate.bat
334
+ • Unix/macOS: source .venv/bin/activate
335
+ • Windows: .venv\\Scripts\\activate.bat
343
336
  • Or use: ./activate_venv.sh (Unix/macOS) or activate_venv.bat (Windows)
344
337
 
345
338
  Having issues? Run: gitarsenal --debug