Skip to content

feat(cli): Implement Command-Line Interface and Release Workflow#12

Merged
TKanX merged 21 commits intomainfrom
feature/11-implement-a-user-facing-command-line-interface-cli
Oct 25, 2025
Merged

feat(cli): Implement Command-Line Interface and Release Workflow#12
TKanX merged 21 commits intomainfrom
feature/11-implement-a-user-facing-command-line-interface-cli

Conversation

@TKanX
Copy link
Copy Markdown
Member

@TKanX TKanX commented Oct 25, 2025

Summary:

Introduces a full-featured Command-Line Interface (CLI) for the cheq library, transforming it into a standalone tool for end-users. The CLI, built using clap, provides a robust and user-friendly way to perform QEq calculations directly from the terminal. It supports various input/output formats, custom parameters, and solver configurations. To support this new functionality, a multi-platform GitHub Actions release workflow has been implemented to automatically build and package binaries for Linux, macOS, and Windows upon the creation of a new release tag.

Changes:

  • Implemented a Feature-Rich CLI:

    • Created a new binary target ([[bin]]) with a modular structure (app, cli, io, error).
    • Used clap to build a powerful and self-documenting argument parser with clear help messages and option groups.
    • Supports reading molecular geometries from XYZ files or standard input (stdin).
    • Implemented multiple output formats (--format), including a human-readable table (pretty), charged XYZ, CSV, and machine-readable JSON.
    • Added options to specify a custom TOML parameter file, total molecular charge, and fine-tune all solver settings (tolerance, max-iterations).
    • Integrated indicatif to provide a user-friendly progress spinner during calculations.
  • Developed a Robust I/O Module:

    • Implemented a resilient XYZ parser that handles both element symbols and atomic numbers, providing clear error messages for malformed files.
    • Created a flexible output writer that directs results to standard output or a specified file and handles different formatting requirements (pretty-table, csv, etc.).
  • Established a Multi-Platform Release Workflow:

    • Added a new GitHub Actions workflow (release.yml) that triggers on the "published" release event.
    • The workflow builds and tests the CLI binary across multiple targets:
      • Linux (x86_64, aarch64)
      • macOS (x86_64, aarch64)
      • Windows (x86_64)
    • After a successful build, the workflow packages the binary along with LICENSE and README.md into a .tar.gz or .zip archive and automatically uploads it as a release asset.
  • Added CLI User Documentation:

    • Created a USAGE.md file serving as a comprehensive user manual for the CLI, detailing all arguments, input formats, and practical examples.
    • Updated README.md to highlight the new CLI functionality and provide installation instructions.

TKanX added 21 commits October 23, 2025 16:46
@TKanX TKanX self-assigned this Oct 25, 2025
Copilot AI review requested due to automatic review settings October 25, 2025 02:08
@TKanX TKanX added the documentation 📖 Improvements or additions to documentation label Oct 25, 2025
@TKanX TKanX linked an issue Oct 25, 2025 that may be closed by this pull request
52 tasks
@TKanX TKanX added the enhancement ✨ New feature or request label Oct 25, 2025
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR transforms the cheq library into a dual-purpose package by adding a full-featured command-line interface alongside the existing library API. The CLI enables users to perform QEq charge equilibration calculations directly from the terminal with support for multiple input/output formats and configurable solver parameters. A GitHub Actions workflow automates the release process by building and packaging binaries for five different platforms (Linux x86_64/aarch64, macOS x86_64/aarch64, Windows x86_64).

Key Changes:

  • Added a CLI binary with argument parsing (clap), progress indicators (indicatif), and multiple output formats (pretty tables, XYZ, CSV, JSON)
  • Created comprehensive user documentation in USAGE.md covering CLI usage, parameter files, and practical examples
  • Implemented a multi-platform GitHub Actions release workflow that builds, tests, and uploads binary artifacts for Linux, macOS, and Windows

Reviewed Changes

Copilot reviewed 4 out of 9 changed files in this pull request and generated no comments.

File Description
USAGE.md New comprehensive CLI user manual documenting all command-line arguments, input formats, parameter files, and usage examples
README.md Updated to document both CLI and library usage, including installation instructions for both use cases
Cargo.toml Added CLI dependencies (clap, prettytable-rs, indicatif) as optional features, bumped version to 0.2.0, and added binary target configuration
.github/workflows/release.yml New GitHub Actions workflow that builds CLI binaries for multiple platforms and uploads them as release assets

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@TKanX
Copy link
Copy Markdown
Member Author

TKanX commented Oct 25, 2025

@ghutchis Thank you so much for your suggestion, I have implemented it.

@TKanX TKanX merged commit bd662f1 into main Oct 25, 2025
2 checks passed
@TKanX TKanX deleted the feature/11-implement-a-user-facing-command-line-interface-cli branch October 25, 2025 02:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation 📖 Improvements or additions to documentation enhancement ✨ New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Implement a User-Facing Command-Line Interface (CLI)

2 participants