diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index dbda3cb1d..bcc4c078e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -79,6 +79,40 @@ jobs: - name: Publish to npm run: npm publish --access public --provenance + - name: Verify npm latest dist-tag + env: + EXPECTED_VERSION: ${{ needs.release-please.outputs.version }} + run: | + set -euo pipefail + + if [ -z "${EXPECTED_VERSION}" ]; then + echo "release-please did not provide an expected version" >&2 + exit 1 + fi + + for attempt in $(seq 1 30); do + published_version="$(npm view @gitlawb/openclaude version 2>/dev/null || true)" + latest_tag="$(npm view @gitlawb/openclaude dist-tags.latest 2>/dev/null || true)" + latest_version="$(npm view @gitlawb/openclaude@latest version 2>/dev/null || true)" + + echo "Attempt ${attempt}: version=${published_version:-} latest=${latest_tag:-} @latest=${latest_version:-} expected=${EXPECTED_VERSION}" + + if [ "$published_version" = "$EXPECTED_VERSION" ] && \ + [ "$latest_tag" = "$EXPECTED_VERSION" ] && \ + [ "$latest_version" = "$EXPECTED_VERSION" ]; then + echo "npm latest verified for @gitlawb/openclaude@${EXPECTED_VERSION}" + exit 0 + fi + + sleep 10 + done + + echo "npm latest dist-tag did not resolve to ${EXPECTED_VERSION}" >&2 + echo "Observed package version: ${published_version:-}" >&2 + echo "Observed dist-tags.latest: ${latest_tag:-}" >&2 + echo "Observed @latest version: ${latest_version:-}" >&2 + exit 1 + - name: Release summary run: | { diff --git a/README.md b/README.md index a471194a0..1d5651986 100644 --- a/README.md +++ b/README.md @@ -65,11 +65,19 @@ OpenClaude is also mirrored to GitLawb: ### Install ```bash -npm install -g @gitlawb/openclaude +npm install -g @gitlawb/openclaude@latest ``` If the install later reports `ripgrep not found`, install ripgrep system-wide and confirm `rg --version` works in the same terminal before starting OpenClaude. +**Verify / troubleshoot installed version:** + +```bash +openclaude --version +npm view @gitlawb/openclaude dist-tags +npm install -g @gitlawb/openclaude@latest +``` + ### Start ```bash diff --git a/docs/advanced-setup.md b/docs/advanced-setup.md index bc7fb4749..908087549 100644 --- a/docs/advanced-setup.md +++ b/docs/advanced-setup.md @@ -7,7 +7,7 @@ This guide is for users who want source builds, Bun workflows, provider profiles ### Option A: npm ```bash -npm install -g @gitlawb/openclaude +npm install -g @gitlawb/openclaude@latest ``` ### Option B: From source with Bun diff --git a/docs/quick-start-mac-linux.md b/docs/quick-start-mac-linux.md index 00b65b520..3d85fcc3c 100644 --- a/docs/quick-start-mac-linux.md +++ b/docs/quick-start-mac-linux.md @@ -18,7 +18,7 @@ npm --version ## 2. Install OpenClaude ```bash -npm install -g @gitlawb/openclaude +npm install -g @gitlawb/openclaude@latest ``` ## 3. Pick One Provider diff --git a/docs/quick-start-windows.md b/docs/quick-start-windows.md index 0b93f48b1..58d6aa886 100644 --- a/docs/quick-start-windows.md +++ b/docs/quick-start-windows.md @@ -18,7 +18,7 @@ npm --version ## 2. Install OpenClaude ```powershell -npm install -g @gitlawb/openclaude +npm install -g @gitlawb/openclaude@latest ``` ## 3. Pick One Provider diff --git a/src/components/AutoUpdater.tsx b/src/components/AutoUpdater.tsx index 4cf46357a..efa2d316f 100644 --- a/src/components/AutoUpdater.tsx +++ b/src/components/AutoUpdater.tsx @@ -190,7 +190,7 @@ export function AutoUpdater({ {(autoUpdaterResult?.status === 'install_failed' || autoUpdaterResult?.status === 'no_permissions') && ✗ Auto-update failed · Try openclaude doctor or{' '} - {hasLocalInstall ? `cd ~/.openclaude/local && npm update ${MACRO.PACKAGE_URL}` : `npm i -g ${MACRO.PACKAGE_URL}`} + {hasLocalInstall ? `cd ~/.openclaude/local && npm update ${MACRO.PACKAGE_URL}` : `npm i -g ${MACRO.PACKAGE_URL}@latest`} } ; diff --git a/src/utils/autoUpdater.ts b/src/utils/autoUpdater.ts index 120b4c972..273a45605 100644 --- a/src/utils/autoUpdater.ts +++ b/src/utils/autoUpdater.ts @@ -533,7 +533,7 @@ To fix this issue: // Use specific version if provided, otherwise use latest const packageSpec = specificVersion ? `${MACRO.PACKAGE_URL}@${specificVersion}` - : MACRO.PACKAGE_URL + : `${MACRO.PACKAGE_URL}@latest` // Run from home directory to avoid reading project-level .npmrc/.bunfig.toml // which could be maliciously crafted to redirect to an attacker's registry diff --git a/vscode-extension/openclaude-vscode/README.md b/vscode-extension/openclaude-vscode/README.md index 0b7ab21a1..0bc3ae07b 100644 --- a/vscode-extension/openclaude-vscode/README.md +++ b/vscode-extension/openclaude-vscode/README.md @@ -28,7 +28,7 @@ A practical VS Code companion for OpenClaude with a project-aware **Control Cent ## Requirements - VS Code `1.95+` -- `openclaude` available in your terminal PATH (`npm install -g @gitlawb/openclaude`) +- `openclaude` available in your terminal PATH (`npm install -g @gitlawb/openclaude@latest`) ## Commands diff --git a/vscode-extension/openclaude-vscode/src/extension.js b/vscode-extension/openclaude-vscode/src/extension.js index 1470abe69..2cfcf06ae 100644 --- a/vscode-extension/openclaude-vscode/src/extension.js +++ b/vscode-extension/openclaude-vscode/src/extension.js @@ -291,7 +291,7 @@ async function launchOpenClaude(options = {}) { if (!installed) { const action = await vscode.window.showErrorMessage( - `OpenClaude command not found: ${executable}. Install it with: npm install -g @gitlawb/openclaude`, + `OpenClaude command not found: ${executable}. Install it with: npm install -g @gitlawb/openclaude@latest`, 'Open Setup Guide', 'Open Repository', ); diff --git a/web/src/content.ts b/web/src/content.ts index a2dd4b923..e89a16e32 100644 --- a/web/src/content.ts +++ b/web/src/content.ts @@ -1,4 +1,4 @@ -export const installCommand = 'npm install -g @gitlawb/openclaude' +export const installCommand = 'npm install -g @gitlawb/openclaude@latest' export const features = [ {