PatCmd

Gem Version Build Status License: MIT

PatCmd is a Ruby-based command-line interface (CLI) tool built with Thor, designed to manage and execute tasks efficiently. Whether you're automating scripts, managing deployments, or handling routine operations, PatCmd provides a streamlined and customizable solution.

Features

  • Task Management: Easily add, list, and execute tasks.
  • Configurable Environments: Define environment variables per task.
  • Extensible: Add new commands and functionalities as needed.
  • User-Friendly: Intuitive CLI with clear help documentation.

Installation

Ensure you have Ruby (version 3.0 or higher) installed on your system.

Install via RubyGems

gem install patcmd

From Source

  1. Clone the Repository:
git clone https://github.com/yourusername/patcmd.git
cd patcmd
  1. Build the Gem:
gem build patcmd.gemspec
  1. Install the Gem Locally:
gem install ./patcmd-0.1.0.gem

Usage

After installation, you can use patcmd directly from your terminal.

Initialize Configuration

Initialize the PatCmd configuration file. This creates a default configuration file where tasks are stored.

patcmd init

Example Output:

Configuration initialized at /home/username/.patcmd/config.yml

Add a New Task

patcmd add \                   
  --name "Backup" \
  --description "Backup the database" \
  --category "Utility" \
  --path "/usr/local/bin" \
  --action "execute" \
  --command "backup_db" \
  --args db1 db2 \
  --environments NOdE

List All Tasks

Display all configured tasks.

patcmd list

Execute a Task

patcmd exec Utility Backup execute

Help

Access help information for all commands or a specific command.

patcmd help
patcmd help add
patcmd help list

Configuration

PatCmd uses a YAML configuration file to store tasks and settings. The default configuration file is located at ~/.patcmd/config.yml. You can specify a different configuration file using the --config option.

Example:

patcmd list --config=/path/to/custom_config.yml