{"id":25541363,"url":"https://github.com/alfredosalzillo/sauron","last_synced_at":"2026-04-29T22:07:42.661Z","repository":{"id":62421832,"uuid":"320870447","full_name":"alfredosalzillo/sauron","owner":"alfredosalzillo","description":"An easy template clone CLI made in Deno.","archived":false,"fork":false,"pushed_at":"2020-12-22T13:43:27.000Z","size":41,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-16T18:36:16.039Z","etag":null,"topics":["cli","deno","template","template-engine","typescript"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/alfredosalzillo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-12-12T16:11:47.000Z","updated_at":"2021-11-09T17:41:47.000Z","dependencies_parsed_at":"2022-11-01T17:45:32.960Z","dependency_job_id":null,"html_url":"https://github.com/alfredosalzillo/sauron","commit_stats":null,"previous_names":[],"tags_count":9,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfredosalzillo%2Fsauron","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfredosalzillo%2Fsauron/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfredosalzillo%2Fsauron/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/alfredosalzillo%2Fsauron/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/alfredosalzillo","download_url":"https://codeload.github.com/alfredosalzillo/sauron/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239356979,"owners_count":19625396,"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","deno","template","template-engine","typescript"],"created_at":"2025-02-20T06:35:29.682Z","updated_at":"2026-02-04T08:30:19.209Z","avatar_url":"https://github.com/alfredosalzillo.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sauron\n\u003eThis is the Master-ring, the One Ring to rule them all. This is the One Ring that he lost many ages ago, to the great weakening of his power. He greatly desires it — but he must not get it.\n\u003e \nAn easy template clone cli made in Deno.\n\n## INSTALL\n\n```bash\ndeno install \\\n      --unstable \\\n      --allow-read \\\n      --allow-write \\\n      --allow-run \\\n      --allow-net \\\n      -n sauron https://deno.land/x/sauronx/sauron.ts\n```\n\n## USAGE\n\nInit a directory using a template.\n\n```bash\nsauron init DESTINATION --template TEMPLATE [OPTIONS]\n# Example with remote template\nsauron init hello-world --template https://github.com/alfredosalzillo/example-sauron-template\n# example with local template\nsauron init hello-world --template /templates/hello-world\n```\n\n### Options\n- _-t, --template_ - template to use (required)\n- _-c, --config_ - override configuration, could be a path to a local file, an url or a JSON string\n- _--reload_ - reload the template if cached\n- _--inputs.*_ - inputs to use within the template (Example --inputs.projectName hello-world)\n- _-h, --help_ - show help\n\n## Configuration\nSauron searches, inside the template repository, for a config file named `sauron.yaml`.\n\n### Inputs\nThe config file accept an `inputs` array of inputs to ask the user when using the template.\n\nAll the inputs accept the following options:\n\n- `name` the input name to use inside files and dir/files names\n- `type` the type of the input `question, choose, confirm` \n- `message` the message to show to the user asking for the input\n- `default` **optional** the default value to use if user skip the question\n\nThe `name` could be used inside file name, directory name, and content of file and would be replaced with the value used by the user.\nVariables should be used wrapped in double brackets `{{ INPUT_NAME }}` or `{{INPUT_NAME}}`.\nExample:\n```typescript \n// file: {{COMPONENT_NAME}}.tsx\nimport React from 'react';\n\nconst {{COMPONENT_NAME}} = () =\u003e \u003c\u003e\u003c/\u003e;\n\nexport default {{COMPONENT_NAME}};\n```\n\nSauron support the following inputs type:\n- `question` ask a question to the user\n\n    ```yaml\n    inputs: \n      - name: PROJECT_NAME\n        type: question\n        message: What is the project templateName?\n    ```\n- `choose` ask user to choose between options\n\n    ```yaml\n    inputs: \n      - name: PACKAGE_MANAGER\n        type: choose\n        message: What package manager want to use?\n        values:\n          - yarn\n          - npm\n    ```\n- `confirm` ask user to confirm (yes|no) a question\n\n    ```yaml\n    inputs: \n      - name: TYPESCRIPT\n        type: confirm\n        message: Whant to use typescript?\n        default: yes\n    ```\n\n### Other config\n- `name` the template name\n- `version` the template version\n- `before` message to be logged before the copy of the template\n- `after` message to be logged after the copy of the script, input variables can be used\n\n### Global parameters\n\nSome global parameters can be used like input variables:\n- `DESTINATION` the destination argument\n- `DESTINATION_BASENAME` the destination basename\n- `TEMPLATE_NAME` the template name of the configuration file\n- `TEMPLATE_VERSION` the template version of the configuration file\n- `TEMPLATE` the template url/path argument\n\nExample\n```yaml\nname: hello-sauron\nversion: 0.0.1\ninputs:\n  - name: PROJECT_NAME\n    type: question\n    message: What is the project name?\nbefore: Using this awesome template made with sauron\nafter: |\n  Project {{PROJECT_NAME}}@{{TEMPLATE_VERSION}} created successfully \n  run using 'deno run ./src/index.ts'\n```\n---\n`sauron` - a `Deno` to rule them all.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfredosalzillo%2Fsauron","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Falfredosalzillo%2Fsauron","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Falfredosalzillo%2Fsauron/lists"}