{"id":16617365,"url":"https://github.com/ryooooooga/zouch","last_synced_at":"2025-09-03T21:38:58.093Z","repository":{"id":64306365,"uuid":"361158363","full_name":"Ryooooooga/zouch","owner":"Ryooooooga","description":"Create a new file from template","archived":false,"fork":false,"pushed_at":"2024-02-17T13:05:32.000Z","size":125,"stargazers_count":6,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-06-21T14:43:44.445Z","etag":null,"topics":["cli","cli-app","cp","cp-file","scaffold-files","touch-alt"],"latest_commit_sha":null,"homepage":"","language":"Go","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/Ryooooooga.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","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}},"created_at":"2021-04-24T12:38:58.000Z","updated_at":"2024-05-30T14:58:21.000Z","dependencies_parsed_at":"2024-02-17T14:24:22.956Z","dependency_job_id":"32138150-d5f5-4432-a260-b74a6e50b4c3","html_url":"https://github.com/Ryooooooga/zouch","commit_stats":null,"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryooooooga%2Fzouch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryooooooga%2Fzouch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryooooooga%2Fzouch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Ryooooooga%2Fzouch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Ryooooooga","download_url":"https://codeload.github.com/Ryooooooga/zouch/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":219857330,"owners_count":16556068,"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","cli-app","cp","cp-file","scaffold-files","touch-alt"],"created_at":"2024-10-12T02:16:22.080Z","updated_at":"2024-10-12T02:16:22.512Z","avatar_url":"https://github.com/Ryooooooga.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zouch\n\nCreate a new file from a template.\n\nInspired by [touch-alt](https://github.com/akameco/touch-alt) and [touch_erb](https://github.com/himanoa/touch_erb).\n\n## Usage\n\n```sh\nNAME:\n   zouch - Create a new file from a template\n\nUSAGE:\n   zouch [files...]\n   zouch --list\n   zouch --preview [files...]\n   zouch --add     [files...]\n\nGLOBAL OPTIONS:\n   --list, -l     list template files (default: false)\n   --preview, -p  show template preview (default: false)\n   --add, -A      add [files...] as new templates (default: false)\n   -r             create directories as required (default: false)\n   --force, -f    force update existing files (default: false)\n   --verbose, -V  display verbose output (default: false)\n   --help, -h     show help (default: false)\n   --version, -v  print the version (default: false)\n```\n\n## Examples\n\n```sh\n$ cat ~/.config/zouch/templates/today.txt\nToday is {{ Now.Format \"2006-01-02\" }}!\n\n$ zouch today.txt\n\n$ cat today.txt\nToday is 2021-05-02!\n```\n\n### Variables\n\n| name                | type      | e.g.                                  |\n|:--------------------|:----------|:--------------------------------------|\n| `.Filename`         | `string`  | `today.txt`                           |\n| `.Filepath`         | `string`  | full path of `.Filename`              |\n| `.TemplateFilename` | `string`  | `~/.config/zouch/templates/today.txt` |\n| `.TemplateFilepath` | `string`  | same as `.TemplateFilename`           |\n\n\n### Functions\n\n| name               | signature                                                          | implementation                                           |\n|:-------------------|:-------------------------------------------------------------------|:---------------------------------------------------------|\n| `Now`              | `func() time.Time`                                                 | `time.Now`                                               |\n| `Base`             | `func(string) string`                                              | `path.Base`                                              |\n| `Ext`              | `func(string) string`                                              | `path.Ext`                                               |\n| `Dir`              | `func(string) string`                                              | `path.Dir`                                               |\n| `Abs`              | `func(string) (string, error)`                                     | `filepath.Abs`                                           |\n| `Getwd`            | `func(string) (string, error)`                                     | `os.Getwd`                                               |\n| `Getenv`           | `func(string) string`                                              | `os.Getenv`                                              |\n| `HasPrefix`        | `func(string) bool`                                                | `strings.HasPrefix`                                      |\n| `HasSuffix`        | `func(string) bool`                                                | `strings.HasSuffix`                                      |\n| `TrimPrefix`       | `func(string, string) string`                                      | `strings.TrimPrefix`                                     |\n| `TrimSuffix`       | `func(string, string) string`                                      | `strings.TrimSuffix`                                     |\n| `LowerCamelCase`   | `func(string) string`                                              | `strcase.LowerCamelCase`                                 |\n| `UpperCamelCase`   | `func(string) string`                                              | `strcase.UpperCamelCase`                                 |\n| `SnakeCase`        | `func(string) string`                                              | `strcase.SnakeCase`                                      |\n| `UpperSnakeCase`   | `func(string) string`                                              | `strcase.UpperSnakeCase`                                 |\n| `KebabCase`        | `func(string) string`                                              | `strcase.KebabCase`                                      |\n| `UpperKebabCase`   | `func(string) string`                                              | `strcase.UpperKebabCase`                                 |\n| `Replace`          | `func(string, string, string, int) string`                         | `strings.Replace`                                        |\n| `ReplaceAll`       | `func(string, string, string) string`                              | `strings.ReplaceAll`                                     |\n| `Shell`            | `func(command string) (string, error)`                             | `exec.Command(\"/bin/sh\", \"-c\", command).Output()`        |\n| `RegexReplaceAll`  | `func(src string, pattern string, replace string) (string, error)` | `regexp.Compile(pattern).ReplaceAllString(src, replace)` |\n\n## Installation\n\n### From source\n\n```sh\n$ go get -u github.com/Ryooooooga/zouch\n```\n\n### From precompiled binary\n\nhttps://github.com/Ryooooooga/zouch/releases/\n\n### Using [zinit](https://github.com/zdharma/zinit)\n\nAdd the following to your `.zshrc`.\n\n```sh\nzinit ice lucid wait\"0\" as\"program\" from\"gh-r\" \\\n    pick\"zouch*/zouch\"\nzinit light 'Ryooooooga/zouch'\n```\n\n### Using Homebrew\n\n```sh\n$ brew install ryooooooga/tap/zouch\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryooooooga%2Fzouch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fryooooooga%2Fzouch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fryooooooga%2Fzouch/lists"}