Skip to content

Conversation

Copy link
Contributor

Copilot AI commented Sep 17, 2025

This PR implements a complete command line version of the text-cleanup tool with Docker containerization support, addressing the need for automated text processing workflows and server deployments.

Key Features Added

Command Line Interface

  • Full CLI tool (bin/text-cleanup) with comprehensive argument parsing
  • Multiple input/output modes: stdin/stdout, file-to-file, and in-place editing
  • Unix-style integration: Works seamlessly with pipes and automation scripts
  • Proper error handling with meaningful messages and exit codes

Modular Architecture

  • Extracted core logic into reusable Node.js module (lib/text-cleaner.js)
  • Shared functionality between web app and CLI versions
  • Clean separation of concerns for maintainability

Docker Support

  • Lightweight Alpine-based container for easy deployment
  • Security best practices with non-root user execution
  • Proper stdin/stdout handling for containerized text processing
  • Ready for CI/CD pipelines and server deployments

Usage Examples

# Clean text from stdin
echo "**Bold** text with 'smart quotes'" | text-cleanup

# Process files
text-cleanup input.txt output.txt

# In-place editing  
text-cleanup --in-place document.txt

# Docker usage
echo "Messy text" | docker run --rm -i text-cleanup-cli

Technical Implementation

The implementation maintains 100% compatibility with the existing web application while adding powerful automation capabilities. The shared text cleaning logic ensures consistent behavior across both interfaces.

Package Updates:

  • Added CLI executable entry in package.json
  • Updated project metadata and file inclusions
  • Enhanced documentation with comprehensive usage examples

Testing:
All functionality has been thoroughly tested including CLI operations, Docker containerization, and Node.js module integration.

Fixes #2.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copy link
Contributor Author

Copilot AI commented Sep 17, 2025

@mopx 👋 This repository doesn't have Copilot instructions. With Copilot instructions, I can understand the repository better, work faster and produce higher quality PRs.

I can generate a .github/copilot-instructions.md file for you automatically. Click here to open a pre-filled issue and assign it to me. I'll write the instructions, and then tag you for review.

…documentation

Co-authored-by: mopx <12272+mopx@users.noreply.github.com>
Copilot AI changed the title [WIP] create command line version Add command line interface and Docker support for text cleanup functionality Sep 17, 2025
Copilot AI requested a review from mopx September 17, 2025 16:53
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.

create command line version

2 participants