Fix critical audit issues and improve install PATH setup#36
Merged
paulius-krutkis-dcd merged 3 commits intoJun 17, 2026
Conversation
- Object/array schema params now register as --flag <json> with a JSON-parsing argParser; invalid JSON is a usage error - Derive binary PNG output context from the built body so generated commands (universal --headless png) write a PNG, not base64 text - Map syscall-coded network failures (ENOTFOUND, ECONNREFUSED, ...) in the cause chain to exit 7 and render the cause - setup now rejects as a usage error on EOF/closed stdin instead of exiting 0 having saved nothing; handle TTY EOF and Ctrl+D - Add offline README docs regression test validating documented commands and flags against the command tree built from BundledSchema
Manual end-to-end testing surfaced that generated commands routed PNG output correctly but applyRequestDefaults still injected markdown:true, so the API returned markdown instead of a screenshot and PNG extraction failed. Skip the defaults when headless is png so universal --headless png writes a real PNG, matching the curated screenshot command.
ChinchillaLover9000
approved these changes
Jun 16, 2026
- Moved CliUsageError definition to a new file for better organization. - Updated imports across multiple files to reference the new location of CliUsageError. - Added tests for CliUsageError to ensure proper functionality and error message handling.
domantas-jurkus-dcd
approved these changes
Jun 17, 2026
paulius-krutkis-dcd
added a commit
that referenced
this pull request
Jun 17, 2026
* Update version to 0.1.7 in package.json, enhance installation scripts for better PATH management, and improve README instructions for setup. The install scripts now auto-configure the user's PATH and provide clearer next steps after installation. * Refactor install.sh to enhance output formatting for next steps. Updated printf statements to use consistent syntax for better readability and maintainability. * Fix output formatting in install.ps1 for next steps command. Updated string interpolation for improved clarity in user instructions. * Fix critical audit issues and improve install PATH setup (#36) * Fix remaining critical CLI audit items - Object/array schema params now register as --flag <json> with a JSON-parsing argParser; invalid JSON is a usage error - Derive binary PNG output context from the built body so generated commands (universal --headless png) write a PNG, not base64 text - Map syscall-coded network failures (ENOTFOUND, ECONNREFUSED, ...) in the cause chain to exit 7 and render the cause - setup now rejects as a usage error on EOF/closed stdin instead of exiting 0 having saved nothing; handle TTY EOF and Ctrl+D - Add offline README docs regression test validating documented commands and flags against the command tree built from BundledSchema * Skip parse/markdown defaults for headless png screenshots Manual end-to-end testing surfaced that generated commands routed PNG output correctly but applyRequestDefaults still injected markdown:true, so the API returned markdown instead of a screenshot and PNG extraction failed. Skip the defaults when headless is png so universal --headless png writes a real PNG, matching the curated screenshot command. * Refactor CLI error handling by introducing CliUsageError class - Moved CliUsageError definition to a new file for better organization. - Updated imports across multiple files to reference the new location of CliUsageError. - Added tests for CliUsageError to ensure proper functionality and error message handling.
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.
Summary
--headless png, network error exit codes (7), and EOF-safesetupwhen stdin is empty.parse/markdowndefaults for headless PNG requests so the API returns screenshot bytes instead of markdown.Test plan
pnpm test— all tests pass (includes README command validation and new audit regressions)decodo setup < /dev/null→ exit 2; valid token on stdin still worksdecodo universal --headers not-json→ exit 2; valid JSON is parsed into the request bodydecodo universal --headless png <url> --token …→ writes a valid PNG file, not base64 or markdown