{"id":29996775,"url":"https://github.com/drexed/cmdx","last_synced_at":"2026-01-20T17:55:04.443Z","repository":{"id":302702811,"uuid":"942185974","full_name":"drexed/cmdx","owner":"drexed","description":"Command (aka service) objects with intent","archived":false,"fork":false,"pushed_at":"2025-08-04T21:55:31.000Z","size":1264,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-05T00:12:40.072Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/drexed.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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,"zenodo":null}},"created_at":"2025-03-03T17:58:30.000Z","updated_at":"2025-07-21T17:24:33.000Z","dependencies_parsed_at":"2025-07-03T19:53:52.146Z","dependency_job_id":"9728fba9-0977-4584-acc3-1f4ab1c0e97d","html_url":"https://github.com/drexed/cmdx","commit_stats":null,"previous_names":["drexed/cmdx"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/drexed/cmdx","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drexed%2Fcmdx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drexed%2Fcmdx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drexed%2Fcmdx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drexed%2Fcmdx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/drexed","download_url":"https://codeload.github.com/drexed/cmdx/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/drexed%2Fcmdx/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268814690,"owners_count":24311550,"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","status":"online","status_checked_at":"2025-08-04T02:00:09.867Z","response_time":79,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2025-08-05T02:56:03.493Z","updated_at":"2026-01-20T17:55:04.424Z","avatar_url":"https://github.com/drexed.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n  \u003cimg src=\"./src/cmdx-light-logo.png#gh-light-mode-only\" width=\"200\" alt=\"CMDx Light Logo\"\u003e\n  \u003cimg src=\"./src/cmdx-dark-logo.png#gh-dark-mode-only\" width=\"200\" alt=\"CMDx Dark Logo\"\u003e\n\n  ---\n\n  Build business logic that’s powerful, predictable, and maintainable.\n\n  [Home](https://drexed.github.io/cmdx) ·\n  [Documentation](https://drexed.github.io/cmdx/getting_started) ·\n  [Blog](https://drexed.github.io/cmdx/blog) ·\n  [Changelog](./CHANGELOG.md) ·\n  [Report Bug](https://github.com/drexed/cmdx/issues) ·\n  [Request Feature](https://github.com/drexed/cmdx/issues) ·\n  [llms.txt](https://drexed.github.io/cmdx/llms.txt) ·\n  [llms-full.txt](https://drexed.github.io/cmdx/llms-full.txt)\n\n  \u003cimg alt=\"Version\" src=\"https://img.shields.io/gem/v/cmdx\"\u003e\n  \u003cimg alt=\"Build\" src=\"https://github.com/drexed/cmdx/actions/workflows/ci.yml/badge.svg\"\u003e\n  \u003cimg alt=\"License\" src=\"https://img.shields.io/badge/license-LGPL%20v3-blue.svg\"\u003e\n\u003c/div\u003e\n\n# CMDx\n\nSay goodbye to messy service objects. CMDx helps you design business logic with clarity and consistency—build faster, debug easier, and ship with confidence.\n\n\u003e [!NOTE]\n\u003e [Documentation](https://drexed.github.io/cmdx/getting_started/) reflects the latest code on `main`. For version-specific documentation, please refer to the `docs/` directory within that version's tag.\n\n## Requirements\n\n- Ruby: MRI 3.1+ or JRuby 9.4+\n- Dependencies: None\n\nRails support is built-in, but it's framework-agnostic at its core.\n\n## Installation\n\n```sh\ngem install cmdx\n# - or -\nbundle add cmdx\n```\n\n## Quick Example\n\nBuild powerful business logic in four simple steps:\n\n### 1. Compose\n\n```ruby\n# Full-featured task example\n# See docs for minimum viable task examples\n\nclass AnalyzeMetrics \u003c CMDx::Task\n  register :middleware, CMDx::Middlewares::Correlate, id: -\u003e { Current.request_id }\n\n  on_success :track_analysis_completion!\n\n  required :dataset_id, type: :integer, numeric: { min: 1 }\n  optional :analysis_type, default: \"standard\"\n\n  def work\n    if dataset.nil?\n      fail!(\"Dataset not found\", code: 404)\n    elsif dataset.unprocessed?\n      skip!(\"Dataset not ready for analysis\")\n    else\n      context.result = PValueAnalyzer.execute(dataset:, analysis_type:)\n      context.analyzed_at = Time.now\n\n      SendAnalyzedEmail.execute(user_id: Current.account.manager_id)\n    end\n  end\n\n  private\n\n  def dataset\n    @dataset ||= Dataset.find_by(id: dataset_id)\n  end\n\n  def track_analysis_completion!\n    dataset.update!(analysis_result_id: context.result.id)\n  end\nend\n```\n\n### 2. Execute\n\n```ruby\nresult = AnalyzeMetrics.execute(\n  dataset_id: 123,\n  \"analysis_type\" =\u003e \"advanced\"\n)\n```\n\n### 3. React\n\n```ruby\nif result.success?\n  puts \"Metrics analyzed at #{result.context.analyzed_at}\"\nelsif result.skipped?\n  puts \"Skipping analyzation due to: #{result.reason}\"\nelsif result.failed?\n  puts \"Analyzation failed due to: #{result.reason} with code #{result.metadata[:code]}\"\nend\n```\n\n### 4. Observe\n\n```log\nI, [2022-07-17T18:42:37.000000 #3784] INFO -- CMDx:\nindex=1 chain_id=\"018c2b95-23j4-2kj3-32kj-3n4jk3n4jknf\" type=\"Task\" class=\"SendAnalyzedEmail\" state=\"complete\" status=\"success\" metadata={runtime: 347}\n\nI, [2022-07-17T18:43:15.000000 #3784] INFO -- CMDx:\nindex=0 chain_id=\"018c2b95-b764-7615-a924-cc5b910ed1e5\" type=\"Task\" class=\"AnalyzeMetrics\" state=\"complete\" status=\"success\" metadata={runtime: 187}\n```\n\nReady to dive in? Check out the [Getting Started](https://drexed.github.io/cmdx/getting_started/) guide to learn more.\n\n## Ecosystem\n\n- [cmdx-rspec](https://github.com/drexed/cmdx-rspec) - RSpec test matchers\n\nFor backwards compatibility of certain functionality:\n\n- [cmdx-i18n](https://github.com/drexed/cmdx-i18n) - 85+ translations, `v1.5.0` - `v1.6.2`\n- [cmdx-parallel](https://github.com/drexed/cmdx-parallel) - Parallel workflow tasks, `v1.6.1` - `v1.6.2`\n\n## Contributing\n\nBug reports and pull requests are welcome at \u003chttps://github.com/drexed/cmdx\u003e. We're committed to fostering a welcoming, collaborative community. Please follow our [code of conduct](CODE_OF_CONDUCT.md).\n\n## License\n\nThe gem is available as open source under the terms of the [LGPLv3 License](https://www.gnu.org/licenses/lgpl-3.0.html).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrexed%2Fcmdx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdrexed%2Fcmdx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdrexed%2Fcmdx/lists"}