genbox 1.0.192 → 1.0.194

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.
@@ -9,6 +9,7 @@ const chalk_1 = __importDefault(require("chalk"));
9
9
  const select_1 = __importDefault(require("@inquirer/select"));
10
10
  const input_1 = __importDefault(require("@inquirer/input"));
11
11
  const confirm_1 = __importDefault(require("@inquirer/confirm"));
12
+ const checkbox_1 = __importDefault(require("@inquirer/checkbox"));
12
13
  const ora_1 = __importDefault(require("ora"));
13
14
  const api_1 = require("../api");
14
15
  const utils_1 = require("../utils");
@@ -139,6 +140,42 @@ exports.newCommand = new commander_1.Command('new')
139
140
  default: size,
140
141
  });
141
142
  }
143
+ // AI CLI selection
144
+ let installClaudeCode = false;
145
+ let installGeminiCli = false;
146
+ // Check which CLIs are configured
147
+ const claudeConfigured = preferences.claudeCredentials === 'configured';
148
+ const geminiConfigured = preferences.geminiCredentials === 'configured';
149
+ const configuredCount = (claudeConfigured ? 1 : 0) + (geminiConfigured ? 1 : 0);
150
+ if (!options.yes && configuredCount > 1) {
151
+ // Multiple CLIs configured - ask which to install
152
+ const aiChoices = [];
153
+ if (claudeConfigured) {
154
+ aiChoices.push({
155
+ name: `Claude Code ${chalk_1.default.green('(credentials synced)')}`,
156
+ value: 'claude',
157
+ checked: true,
158
+ });
159
+ }
160
+ if (geminiConfigured) {
161
+ aiChoices.push({
162
+ name: `Gemini CLI ${chalk_1.default.green('(credentials synced)')}`,
163
+ value: 'gemini',
164
+ checked: true,
165
+ });
166
+ }
167
+ const selectedAiClis = await (0, checkbox_1.default)({
168
+ message: 'Install AI CLIs:',
169
+ choices: aiChoices,
170
+ });
171
+ installClaudeCode = selectedAiClis.includes('claude');
172
+ installGeminiCli = selectedAiClis.includes('gemini');
173
+ }
174
+ else {
175
+ // Only one or no CLI configured - auto-select configured ones
176
+ installClaudeCode = claudeConfigured;
177
+ installGeminiCli = geminiConfigured;
178
+ }
142
179
  // Check credits
143
180
  const creditsPerHour = CREDITS_PER_HOUR[size] || 2;
144
181
  let totalCredits = 0;
@@ -161,6 +198,15 @@ exports.newCommand = new commander_1.Command('new')
161
198
  console.log(` ${chalk_1.default.bold('Name:')} ${projectName}`);
162
199
  console.log(` ${chalk_1.default.bold('Size:')} ${size} (${creditsPerHour} credit${creditsPerHour > 1 ? 's' : ''}/hr)`);
163
200
  console.log(` ${chalk_1.default.bold('Features:')} ${template.features.join(', ')}`);
201
+ // Show AI CLIs to be installed
202
+ const aiClisToInstall = [];
203
+ if (installClaudeCode)
204
+ aiClisToInstall.push('Claude Code');
205
+ if (installGeminiCli)
206
+ aiClisToInstall.push('Gemini CLI');
207
+ if (aiClisToInstall.length > 0) {
208
+ console.log(` ${chalk_1.default.bold('AI CLIs:')} ${aiClisToInstall.join(', ')}`);
209
+ }
164
210
  console.log(` ${chalk_1.default.bold('Credits:')} ${totalCredits} available (~${Math.floor(totalCredits / creditsPerHour)} hours)`);
165
211
  console.log(chalk_1.default.dim('───────────────────────────────────────────────'));
166
212
  // Confirm
@@ -187,6 +233,8 @@ exports.newCommand = new commander_1.Command('new')
187
233
  files: [],
188
234
  postDetails: [],
189
235
  repos: {},
236
+ installClaudeCode,
237
+ installGeminiCli,
190
238
  };
191
239
  // If template uses createCommand, set it up
192
240
  if (template.createCommand) {
@@ -58,17 +58,19 @@ const select_1 = __importDefault(require("@inquirer/select"));
58
58
  const prompts_1 = require("@inquirer/prompts");
59
59
  const config_store_1 = require("../config-store");
60
60
  const api_1 = require("../api");
61
+ const ssh_keys_1 = require("../utils/ssh-keys");
61
62
  const child_process_1 = require("child_process");
62
63
  const os = __importStar(require("os"));
63
64
  const path = __importStar(require("path"));
64
65
  const fs = __importStar(require("fs"));
65
66
  // Helper functions
66
67
  function getPrivateSshKey() {
67
- const keyPath = path.join(os.homedir(), '.ssh', 'genbox_key');
68
- if (!fs.existsSync(keyPath)) {
68
+ try {
69
+ return (0, ssh_keys_1.getPrivateSshKeyPath)();
70
+ }
71
+ catch {
69
72
  return null;
70
73
  }
71
- return keyPath;
72
74
  }
73
75
  function getDtachSocketDir() {
74
76
  return path.join(os.homedir(), '.genbox', 'sockets');
@@ -147,9 +149,11 @@ async function ensureLocalDtach() {
147
149
  async function getGenboxes(includesStopped = true) {
148
150
  try {
149
151
  const response = await (0, api_1.fetchApi)('/genboxes');
150
- const genboxes = response?.genboxes || [];
152
+ // API returns array directly, not wrapped in { genboxes: [...] }
153
+ const genboxes = Array.isArray(response) ? response : response?.genboxes || [];
151
154
  if (includesStopped) {
152
155
  // Return all genboxes (running first, then stopped)
156
+ // Also include orphan genboxes (no project, workspace=default) from `gb new`
153
157
  return genboxes
154
158
  .filter(g => g.status === 'running' || g.status === 'stopped')
155
159
  .sort((a, b) => {
@@ -43,7 +43,10 @@ async function getGenboxes(options = {}) {
43
43
  if (!options.all) {
44
44
  const projectName = getProjectContext();
45
45
  if (projectName) {
46
- genboxes = genboxes.filter(g => g.project === projectName || g.workspace === projectName);
46
+ genboxes = genboxes.filter(g => g.project === projectName ||
47
+ g.workspace === projectName ||
48
+ // Also include "orphan" genboxes (no project) - e.g., from `gb new`
49
+ (!g.project && g.workspace === 'default'));
47
50
  }
48
51
  }
49
52
  return genboxes;
@@ -118,7 +118,7 @@ function getCredentialsFromOAuthFile() {
118
118
  */
119
119
  function getGeminiAuthInstructions() {
120
120
  return `To authenticate Gemini CLI:
121
- 1. Install Gemini CLI: npm install -g @anthropic-ai/gemini-cli
121
+ 1. Install Gemini CLI: npm install -g @google/gemini-cli
122
122
  2. Run 'gemini' in your terminal
123
123
  3. Follow the browser authentication flow
124
124
  4. Your credentials will be stored in ~/.gemini/oauth_creds.json
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "genbox",
3
- "version": "1.0.192",
3
+ "version": "1.0.194",
4
4
  "description": "Genbox CLI - AI-Powered Development Environments",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -50,6 +50,7 @@
50
50
  "typescript": "^5.9.3"
51
51
  },
52
52
  "dependencies": {
53
+ "@inquirer/checkbox": "^5.0.3",
53
54
  "@inquirer/confirm": "^6.0.2",
54
55
  "@inquirer/input": "^5.0.3",
55
56
  "@inquirer/prompts": "^8.0.2",