fix(js): accept positional CLI URL arguments#69
Conversation
Adding .gitkeep for PR creation (default mode). This file will be removed when the task is complete. Issue: #68
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:Total: (11.7K + 2.6K cached) input tokens, 71 output tokens 🤖 Models used:
📎 Log file uploaded as Gist (363KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
This reverts commit 0daae18.
|
🤖 AI Work Session Started Starting automated work session at 2026-04-16T06:33:50.534Z The PR has been converted to draft mode while work is in progress. This comment marks the beginning of an AI work session. Please wait for the session to finish, and provide your feedback. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
📊 Context and tokens usage:Total: (120.8K + 7.2M cached) input tokens, 25.5K output tokens 🤖 Models used:
📎 Log file uploaded as Repository (30663KB)Now working session is ended, feel free to review and add any feedback on the solution draft. |
✅ Ready to mergeThis pull request is now ready to be merged:
Monitored by hive-mind with --auto-restart-until-mergeable flag |
Summary
Fixes #68.
The JavaScript CLI now accepts capture URLs as positional arguments while keeping yargs strict option validation enabled.
Root Cause
js/bin/web-capture.jsenabled.strict()without declaring the URL positional argument. yargs rejectedweb-capture https://example.comas an unknown argument beforemain()could run. The code also looked forconfig._[0], butlino-argumentsdrops yargs'_array from the returned config object, so separator-based inputs like-- https://example.comcould not be recovered there either.Changes
$0 [url]so strict mode accepts the URL positional.config.urlfield and added a narrow fallback for URLs passed after the--separator.--output/-owithnargs: 1so documented stdout output forms like--output -keep working under strict mode.--separator URLs, unknown-option rejection, and immediate invalid-URL validation.Reproduction and Regression Coverage
Before this fix, the new CLI tests failed for both:
After the fix, both forms capture content successfully, and strict mode still rejects unknown options.
Verification
npm test -- tests/unit/cli.test.jspasses.npm test -- tests/unitpasses: 207 tests.npm test -- --testPathIgnorePatterns="docker.test.js"passes: 245 tests, 16 skipped live Habr tests.npm run lintpasses with existing warnings only.npm run format:checkpasses.npm run check:duplicationpasses.node scripts/validate-changeset.mjspasses.--capture api --archive zip -- URLproduced a non-empty ZIP.Docker-specific tests were not run locally because Docker is not installed in this environment.