Skip to content

Friendlier first-run output and no-sudo install fallback#29

Merged
paulius-krutkis-dcd merged 6 commits into
fix/audit-followupsfrom
friendlier-first-run-output
Jun 11, 2026
Merged

Friendlier first-run output and no-sudo install fallback#29
paulius-krutkis-dcd merged 6 commits into
fix/audit-followupsfrom
friendlier-first-run-output

Conversation

@paulius-krutkis-dcd

@paulius-krutkis-dcd paulius-krutkis-dcd commented Jun 10, 2026

Copy link
Copy Markdown
Collaborator

Improves the first-run experience

Friendlier first-run output

  • Running a command without a token now shows a short onboarding message confirming the CLI is installed and working, with steps to get a token and run decodo setup — instead of a bare error that reads like a broken install.
  • Invalid tokens still get the concise hint.

No-sudo install fallback

  • install.sh now 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.
  • Fixed the PATH check that used npm bin -g (removed in npm 9).

- 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.
@paulius-krutkis-dcd paulius-krutkis-dcd changed the title Enhance install.sh for improved package installation and error handling Friendlier first-run output and no-sudo install fallback Jun 10, 2026
@paulius-krutkis-dcd paulius-krutkis-dcd changed the base branch from main to fix/audit-followups June 10, 2026 10:13
…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.

if (err instanceof AuthRequiredError || err instanceof AuthenticationError) {
if (err instanceof AuthRequiredError) {
console.error("");

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you use a single console.error, just format message with \n or smth?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, updated

Comment thread src/scrape/services/auth-validation.ts
- Consolidated error messages for AuthRequiredError to provide clearer guidance on obtaining and setting the auth token.
- Removed redundant console.error calls to streamline output.
@paulius-krutkis-dcd paulius-krutkis-dcd merged commit d96472c into fix/audit-followups Jun 11, 2026
1 check passed
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants