Skip to content

feat: productionize PageStack CLI with config, dry-run, verbose logs, and Docker/Compose workflow#1

Open
ganeshwhere wants to merge 1 commit into
arpitbbhayani:masterfrom
ganeshwhere:pagestack-cli-docker
Open

feat: productionize PageStack CLI with config, dry-run, verbose logs, and Docker/Compose workflow#1
ganeshwhere wants to merge 1 commit into
arpitbbhayani:masterfrom
ganeshwhere:pagestack-cli-docker

Conversation

@ganeshwhere
Copy link
Copy Markdown

Summary

This PR evolves PageStack from a single-script utility into a production-ready CLI with modular architecture, better developer experience, and containerized workflows.

What changed

  • Refactored monolithic implementation into modules:
    • cli.py, config.py, fetcher.py, epub_builder.py, url_utils.py, logging_utils.py, ui.py
  • Kept backward compatibility with old usage:
    • pagestack urls.txt
    • pagestack urls.txt output.epub
    • python src/pagestack/main.py ...
  • Added CLI improvements:
    • progress bar with tqdm
    • colored terminal output with rich (with plain fallback)
    • --verbose detailed logs
    • --dry-run URL validation and inclusion preview without EPUB generation
    • --config YAML defaults for title/author/output/timeout/retries
    • improved error handling and final run summary
  • Added containerized DX:
    • Dockerfile, .dockerignore, docker-compose.yml
    • Make targets for docker/compose workflows
    • recommended aliases: make best-build, make best-dry-run, make best
    • CA bundle passthrough support via REQUESTS_CA_BUNDLE / SSL_CERT_FILE
  • Updated docs and examples:
    • expanded README.md
    • added examples/config.yaml
    • added examples/urls-smoke.txt
  • Packaging/dependency updates:
    • added PyYAML, rich, tqdm
    • pinned chardet<6 to avoid requests warning noise
  • Added *.epub to .gitignore

Backward compatibility

No breaking CLI behavior for existing users. New features are additive.

Validation performed

  • python3 -m compileall src
  • make dry-run
  • make best-dry-run
  • make best OUTPUT=smoke.epub URLS=examples/urls-smoke.txt
  • make compose-build
  • make docker-build
  • make docker-dry-run

Notes

In corporate/proxy TLS environments, set:

  • REQUESTS_CA_BUNDLE
  • SSL_CERT_FILE
    before docker/compose runs.

…r workflow

Refactor the old monolithic script into focused modules (cli, config, fetcher, epub_builder, url_utils, logging_utils, ui) while preserving backward compatibility.

Add modern CLI behavior:
- progress bar during URL processing (tqdm)
- colored terminal output and spinner (rich with fallback)
- --verbose detailed logs
- --dry-run validation/preview mode
- --config YAML defaults
- retries/timeout controls and improved error handling
- final execution summary (processed, failed, output, elapsed)

Keep legacy usage working:
- pagestack urls.txt [output.epub]
- python src/pagestack/main.py ...

Add containerized DX:
- Dockerfile and .dockerignore
- docker-compose service
- Makefile shortcuts including recommended best/best-dry-run/best-build aliases
- CA bundle passthrough for corporate/proxy environments

Update docs/examples and packaging:
- README with old + new usage
- examples/config.yaml
- dependency updates (rich, tqdm, PyYAML, chardet<6)
- ignore generated .epub artifacts.
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.

1 participant