From 8af982e706616679bb5fc79a2666d84c88336995 Mon Sep 17 00:00:00 2001 From: simosmik Date: Wed, 31 Dec 2025 07:59:13 +0000 Subject: [PATCH 1/3] feat: add update command to CLI for checking and installing the latest version --- README.md | 6 +++++ server/cli.js | 63 +++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 69 insertions(+) diff --git a/README.md b/README.md index 1b8cbac..b01ce35 100644 --- a/README.md +++ b/README.md @@ -88,6 +88,11 @@ claude-code-ui **To restart**: Stop with Ctrl+C and run `claude-code-ui` again. +**To update**: +```bash +cloudcli update +``` + ### CLI Usage After global installation, you have access to both `claude-code-ui` and `cloudcli` commands: @@ -97,6 +102,7 @@ After global installation, you have access to both `claude-code-ui` and `cloudcl | `cloudcli` or `claude-code-ui` | | Start the server (default) | | `cloudcli start` | | Start the server explicitly | | `cloudcli status` | | Show configuration and data locations | +| `cloudcli update` | | Update to the latest version | | `cloudcli help` | | Show help information | | `cloudcli version` | | Show version information | | `--port ` | `-p` | Set server port (default: 3001) | diff --git a/server/cli.js b/server/cli.js index f817dd7..ebff4a0 100755 --- a/server/cli.js +++ b/server/cli.js @@ -151,6 +151,7 @@ Usage: Commands: start Start the Claude Code UI server (default) status Show configuration and data locations + update Update to the latest version help Show this help information version Show version information @@ -186,8 +187,67 @@ function showVersion() { console.log(`${packageJson.version}`); } +// Compare semver versions, returns true if v1 > v2 +function isNewerVersion(v1, v2) { + const parts1 = v1.split('.').map(Number); + const parts2 = v2.split('.').map(Number); + for (let i = 0; i < 3; i++) { + if (parts1[i] > parts2[i]) return true; + if (parts1[i] < parts2[i]) return false; + } + return false; +} + +// Check for updates +async function checkForUpdates(silent = false) { + try { + const { execSync } = await import('child_process'); + const latestVersion = execSync('npm show @siteboon/claude-code-ui version', { encoding: 'utf8' }).trim(); + const currentVersion = packageJson.version; + + if (isNewerVersion(latestVersion, currentVersion)) { + console.log(`\n${c.warn('[UPDATE]')} New version available: ${c.bright(latestVersion)} (current: ${currentVersion})`); + console.log(` Run ${c.bright('cloudcli update')} to update\n`); + return { hasUpdate: true, latestVersion, currentVersion }; + } else if (!silent) { + console.log(`${c.ok('[OK]')} You are on the latest version (${currentVersion})`); + } + return { hasUpdate: false, latestVersion, currentVersion }; + } catch (e) { + if (!silent) { + console.log(`${c.warn('[WARN]')} Could not check for updates`); + } + return { hasUpdate: false, error: e.message }; + } +} + +// Update the package +async function updatePackage() { + try { + const { execSync } = await import('child_process'); + console.log(`${c.info('[INFO]')} Checking for updates...`); + + const { hasUpdate, latestVersion, currentVersion } = await checkForUpdates(true); + + if (!hasUpdate) { + console.log(`${c.ok('[OK]')} Already on the latest version (${currentVersion})`); + return; + } + + console.log(`${c.info('[INFO]')} Updating from ${currentVersion} to ${latestVersion}...`); + execSync('npm update -g @siteboon/claude-code-ui', { stdio: 'inherit' }); + console.log(`${c.ok('[OK]')} Update complete! Restart cloudcli to use the new version.`); + } catch (e) { + console.error(`${c.error('[ERROR]')} Update failed: ${e.message}`); + console.log(`${c.tip('[TIP]')} Try running manually: npm update -g @siteboon/claude-code-ui`); + } +} + // Start the server async function startServer() { + // Check for updates silently on startup + checkForUpdates(true); + // Import and run the server await import('./index.js'); } @@ -250,6 +310,9 @@ async function main() { case '--version': showVersion(); break; + case 'update': + await updatePackage(); + break; default: console.error(`\n❌ Unknown command: ${command}`); console.log(' Run "cloudcli help" for usage information.\n'); From 104e4260a7b6874f57408069cd4a21cb4c43c884 Mon Sep 17 00:00:00 2001 From: simosmik Date: Wed, 31 Dec 2025 08:00:36 +0000 Subject: [PATCH 2/3] Release 1.13.6 --- package-lock.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/package-lock.json b/package-lock.json index b0e70b8..b7ab7c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@siteboon/claude-code-ui", - "version": "1.13.5", + "version": "1.13.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@siteboon/claude-code-ui", - "version": "1.13.5", + "version": "1.13.6", "license": "MIT", "dependencies": { "@anthropic-ai/claude-agent-sdk": "^0.1.29", diff --git a/package.json b/package.json index d5f35ef..81c8ded 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@siteboon/claude-code-ui", - "version": "1.13.5", + "version": "1.13.6", "description": "A web-based UI for Claude Code CLI", "type": "module", "main": "server/index.js", From b066ec4c0114f1ff333a83848794bc38087a2ccb Mon Sep 17 00:00:00 2001 From: simosmik Date: Wed, 31 Dec 2025 10:47:55 +0000 Subject: [PATCH 3/3] fix: change codex login for platform mode --- src/components/LoginModal.jsx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/components/LoginModal.jsx b/src/components/LoginModal.jsx index 633aaf9..c6f6db5 100644 --- a/src/components/LoginModal.jsx +++ b/src/components/LoginModal.jsx @@ -25,13 +25,15 @@ function LoginModal({ const getCommand = () => { if (customCommand) return customCommand; + const isPlatform = import.meta.env.VITE_IS_PLATFORM === 'true'; + switch (provider) { case 'claude': return 'claude setup-token --dangerously-skip-permissions'; case 'cursor': return 'cursor-agent login'; case 'codex': - return 'codex login'; + return isPlatform ? 'codex login --device-auth' : 'codex login'; default: return 'claude setup-token --dangerously-skip-permissions'; }