-
Notifications
You must be signed in to change notification settings - Fork 0
feat: add CLI support for local command and server mode #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Adding CLAUDE.md with task information for AI processing. This file will be removed when the task is complete. Issue: #19
- Add bin/web-capture.js CLI entry point supporting two modes: - Server mode: `web-capture --serve` starts HTTP API server - Capture mode: `web-capture <url>` captures URL to file/stdout - CLI options: --format (html/markdown/png), --output, --engine, --port - Add unit tests for CLI argument parsing and help/version commands - Update README with CLI usage documentation and examples - Bump version to 1.1.0 Fixes #19 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
🔄 Auto-restart 1/3Detected uncommitted changes from previous run. Starting new session to review and commit them. Uncommitted files: Auto-restart will stop after changes are committed or after 2 more iterations. Please wait until working session will end and give your feedback. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
Please use https://github.com/link-foundation/lino-arguments pattern for arguments and configuration |
|
🤖 AI Work Session Started Starting automated work session at 2025-12-09T05:28:34.064Z 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 working session to finish, and provide your feedback. |
- Install lino-arguments package for unified configuration management - Create .lenv file with default configuration (PORT, BROWSER_ENGINE) - Refactor bin/web-capture.js to use makeConfig from lino-arguments - Replace custom argument parsing with yargs-based configuration - Update CLI tests to work with new yargs output format - Add configuration documentation to README with priority chain Configuration priority (highest to lowest): 1. CLI arguments (--port 8080) 2. Environment variables (PORT=8080) 3. Custom .lenv file (--configuration path/to/custom.lenv) 4. Default .lenv file 5. Built-in defaults 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
|
Also make sure our Dockerfile and other files use new |
|
🤖 AI Work Session Started Starting automated work session at 2025-12-11T00:18:38.313Z 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 working session to finish, and provide your feedback. |
Updated all references from direct node execution to use the new web-capture CLI command for consistency and better user experience. Changes: - Dockerfile: Changed ENTRYPOINT from "node src/index.js" to "node bin/web-capture.js --serve" - package.json: Updated dev script to use CLI command with nodemon - tests/e2e/process.test.js: Updated to spawn CLI command instead of direct node execution - ARCHITECTURE.md: Updated documentation to reflect new CLI usage in Dockerfile example This ensures the Dockerfile and all related files use the new unified CLI interface as requested in PR feedback. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
✅ Updated to use new CLI commandI've updated all files to use the new Changes Made
Testing
All files now consistently use the new unified CLI interface. The PR is ready for review. |
🤖 Solution Draft LogThis log file contains the complete execution trace of the AI solution draft process. 💰 Cost estimation:
Now working session is ended, feel free to review and add any feedback on the solution draft. |
Summary
This PR implements CLI support for web-capture, allowing it to work both as a local command for AI agents and as an HTTP API server. The implementation uses the lino-arguments pattern for unified configuration management.
Key Features
web-capture --servestarts the HTTP API serverweb-capture <url>captures a URL to file or stdout--format,--output,--engine,--port,--configurationImplementation Details
New Files
bin/web-capture.js- CLI entry point using lino-arguments pattern.lenv- Default configuration file with PORT and BROWSER_ENGINE settingstests/unit/cli.test.js- Unit tests for CLI functionalityModified Files
package.json- Addedbinfield for CLI, added lino-arguments dependency, bumped version to 1.1.0README.md- Added CLI usage documentation, configuration section, and examplesConfiguration System
Uses lino-arguments with the following priority chain (highest to lowest):
--port 8080PORT=8080--configuration path/to/custom.lenv.lenvin project root.lenv File Format
CLI Usage
Server Mode
Capture Mode
All Options
Testing
All CLI tests pass (15 tests):
--helpand-hflags--versionand-vflagsUnit tests verify the CLI argument parsing and help output work correctly with the lino-arguments/yargs integration.
Fixes
Fixes #19
🤖 Generated with Claude Code