@mmmbuto/nexuscli 0.5.3 → 0.5.4

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/README.md CHANGED
@@ -12,7 +12,7 @@
12
12
  NexusCLI is an experimental, ultra-light terminal cockpit designed for
13
13
  AI-assisted development workflows on Termux (Android).
14
14
 
15
- **v0.5.3** - Mobile-First AI Control Plane
15
+ **v0.5.4** - Mobile-First AI Control Plane
16
16
 
17
17
  Web UI wrapper for Claude Code, Codex CLI, and Gemini CLI with voice input support.
18
18
 
@@ -169,50 +169,62 @@ async function start() {
169
169
  const certDir = path.join(process.env.HOME || '', '.nexuscli', 'certs');
170
170
  const certPath = path.join(certDir, 'cert.pem');
171
171
  const keyPath = path.join(certDir, 'key.pem');
172
- const useHttps = fs.existsSync(certPath) && fs.existsSync(keyPath);
172
+ const hasHttpsCerts = fs.existsSync(certPath) && fs.existsSync(keyPath);
173
173
 
174
- let server;
175
- let protocol = 'http';
174
+ // Always start HTTP server on main port
175
+ const httpServer = http.createServer(app);
176
176
 
177
- if (useHttps) {
177
+ // Start HTTPS server on PORT+1 if certificates exist (for remote mic access)
178
+ let httpsServer = null;
179
+ const HTTPS_PORT = parseInt(PORT) + 1;
180
+
181
+ if (hasHttpsCerts) {
178
182
  try {
179
183
  const httpsOptions = {
180
184
  key: fs.readFileSync(keyPath),
181
185
  cert: fs.readFileSync(certPath)
182
186
  };
183
- server = https.createServer(httpsOptions, app);
184
- protocol = 'https';
185
- console.log('[Startup] HTTPS enabled - certificates found');
187
+ httpsServer = https.createServer(httpsOptions, app);
188
+ console.log('[Startup] HTTPS certificates found');
186
189
  } catch (err) {
187
- console.warn('[Startup] Failed to load certificates, falling back to HTTP:', err.message);
188
- server = http.createServer(app);
190
+ console.warn('[Startup] Failed to load certificates:', err.message);
189
191
  }
190
- } else {
191
- server = http.createServer(app);
192
- console.log('[Startup] HTTP mode - no certificates found');
193
- console.log('[Startup] Run: ./scripts/setup-https.sh to enable HTTPS');
194
192
  }
195
193
 
196
- server.listen(PORT, () => {
194
+ httpServer.listen(PORT, () => {
197
195
  console.log('');
198
196
  console.log('╔══════════════════════════════════════════════╗');
199
197
  console.log('║ 🚀 NexusCLI Backend ║');
200
198
  console.log('╚══════════════════════════════════════════════╝');
201
199
  console.log('');
202
- console.log(`✅ Server running on ${protocol}://localhost:${PORT}`);
203
- if (useHttps) {
204
- console.log(`🔒 HTTPS enabled - secure connection`);
200
+ console.log(`✅ HTTP: http://localhost:${PORT}`);
201
+
202
+ if (httpsServer) {
203
+ httpsServer.listen(HTTPS_PORT, () => {
204
+ console.log(`🔒 HTTPS: https://localhost:${HTTPS_PORT} (for remote mic)`);
205
+ console.log('');
206
+ console.log('Endpoints:');
207
+ console.log(` GET /health (public)`);
208
+ console.log(` POST /api/v1/auth/login (public)`);
209
+ console.log(` GET /api/v1/auth/me (protected)`);
210
+ console.log(` GET /api/v1/conversations (protected)`);
211
+ console.log(` POST /api/v1/conversations (protected)`);
212
+ console.log(` POST /api/v1/jobs (protected)`);
213
+ console.log(` GET /api/v1/jobs/:id/stream (protected, SSE)`);
214
+ console.log('');
215
+ });
216
+ } else {
217
+ console.log('');
218
+ console.log('Endpoints:');
219
+ console.log(` GET /health (public)`);
220
+ console.log(` POST /api/v1/auth/login (public)`);
221
+ console.log(` GET /api/v1/auth/me (protected)`);
222
+ console.log(` GET /api/v1/conversations (protected)`);
223
+ console.log(` POST /api/v1/conversations (protected)`);
224
+ console.log(` POST /api/v1/jobs (protected)`);
225
+ console.log(` GET /api/v1/jobs/:id/stream (protected, SSE)`);
226
+ console.log('');
205
227
  }
206
- console.log('');
207
- console.log('Endpoints:');
208
- console.log(` GET /health (public)`);
209
- console.log(` POST /api/v1/auth/login (public)`);
210
- console.log(` GET /api/v1/auth/me (protected)`);
211
- console.log(` GET /api/v1/conversations (protected)`);
212
- console.log(` POST /api/v1/conversations (protected)`);
213
- console.log(` POST /api/v1/jobs (protected)`);
214
- console.log(` GET /api/v1/jobs/:id/stream (protected, SSE)`);
215
- console.log('');
216
228
  });
217
229
  }
218
230
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mmmbuto/nexuscli",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "description": "NexusCLI - TRI CLI Control Plane (Claude/Codex/Gemini)",
5
5
  "main": "lib/server/server.js",
6
6
  "bin": {