Skip to content
This repository was archived by the owner on Jul 14, 2026. It is now read-only.

improves the update message in case of global install.#337

Merged
fabianboth merged 1 commit into
mainfrom
improve-update-recommendation
Jan 19, 2026
Merged

improves the update message in case of global install.#337
fabianboth merged 1 commit into
mainfrom
improve-update-recommendation

Conversation

@fabianboth

@fabianboth fabianboth commented Jan 19, 2026

Copy link
Copy Markdown
Contributor

In case the user installed globally, this gives a hint to proceed.

Greptile Summary

Improved the error message when package.json cannot be found at ~/.local/packages. The new message explicitly guides users who installed the CLI globally via npm to use npm update -g @octomind/octomind instead of showing a generic "please update manually" error.

  • Enhanced user experience by providing actionable guidance for global npm installations
  • Message now specifies the expected location (~/.local/packages) where the CLI looks for package.json
  • Clear instruction for the alternative update method when the local package structure isn't present

Confidence Score: 5/5

  • This PR is safe to merge with minimal risk
  • The change only improves an error message to be more helpful and actionable. No logic changes, no new functionality, and the improved message accurately reflects the two installation methods documented in the README
  • No files require special attention

Important Files Changed

Filename Overview
src/tools/update.ts Improved error message for missing package.json to guide users on npm global update command

Sequence Diagram

sequenceDiagram
    participant User
    participant CLI as octomind update
    participant FS as File System
    participant NPM as npm
    
    User->>CLI: Run update command
    CLI->>FS: Check if ~/.local/packages/package.json exists
    alt package.json not found (global install)
        FS-->>CLI: File not found
        CLI->>User: Error: Cannot find package.json at ~/.local/packages<br/>If you installed globally via npm, run:<br/>npm update -g @octomind/octomind
        CLI->>CLI: process.exit(1)
    else package.json exists (local install)
        FS-->>CLI: File exists
        CLI->>NPM: Check if npm is available
        alt npm not found
            NPM-->>CLI: Not found
            CLI->>User: Error: Cannot determine location of npm
            CLI->>CLI: process.exit(1)
        else npm found
            NPM-->>CLI: npm available
            CLI->>NPM: Execute npm install @octomind/octomind@latest
            NPM-->>CLI: Installation result
            CLI->>User: Update complete ✔
        end
    end
Loading

@fabianboth fabianboth self-assigned this Jan 19, 2026
@greptile-apps

greptile-apps Bot commented Jan 19, 2026

Copy link
Copy Markdown

Greptile found no issues!

From now on, if a review finishes and we haven't found any issues, we will not post anything, but you can confirm that we reviewed your changes in the status check section.

This feature can be toggled off in your Code Review Settings by deselecting "Create a status check for each PR".

@fabianboth
fabianboth merged commit 80a9b22 into main Jan 19, 2026
4 checks passed
@fabianboth
fabianboth deleted the improve-update-recommendation branch January 19, 2026 12:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants