{"id":20704174,"url":"https://github.com/solidsnack/confit","last_synced_at":"2026-04-27T04:31:31.341Z","repository":{"id":27318044,"uuid":"30792355","full_name":"solidsnack/confit","owner":"solidsnack","description":"An object-oriented DSL for system automation","archived":false,"fork":false,"pushed_at":"2015-05-19T08:06:29.000Z","size":204,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-12-26T16:37:39.291Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/solidsnack.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-02-14T09:24:19.000Z","updated_at":"2015-03-25T18:03:57.000Z","dependencies_parsed_at":"2022-09-01T02:22:21.196Z","dependency_job_id":null,"html_url":"https://github.com/solidsnack/confit","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/solidsnack/confit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidsnack%2Fconfit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidsnack%2Fconfit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidsnack%2Fconfit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidsnack%2Fconfit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/solidsnack","download_url":"https://codeload.github.com/solidsnack/confit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/solidsnack%2Fconfit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32323211,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-26T23:26:28.701Z","status":"online","status_checked_at":"2026-04-27T02:00:06.769Z","response_time":128,"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":"2024-11-17T01:11:17.140Z","updated_at":"2026-04-27T04:31:31.328Z","avatar_url":"https://github.com/solidsnack.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"---------------\nGetting Started\n---------------\n\n* Install\n\n.. code-block:: bash\n\n    pip install https://github.com/solidsnack/confit/archive/master.zip\n\n* Write a class that subclasses ``Task``\n\n.. code-block:: python\n\n    from confit import cc\n\n    class SolidsnackDots(cc.Task):\n        \"\"\"Install solidsnack's dotfiles.\"\"\"\n\n        def code(self):\n            return \"\"\"\n                cd ~\n                git clone https://github.com/solidsnack/dots.git\n                cd dots\n                make install\n            \"\"\"\n\n* Call ``.script()`` to generate a Bash script, to run locally or remotely, or\n  ``.run()`` to run the task directly.\n\n.. code-block:: python\n\n    dots = SolidsnackDots()\n    dots.run()\n\n\n---------------------------\nUsing Wrappers and Subtasks\n---------------------------\n\nConfit supports a notion of \"wrappers\" or \"task transformers\". For example,\nrunning a task as root, or running it in a certain directory.\n\n.. code-block:: python\n\n    #!/usr/bin/env python\n\n    from confit import cc\n\n\n    class GitCheckout(cc.Task):\n        def __init__(self, repo, target=None):\n            self.repo = repo\n            self.target = target\n\n        def code(self):\n            if self.target is not None:\n                argv = ['git', 'clone', self.repo, self.target]\n            else:\n                argv = ['git', 'clone', self.repo]\n            return [argv]\n            # When code is arrays of arrays, all values will be automatically\n            # shell escaped, using ``pipes.quote()``.\n\n\n    class SolidsnackDots(cc.Task):\n        def deps(self):\n            url = 'https://github.com/solidsnack/dots.git'\n            return [\n                cc.CD('~')(\n                    GitCheckout(url, 'dots'),\n                    cc.CD('dots')(\n                        cc.Bash([['make', 'install']])\n                    )\n                )\n            ]\n\n\n    print SolidsnackDots().script()\n\nYou should expect the generated code to be in general quite readable:\n\n.. code-block:: bash\n\n    #!/bin/bash\n    set -o errexit -o nounset -o pipefail\n\n    export LC_ALL=en_US.UTF-8\n\n    function GitCheckout//4dfbe151486ae2d6 {\n      [[ ${_4dfbe151486ae2d6+_} ]] \u0026\u0026 return || _4dfbe151486ae2d6=_ # only once\n      git clone https://github.com/solidsnack/dots.git dots\n    }\n\n    function SolidsnackDots//5386fae40f7eb977 {\n      [[ ${_5386fae40f7eb977+_} ]] \u0026\u0026 return || _5386fae40f7eb977=_ # only once\n      SolidsnackDots//5386fae40f7eb977//pre\n      : # Do nothing.\n    }\n    function SolidsnackDots//5386fae40f7eb977//pre {\n      confit.CD//78108f633935aefe\n    }\n\n    function confit.Bash//1897a59a84b95fee {\n      make install\n    }\n\n    function confit.CD//2f09153924b83023 {\n      ( set -o errexit -o nounset -o pipefail\n        cd dots\n        confit.CD//2f09153924b83023//inner\n      )\n    }\n    function confit.CD//2f09153924b83023//inner {\n      confit.Bash//1897a59a84b95fee\n    }\n\n    function confit.CD//78108f633935aefe {\n      ( set -o errexit -o nounset -o pipefail\n        cd ~\n        confit.CD//78108f633935aefe//inner\n      )\n    }\n    function confit.CD//78108f633935aefe//inner {\n      GitCheckout//4dfbe151486ae2d6\n      confit.CD//2f09153924b83023\n    }\n\n\n\n    SolidsnackDots//5386fae40f7eb977\n\nThe names of the generated bash functions are derived from the qualified names\nof the task classes, with a hash appended. The hash depends on the arguments\npassed to the class and any transformers applied -- it should remain the same\nfrom run to run.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidsnack%2Fconfit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsolidsnack%2Fconfit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsolidsnack%2Fconfit/lists"}