{"id":15406785,"url":"https://github.com/dannyben/rigit","last_synced_at":"2025-10-04T18:58:49.581Z","repository":{"id":56892258,"uuid":"121728721","full_name":"DannyBen/rigit","owner":"DannyBen","description":"Scaffolding that doesn't bite","archived":false,"fork":false,"pushed_at":"2025-08-01T15:39:55.000Z","size":316,"stargazers_count":4,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-15T09:59:40.426Z","etag":null,"topics":["gem","ruby","scaffolder","scaffolding"],"latest_commit_sha":null,"homepage":"http://dannyben.github.io/rigit","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/DannyBen.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"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":"2018-02-16T08:27:22.000Z","updated_at":"2025-08-01T15:39:58.000Z","dependencies_parsed_at":"2024-10-19T12:33:27.410Z","dependency_job_id":"b1cc5997-1b01-4dcd-8a7c-b231f3351f34","html_url":"https://github.com/DannyBen/rigit","commit_stats":{"total_commits":153,"total_committers":3,"mean_commits":51.0,"dds":"0.20915032679738566","last_synced_commit":"b57c40724ab97ec56246f566526e0c20242747cd"},"previous_names":[],"tags_count":16,"template":false,"template_full_name":null,"purl":"pkg:github/DannyBen/rigit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Frigit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Frigit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Frigit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Frigit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DannyBen","download_url":"https://codeload.github.com/DannyBen/rigit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DannyBen%2Frigit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":278358485,"owners_count":25973949,"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-10-04T02:00:05.491Z","response_time":63,"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":["gem","ruby","scaffolder","scaffolding"],"created_at":"2024-10-01T16:25:22.254Z","updated_at":"2025-10-04T18:58:49.521Z","avatar_url":"https://github.com/DannyBen.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"Rigit\n==================================================\n\nBuild project templates easily, and without the need to write code.\n\n![Rigit](rigit-header.png)\n\n---\n\nTable of Contents\n--------------------------------------------------\n\n* [Installation](#installation)\n* [Key Features](#key-features)\n* [Usage](#usage)\n* [Quick Start](#quick-start)\n* [Installing Rigs](#installing-rigs)\n* [Using Rigs (Scaffolding)](#using-rigs-scaffolding)\n    * [Non-Interactive Execution](#non-interactive-execution)\n* [Creating Rigs](#creating-rigs)\n    * [Directory Structure](#directory-structure)\n    * [Dynamic Tokens](#dynamic-tokens)\n    * [Config File](#config-file)\n        * [Example config](#example-config)\n        * [Showing messages before/after scaffolding](#showing-messages-beforeafter-scaffolding)\n        * [Executing commands before/after scaffolding](#executing-commands-beforeafter-scaffolding)\n        * [Scaffolding parameters](#scaffolding-parameters)\n        * [Conditional parameters](#conditional-parameters)\n        * [Calculated parameters](#calculated-parameters)\n\nInstallation\n--------------------------------------------------\n\n    $ gem install rigit\n\n\n\nKey Features\n--------------------------------------------------\n\nRigit was designed to allow the rapid building of reusable project templates.\nIn Rigit, we call these templates \"rigs\".\n\n- No coding required.\n- Conventions-based [folder structure](#directory-structure).\n- A minimalistic [configuration file](#config-file) to allow specifying \n  needed parameters.\n- [String replacement](#dynamic-tokens) in file names and file contents.\n- [Install rigs](#installing-rigs) from any remote git repository.\n\n\n\nUsage\n--------------------------------------------------\n\n```\n$ rig\nUsage:\n  rig new NAME\n  rig build RIG [--force] [PARAMS...]\n  rig install RIG REPO\n  rig uninstall RIG\n  rig update RIG\n  rig info RIG\n  rig list [SUBFOLDER]\n  rig (-h|--help|--version)\n```\n\n\n\nQuick Start\n--------------------------------------------------\n\nAfter installing Rigit, you can follow these steps to quickly understand how\nit works, and how you can create your own rigs.\n\nFirst, create an empty folder:\n\n    $ mkdir myapp\n    $ cd muapp\n\nInstall your first rig. You can use this [example rig][example-rig].\n\n    $ rig install example https://github.com/DannyBen/example-rig.git\n\nNow that your rig is installed (in `~/.rigs`), you can use it.\n\n    $ rig build example\n\nInput all the answers, and you are done. Your project has been rigged.\n\n\n\nInstalling Rigs\n--------------------------------------------------\n\nRigs are installed in `~/.rigs` by default. You can change the installation\ndirectory by setting the `RIG_HOME` environment variable to your desired \npath.\n\nTo install a rig, simply use the `rig install` command, and supply a name \n(which will be the name of the rig in your local system) and a git URL (use \nthe same url as you would use in \"git clone\").\n\n    $ rig install example https://github.com/DannyBen/example-rig.git\n\n\n\nUsing Rigs (Scaffolding)\n--------------------------------------------------\n\nAfter you have one or more installed rigs, you can use them to create a new\nproject. Note that rigit works in the *current* directory, and will not \ncreate the project root directory for you.\n\n    $ mkdir myapp\n    $ cd myapp\n    $ rig build example\n\nMost rigs will have parameters, you will be prompted to input them as needed.\n\n\n### Non-Interactive Execution\n\nYou can also provide some (or all) of the parameters in the command line, \nif you need to avoid interactivity.\n\n    $ rig build example name=myapp spec=yes console=irb license=MIT\n\nTo learn about the parameters of a rig:\n\n    $ rig info example\n\n\n\nCreating Rigs\n--------------------------------------------------\n\n\u003e **Tip**: Take a look at the [example rig][example-rig] while reading \n\u003e this section.\n\nRigit's main design goal was to allow rapid and easy creation of new \ntemplates. There is no coding involved in creating a rig, and instead we \nare using folders with specific names, to allow for a sort of \"additive\" \nproject building.\n\nThe steps in creating a rig are:\n\n1. Start in a new, empty folder.\n2. Create a folder named `base`. Put all the files and folders of your \n   project inside.\n3. Rename files and folders as needed to include dynamic tokens.\n4. If you want to add some of the files only in specific cases (for example\n   only include a license file if the user wants to), you move the files to\n   a folder with s special `parameter=value` folder.\n5. Create a config file to specify the needed parameters.\n\nIn order to quickly get started with creating a new rig, you can also run \n`rig new your_new_rig_name`. This will create the initial folder structure\nand an initial `config.yml` for you to build on.\n\n\n### Directory Structure\n\nThere are two types of folders in a rig template.\n\n1. Base folder (`base`) - files and folders here will be copied always\n2. Conditional folders (`parameter=value`) - contents in these folders will\n   only be copied if the user answerd `value` to the question `parameter`.\n\nA typical rig folder looks like this:\n\n    myrig\n    |-- base\n    |   |-- files\n    |   `-- and-folders\n    |-- param=y\n    |   |-- files\n    |   `-- and-folders\n    |-- param=n\n    `-- config.yml\n\n\n### Dynamic Tokens\n\nYou can use variable replacements (tokens) in file names, folder names and in\nfile contents.\n\nEach token that you use, must also be declared in the config file.\n\nTokens are specified using this syntax: \n\n    %{name}\n\nIf you are using the \n[`before` and `after`](#showing-messages-beforeafter-scaffolding) \ndefinitions in your config file, you can use dynamic tokens in both the \nlabel and the command of each definition.\n\n\n### Config File\n\nPlace a `config.yml` file at the root of your rig template. A config file\nis optional for rigs that do not have any variables.\n\n\n#### Example config\n\nThe below config file example contains all the available options:\n\n```yaml\n# Optional messages to show before/after scaffolding\nintro: A sample generator\noutro: Something to say after scaffolding is done\n\n# Optional commands to execute before/after scaffolding\nbefore:\n  \"Create empty .env file\": \"touch .env\"\n\nafter:\n  \"Install Dependencies\": \"bundle install\"\n  \"Initialize git repo\": \"git init\"\n\n# If set to true, continue running even if the folder is not empty.\n# This has a similar effect to the --force command line flag.\nforce: false\n\n# Specify file patterns that should be copoied as is (without variable\n# replacements).\nbinaries:\n  - \"*.png\"\n  - \"*.pdf\"\n  - \"some-binary-file\"\n\n# Parameters to collect on scaffolding\nparams:\n  name:\n    prompt: \"Name your project:\"\n    type: text\n    default: project\n\n  console: \n    prompt: Include interactive console?\n    type: yesno\n    default: yes\n\n  console_type:\n    prompt: \"Select console:\"\n    type: select\n    list: [irb, pry]\n    condition: console=yes\n\n  uppercase_name:\n    type: ruby\n    code: input[:name].upcase\n```\n\n\n#### Showing messages before/after scaffolding\n\nUse the `intro` and `outro` options to show short message that will be\ndisplayed before or after building. Both are optional.\n\nThe message is displayed using the [Colsole][colsole] gem, so\nyou can use [color markers][colsole-colors]\n\nExample:\n\n```yaml\nintro: Welcome to my blue b`rig`\noutro: Installation completed successfully\n```\n\n\n#### Executing commands before/after scaffolding\n\nUse the `before` and `after` options to specify one or more commands to\nrun before or after building. Each command has a label and an action, and \nboth support [dynamic tokens](#dynamic-tokens), so you can use the input the user provided in \nyour commands.\n\nExample:\n\n```yaml\nbefore:\n  \"Create empty .env file\": \"touch .env\"\n\nafter:\n  \"Install Dependencies\": \"bundle install\"\n  \"Initialize git repo\": \"git init\"\n  \"Run setup script\": \"myscript %{name}\"\n```\n\n\n#### Scaffolding parameters\n\nThe `params` option contains a list of parameters required by the rig.\n\nEach definition in the `params` key should start with the name of the \nvariable (`name`, `console` and `console_type` in the above example), and \ncontain the below specifications:\n\n Key         | Purpose                                                      \n-------------|--------------------------------------------------------------\n `prompt`    | The text to display when asking for user input\n `type`      | The variable tyoe. Can be `yesno`, `text`, `select` or `ruby`\n `default`   | The default value. When using `yesno`, use `yes` or `no`\n `list`      | An array of allowed options (only used in `select` type)\n `condition` | Optional `key=value`. See [conditional parameters](#conditional-parameters) below\n `code`      | A ruby code to evaluate (only used in `ruby` type). See [calculated parameters](#calculated-parameters) below\n\nExample:\n\n```yaml\nparams:\n  name:\n    prompt: \"Name your project:\"\n    type: text\n    default: project\n```\n\n\n#### Conditional parameters\n\nYou can configure some of the parameters to prompt the user for input based\non his previous input.\n\nA condition is a simple `key=value` where `key` is a name of a parameter\nthat is previously defined.\n\nIn the below example, the `console_type` parameter will only be requested if\nthe user has responded with `yes` to the `console` question.\n\nExample:\n\n```yaml\nparams:\n  console: \n    prompt: Include interactive console?\n    type: yesno\n    default: yes\n\n  console_type:\n    prompt: \"Select console:\"\n    type: select\n    list: [irb, pry]\n    condition: console=yes\n```\n\n\n#### Calculated parameters\n\nYou can define a parameter that is calculated with a piece of ruby code.\n\nThis parameter may or may not use values from previous input parameters.\n\nIn the below example, the `constant_name` parameter will be the uppercase\nversion of the `name` parameter:\n\nExample:\n\n```yaml\nparams:\n  name:\n    type: ruby\n    code: |\n      \"bob\"\n\n  constant_name:\n    type: ruby\n    code: |\n      input[:name].upcase\n```\n\n\n---\n\n[example-rig]: https://github.com/DannyBen/example-rig\n[colsole-colors]: https://github.com/dannyben/colsole#color-codes\n[colsole]: https://github.com/dannyben/colsole\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Frigit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdannyben%2Frigit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdannyben%2Frigit/lists"}