diff --git a/package-lock.json b/package-lock.json index 718c3d9..2de679f 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "@lenne.tech/cli", - "version": "1.26.0", + "version": "1.26.1", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@lenne.tech/cli", - "version": "1.26.0", + "version": "1.26.1", "hasInstallScript": true, "license": "MIT", "dependencies": { diff --git a/package.json b/package.json index 1d36b22..956e9fa 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@lenne.tech/cli", - "version": "1.26.0", + "version": "1.26.1", "description": "lenne.Tech CLI: lt", "keywords": [ "lenne.Tech", diff --git a/src/commands/claude/plugins.ts b/src/commands/claude/plugins.ts index 840d0b3..b5fe133 100644 --- a/src/commands/claude/plugins.ts +++ b/src/commands/claude/plugins.ts @@ -34,23 +34,24 @@ async function installPlugin( print: { error, info, spin }, } = toolbox; - // Step 1: Install or update plugin + // Step 1: Install or update plugin. + // + // `claude plugin install` is a no-op for an already-installed plugin: it reports + // "already installed" and leaves the active version pinned to whatever was installed + // before. To actually pull a newer release from the (freshly updated) marketplace + // cache, an existing install must be bumped with `claude plugin update`. const fullPluginName = `${plugin.pluginName}@${plugin.marketplaceName}`; const pluginSpinner = spin(`Installing/updating ${plugin.pluginName}`); - const installResult = runClaudeCommand(cli, `plugin install ${fullPluginName}`); + let installResult = runClaudeCommand(cli, `plugin install ${fullPluginName}`); let pluginAction = 'installed'; - if (installResult.output.includes('already') || installResult.output.includes('up to date')) { - pluginAction = 'up to date'; - } else if (installResult.output.includes('update') || installResult.output.includes('upgrade')) { - pluginAction = 'updated'; + if (installResult.output.includes('already installed')) { + // Plugin was already present — follow up with an update to reach the latest version. + installResult = runClaudeCommand(cli, `plugin update ${fullPluginName}`); + pluginAction = installResult.output.includes('already') ? 'up to date' : 'updated'; } - if ( - installResult.success || - installResult.output.includes('already') || - installResult.output.includes('up to date') - ) { + if (installResult.success || installResult.output.includes('already')) { pluginSpinner.succeed(`${plugin.pluginName} ${pluginAction}`); } else { pluginSpinner.fail(`Failed to install ${plugin.pluginName}`); @@ -59,6 +60,7 @@ async function installPlugin( info('Manual installation:'); info(` /plugin marketplace add ${plugin.marketplaceRepo}`); info(` /plugin install ${fullPluginName}`); + info(` /plugin update ${fullPluginName}`); return { action: 'failed', contents: EMPTY_PLUGIN_CONTENTS, postInstall: null, success: false }; }