ocb-cli 1.2.4 → 1.2.5

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 (3) hide show
  1. package/dist/cli.js +21 -2
  2. package/package.json +1 -1
  3. package/src/cli.ts +23 -2
package/dist/cli.js CHANGED
@@ -163,15 +163,34 @@ async function start() {
163
163
  log(' npm install -g opencode-ai', colors.yellow);
164
164
  process.exit(1);
165
165
  }
166
+ // Configure Claude Code
167
+ await configureClaudeCode(PROXY_PORT);
166
168
  // Start OpenCode server
167
169
  await startOpenCode();
168
170
  // Start proxy
169
171
  await startProxy();
172
+ // Wait a moment for proxy to start
173
+ await new Promise(r => setTimeout(r, 1000));
174
+ // Refresh models
175
+ try {
176
+ await fetch('http://localhost:' + PROXY_PORT + '/api/refresh-models');
177
+ log('✅ Models loaded', colors.green);
178
+ }
179
+ catch (e) { }
180
+ // Set default model if not set
181
+ try {
182
+ await fetch('http://localhost:' + PROXY_PORT + '/api/model', {
183
+ method: 'POST',
184
+ headers: { 'Content-Type': 'application/json' },
185
+ body: JSON.stringify({ modelId: 'opencode/minimax-m2.5-free' })
186
+ });
187
+ log('✅ Default model: minimax-m2.5-free', colors.green);
188
+ }
189
+ catch (e) { }
170
190
  log('\n' + '='.repeat(50), colors.green);
171
191
  log('🎉 All services running!', colors.green);
172
192
  log('='.repeat(50), colors.green);
173
- log('\n📊 Dashboard: http://localhost:' + PROXY_PORT, colors.cyan);
174
- log('🤖 Claude Code: claude --print', colors.cyan);
193
+ log('\n🤖 Claude Code is ready to use!', colors.cyan);
175
194
  log('\nPress Ctrl+C to stop all services\n', colors.yellow);
176
195
  }
177
196
  async function stop() {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ocb-cli",
3
- "version": "1.2.4",
3
+ "version": "1.2.5",
4
4
  "description": "OpenCode Bridge - Use OpenCode AI models in Claude Code",
5
5
  "type": "module",
6
6
  "main": "dist/proxy.js",
package/src/cli.ts CHANGED
@@ -203,17 +203,38 @@ async function start() {
203
203
  process.exit(1);
204
204
  }
205
205
 
206
+ // Configure Claude Code
207
+ await configureClaudeCode(PROXY_PORT);
208
+
206
209
  // Start OpenCode server
207
210
  await startOpenCode();
208
211
 
209
212
  // Start proxy
210
213
  await startProxy();
211
214
 
215
+ // Wait a moment for proxy to start
216
+ await new Promise(r => setTimeout(r, 1000));
217
+
218
+ // Refresh models
219
+ try {
220
+ await fetch('http://localhost:' + PROXY_PORT + '/api/refresh-models');
221
+ log('✅ Models loaded', colors.green);
222
+ } catch (e) {}
223
+
224
+ // Set default model if not set
225
+ try {
226
+ await fetch('http://localhost:' + PROXY_PORT + '/api/model', {
227
+ method: 'POST',
228
+ headers: { 'Content-Type': 'application/json' },
229
+ body: JSON.stringify({ modelId: 'opencode/minimax-m2.5-free' })
230
+ });
231
+ log('✅ Default model: minimax-m2.5-free', colors.green);
232
+ } catch (e) {}
233
+
212
234
  log('\n' + '='.repeat(50), colors.green);
213
235
  log('🎉 All services running!', colors.green);
214
236
  log('='.repeat(50), colors.green);
215
- log('\n📊 Dashboard: http://localhost:' + PROXY_PORT, colors.cyan);
216
- log('🤖 Claude Code: claude --print', colors.cyan);
237
+ log('\n🤖 Claude Code is ready to use!', colors.cyan);
217
238
  log('\nPress Ctrl+C to stop all services\n', colors.yellow);
218
239
  }
219
240