{"id":51330169,"url":"https://github.com/sgaunet/scaffold","last_synced_at":"2026-07-01T22:04:24.914Z","repository":{"id":366813512,"uuid":"1277340453","full_name":"sgaunet/scaffold","owner":"sgaunet","description":"A single static Go CLI that generates a Go project's tooling, CI, and config files from templates embedded in the binary.","archived":false,"fork":false,"pushed_at":"2026-06-23T11:41:50.000Z","size":57,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-23T13:25:40.517Z","etag":null,"topics":["ci-cd","cli","devops","forgejo","github-actions","gitlab-ci","go","goreleaser","project-generator","template","tooling"],"latest_commit_sha":null,"homepage":null,"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/sgaunet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":".github/FUNDING.yml","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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null},"funding":{"github":["sgaunet"]}},"created_at":"2026-06-22T20:05:29.000Z","updated_at":"2026-06-23T11:41:53.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/sgaunet/scaffold","commit_stats":null,"previous_names":["sgaunet/scaffold"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/sgaunet/scaffold","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgaunet%2Fscaffold","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgaunet%2Fscaffold/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgaunet%2Fscaffold/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgaunet%2Fscaffold/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sgaunet","download_url":"https://codeload.github.com/sgaunet/scaffold/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sgaunet%2Fscaffold/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":35024382,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-07-01T02:00:05.325Z","response_time":130,"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":["ci-cd","cli","devops","forgejo","github-actions","gitlab-ci","go","goreleaser","project-generator","template","tooling"],"created_at":"2026-07-01T22:04:23.997Z","updated_at":"2026-07-01T22:04:24.899Z","avatar_url":"https://github.com/sgaunet.png","language":"Go","funding_links":["https://github.com/sponsors/sgaunet"],"categories":[],"sub_categories":[],"readme":"# scaffold\n\nA single static Go CLI that generates a Go project's tooling, CI, and config\nfiles from templates embedded in the binary. Pick at most one forge platform and\nan optional container toggle; existing files are skipped, and `generate` prompts\nbefore overwriting any of them.\n\nEvery generated file ships inside the binary (no network at generation time) and\nis a reviewable template in this repo under\n[`internal/scaffold/templates/`](internal/scaffold/templates/).\n\n## Install / build\n\n```bash\nCGO_ENABLED=0 go build -trimpath -o scaffold ./cmd/scaffold\n# or, with the project's own tooling:\ntask build\n```\n\n## Commands\n\n| Command | Purpose |\n|---------|---------|\n| `scaffold generate` (alias `gen`) | Guided setup form, then generate the files (requires a terminal) |\n| `scaffold version` | Print version, commit, and build date |\n\n## Usage\n\n`scaffold generate` runs a short, guided form — **platform first**, then only the\nquestions relevant to your answers — and writes the files after you confirm.\nThere are no per-input flags: every prompt is pre-filled from your config file,\nenvironment, and what the tool auto-detects, so usually you just press Enter\nthrough it. Because it is interactive, `generate` **requires a terminal**.\n\n```bash\n# Inside an existing Go repo: walk through setup, accepting the detected defaults\nscaffold generate\n\n# Drive the proposed defaults from a specific config file\nscaffold generate --config ./ci/scaffold.yml\n```\n\nThe form starts with the platform choice, including **none** for the\nplatform-independent baseline only — in which case no CI or platform extras are\ngenerated.\n\nIn a pipe, under `--quiet`, or with no terminal, `generate` exits with a usage\nerror (exit 2) instead of hanging. Set the defaults in the config file and run\n`generate` in an interactive shell.\n\n### Defaults come from a config file\n\nThere are no profile flags. Instead, a config file supplies the values proposed\nin the form. Create\n`~/.config/scaffold/config.yml` (honors `$XDG_CONFIG_HOME`):\n\n```yaml\nowner: sgaunet\nplatform: github      # github | gitlab | forgejo | none\ndocker: true\n# Other recognized keys: name, binary, module, registry, main, homebrew,\n# homebrew-tap, go-version, task-version, golangci-version, goreleaser-version\n```\n\n| Flag | Default | Meaning |\n|------|---------|---------|\n| `--config \u003cpath\u003e` | `$XDG_CONFIG_HOME/scaffold/config.yml`, else `$HOME/.config/scaffold/config.yml` | config file to load (an explicit path that is missing → exit 2) |\n| `--no-config` | false | ignore any config file (reproducible/CI runs) |\n\nGlobal: `--output text\\|json`, `--quiet`/`-q`, `--verbose`/`-v`, and `NO_COLOR`.\nPrecedence is **env (`SCAFFOLD_*`) \u003e config file \u003e auto-detection (`go.mod` /\n`.git/config`) \u003e built-in defaults**. `SCAFFOLD_CONFIG` sets the config path\n(same as `--config`).\n\n### What gets generated\n\n- **Always**: `.goreleaser.yaml`, `mise.toml`, `.golangci.yml`,\n  `.pre-commit-config.yaml`, `Taskfile.yml`, `Taskfile_dev.yml`\n- **GitHub**: `.github/workflows/{linter,test,snapshot,release}.yml`,\n  `.github/dependabot.yml`, `.github/FUNDING.yml`\n- **Forgejo**: `.forgejo/workflows/{lint,test,snapshot,release}.yml`\n- **GitLab**: `.gitlab-ci.yml`\n- **Container support** (`docker: true`): `Dockerfile` plus\n  `dockers:`/`docker_manifests:` blocks and CI image build/publish steps\n- **Homebrew** (`homebrew: true`, GitHub only): a `homebrew_casks:` block in\n  `.goreleaser.yaml` that publishes a Homebrew cask to `\u003cowner\u003e/\u003ctap\u003e` on\n  release, plus the `HOMEBREW_TAP_TOKEN` secret wired into the release workflow\n\nEvery generated CI job provisions its toolchain through\n[`mise`](https://mise.jdx.dev) rather than ad-hoc installs.\n\n### Homebrew\n\nWith `homebrew: true` (requires `platform: github`), releases publish a Homebrew\n**cask** (the modern replacement for deprecated formula `brews`) to a tap repo\nyou own. Before your first release:\n\n1. Create the tap repo `\u003cowner\u003e/homebrew-tools` (or set `homebrew-tap: \u003cname\u003e`\n   in the config).\n2. Add a `HOMEBREW_TAP_TOKEN` repository secret — a token with write access to\n   the tap repo (a classic PAT with `repo` scope, or a fine-grained token\n   scoped to the tap).\n\nThe cask installs the binary, generates bash/zsh/fish completions from the\nbinary's `completion` subcommand, and strips the macOS quarantine attribute for\nunsigned binaries.\n\n## Exit codes\n\n| Code | Meaning |\n|------|---------|\n| `0` | Success |\n| `1` | Generic failure |\n| `2` | Usage error (no terminal for `generate`, bad flag, invalid/missing config value) |\n| `10` | Conflict — one or more existing files were skipped; re-run and confirm the overwrite prompt |\n\n## Develop\n\n```bash\ntask test          # unit + integration tests (black-box _test packages)\ntask lint          # golangci-lint\ngo test ./...      # equivalent to task test\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgaunet%2Fscaffold","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsgaunet%2Fscaffold","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsgaunet%2Fscaffold/lists"}