Friendlier first-run output and no-sudo install fallback#29
Merged
paulius-krutkis-dcd merged 6 commits intoJun 11, 2026
Merged
Conversation
- Added `can_write_global` and `install_package` functions to manage global and user-level installations of the Decodo CLI. - Updated main installation logic to utilize the new functions, providing clearer feedback on installation success and path configuration. - Modified error messages to guide users on setting up their auth token more effectively. - Adjusted tests to reflect changes in error handling and onboarding steps for users.
…tegration header comment - Changed the expected URL in the test from "https://ip.decodo.com" to "https://does-not-exist.decodo.com". - Updated the comment for the integration header to remove the specific task reference, improving clarity.
…lier-first-run-output # Conflicts: # docs/install.sh
Mirror the install.sh behaviour: attempt a global npm install, fall back to a user-level install in %AppData%\npm-global when it fails, and show a friendly npx hint if even that fails. Suppress the global-bin PATH warning when the fallback ran and print user-prefix PATH guidance instead.
Folds in dependabot/npm_and_yarn/vitest-3.2.6 (lockfile-only; satisfies the existing ^3.2.0 range) so it ships with this branch.
aurimas-angladagis-dcd
approved these changes
Jun 10, 2026
|
|
||
| if (err instanceof AuthRequiredError || err instanceof AuthenticationError) { | ||
| if (err instanceof AuthRequiredError) { | ||
| console.error(""); |
There was a problem hiding this comment.
Can you use a single console.error, just format message with \n or smth?
Collaborator
Author
There was a problem hiding this comment.
Good catch, updated
- Consolidated error messages for AuthRequiredError to provide clearer guidance on obtaining and setting the auth token. - Removed redundant console.error calls to streamline output.
ChinchillaLover9000
approved these changes
Jun 10, 2026
paulius-krutkis-dcd
added a commit
that referenced
this pull request
Jun 11, 2026
* Refactor CLI commands and enhance error handling - Updated README.md to replace 'decodo search' with 'decodo google-search' for consistency. - Removed 'dcd' alias from install scripts and README, ensuring 'decodo' is the sole command. - Introduced ConfigParseError for improved error handling when configuration files are invalid. - Enhanced prompt for hidden input in setup command to improve user experience. - Added tests for new error handling and hidden prompt functionality. * Update version to 0.1.4 in package.json * Friendlier first-run output and no-sudo install fallback (#29) * Enhance install.sh for improved package installation and error handling - Added `can_write_global` and `install_package` functions to manage global and user-level installations of the Decodo CLI. - Updated main installation logic to utilize the new functions, providing clearer feedback on installation success and path configuration. - Modified error messages to guide users on setting up their auth token more effectively. - Adjusted tests to reflect changes in error handling and onboarding steps for users. * Update auth-validation test to reflect changes in expected URL and integration header comment - Changed the expected URL in the test from "https://ip.decodo.com" to "https://does-not-exist.decodo.com". - Updated the comment for the integration header to remove the specific task reference, improving clarity. * Add no-sudo install fallback to Windows install.ps1 Mirror the install.sh behaviour: attempt a global npm install, fall back to a user-level install in %AppData%\npm-global when it fails, and show a friendly npx hint if even that fails. Suppress the global-bin PATH warning when the fallback ran and print user-prefix PATH guidance instead. * Bump vitest from 3.2.4 to 3.2.6 Folds in dependabot/npm_and_yarn/vitest-3.2.6 (lockfile-only; satisfies the existing ^3.2.0 range) so it ships with this branch. * Improve CLI error messaging for authentication issues - Consolidated error messages for AuthRequiredError to provide clearer guidance on obtaining and setting the auth token. - Removed redundant console.error calls to streamline output.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Improves the first-run experience
Friendlier first-run output
decodo setup— instead of a bare error that reads like a broken install.No-sudo install fallback
install.shnow checks write permission before installing and falls back to a user-level install in~/.npm-global(with PATH instructions) when the global dir isn't writable — no more raw npm EACCES dump.npm bin -g(removed in npm 9).