{"id":26140940,"url":"https://github.com/patrick204nqh/patcmd","last_synced_at":"2025-04-14T01:13:52.352Z","repository":{"id":266595586,"uuid":"898547473","full_name":"patrick204nqh/patcmd","owner":"patrick204nqh","description":"A CLI tool to manage tasks using a YAML configuration.","archived":false,"fork":false,"pushed_at":"2025-03-14T03:44:04.000Z","size":53,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-04-14T01:13:44.288Z","etag":null,"topics":["cli-tool","task-list","terminal"],"latest_commit_sha":null,"homepage":"https://www.rubydoc.info/gems/patcmd","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/patrick204nqh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-12-04T15:35:39.000Z","updated_at":"2025-03-14T03:42:24.000Z","dependencies_parsed_at":"2024-12-05T04:27:26.350Z","dependency_job_id":"29d09a0b-e928-4ebd-9176-bda1fce9aa51","html_url":"https://github.com/patrick204nqh/patcmd","commit_stats":null,"previous_names":["patrick204nqh/patcmd"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick204nqh%2Fpatcmd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick204nqh%2Fpatcmd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick204nqh%2Fpatcmd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/patrick204nqh%2Fpatcmd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/patrick204nqh","download_url":"https://codeload.github.com/patrick204nqh/patcmd/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248804825,"owners_count":21164135,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-tool","task-list","terminal"],"created_at":"2025-03-11T02:58:31.538Z","updated_at":"2025-04-14T01:13:52.344Z","avatar_url":"https://github.com/patrick204nqh.png","language":"Ruby","readme":"# Patcmd\n\n[![Gem Version](https://badge.fury.io/rb/patcmd.svg)](https://badge.fury.io/rb/patcmd)\n[![Build Status](https://github.com/patrick204nqh/patcmd/actions/workflows/ruby.yml/badge.svg)](https://github.com/patrick204nqh/patcmd/actions)\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n\nPatcmd is a Ruby gem that provides a command-line interface (CLI) for managing and executing tasks from a YAML configuration file. It helps centralize your terminal commands into one file, making it easy to trigger frequently used tasks with memorable aliases.\n\n## Features\n\n- **Centralized Task Management:** Store your commands and scripts in a single YAML configuration file.\n- **Preconfigured Default Task:** When initialized, the configuration file includes a default \"hello\" task that prints \"Hello World.\"\n- **Flexible Task Definitions:** Each task can have a command, arguments, environment variables, description, and group.\n- **Easy Command-Line Interface:** Use Thor to quickly add, list, and run tasks.\n\n## Installation\n\nAdd this line to your application's Gemfile:\n\n```ruby\ngem 'patcmd'\n```\n\nThen execute:\n\n```bash\nbundle install\n```\n\nOr install it yourself as:\n\n```bash\ngem install patcmd\n```\n\n## Usage\n\n### Initializing the Configuration File\n\nTo create the configuration file (located at `~/.patcmd/config.yml`), run:\n\n```bash\npatcmd init\n```\n\nThis command creates the file with a default task named **hello**. The default task is defined as follows:\n\n```yaml\n---\ntasks:\n  hello:\n    command: bash\n    args:\n    - \"-c\"\n    - '''echo \"$GREETING, $TARGET! Args: $ARG1, $ARG2\"'''\n    env:\n      GREETING: Hello\n      TARGET: World\n      ARG1: Foo\n      ARG2: Bar\n    description: Print Hello World with multiple arguments and environment variables\n    group: default\n```\n\n### Listing Tasks\n\nTo list all available tasks, run:\n\n```bash\npatcmd list\n```\n\n### Adding a Task with Multiple Arguments and Environment Variables\n\nYou can add custom tasks using the CLI. For example, to add a task called **complex** that demonstrates multiple arguments and environment variables, run:\n\n```bash\npatcmd add complex \\\n  --command \"bash\" \\\n  --args \"-c\" \"echo 'Value1: $VAL1, Value2: $VAL2, extra args: arg1 arg2'\" \\\n  --env VAL1=value1,VAL2=value2 \\\n  --description \"A complex task with many args and env variables\" \\\n  --group custom\n```\n\n*Note:* The `--env` option is expected to be passed as a hash. Adjust the input format as needed based on your CLI parsing.\n\n### Running a Task\n\nTo execute a task, for example the default **hello** task, run:\n\n```bash\npatcmd exec hello\n```\n\nThis command executes the task, applying the defined environment variables and arguments.\n\n## Contributing\n\nBug reports and pull requests are welcome on GitHub at [https://github.com/patrick204nqh/patcmd](https://github.com/patrick204nqh/patcmd).\n\n## License\n\nThe gem is available as open source under the terms of the [MIT License](LICENSE.txt).\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrick204nqh%2Fpatcmd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpatrick204nqh%2Fpatcmd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpatrick204nqh%2Fpatcmd/lists"}