{"id":30596325,"url":"https://github.com/divyanshusahu/commit-celebration","last_synced_at":"2025-08-29T21:41:50.694Z","repository":{"id":311275213,"uuid":"1043241000","full_name":"divyanshusahu/commit-celebration","owner":"divyanshusahu","description":"A tiny, cross‑platform tool that plays a short celebration sound after every successful git commit.","archived":false,"fork":false,"pushed_at":"2025-08-23T12:48:19.000Z","size":18,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-23T19:16:18.095Z","etag":null,"topics":["commit-hooks","git","go","golang","post-commit"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/divyanshusahu.png","metadata":{"files":{"readme":"README.md","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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-08-23T12:39:57.000Z","updated_at":"2025-08-23T19:01:27.000Z","dependencies_parsed_at":"2025-08-23T19:16:29.589Z","dependency_job_id":"440b5d04-484b-40c4-8d07-f4512ac8076b","html_url":"https://github.com/divyanshusahu/commit-celebration","commit_stats":null,"previous_names":["divyanshusahu/commit-celebration"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/divyanshusahu/commit-celebration","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divyanshusahu%2Fcommit-celebration","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divyanshusahu%2Fcommit-celebration/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divyanshusahu%2Fcommit-celebration/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divyanshusahu%2Fcommit-celebration/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/divyanshusahu","download_url":"https://codeload.github.com/divyanshusahu/commit-celebration/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/divyanshusahu%2Fcommit-celebration/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":272766995,"owners_count":24989422,"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-08-29T02:00:10.610Z","response_time":87,"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":["commit-hooks","git","go","golang","post-commit"],"created_at":"2025-08-29T21:41:49.880Z","updated_at":"2025-08-29T21:41:50.686Z","avatar_url":"https://github.com/divyanshusahu.png","language":"Go","readme":"# commit-celebration\n\nA tiny, cross‑platform tool that plays a short celebration sound after every successful git commit. Install it once as a global git hook; customize the sounds to your taste; keep the rest of your workflow untouched.\n\nCredits: The default sounds are sourced from \u003chttps://www.freesoundslibrary.com/\u003e — huge thanks to the creators and the library.\n\n## Overview\n\n- Global post-commit hook: enabled once, works for all repos.\n- Offline after first run: sounds are cached locally.\n- Fully customizable: drop your own .mp3/.wav/.m4a files.\n- No config files, no daemons, no shell wrappers.\n- macOS, Linux, and Windows support.\n\nUnder the hood, the hook launches the `commit-celebration` binary in the background. The app ensures sounds exist locally, downloads the latest sounds pack from GitHub Releases if needed, picks a random file, and plays it using the platform’s native player.\n\n## How to install and use\n\nPrerequisites:\n\n- Git installed.\n- Audio capability:\n  - macOS: `afplay` (built-in)\n  - Linux: one of `paplay`, `aplay`, or `mpg123`\n  - Windows: PowerShell SoundPlayer\n\n### One‑line install\n\nRun this in your terminal:\n\n```bash\ncurl -fsSL https://raw.githubusercontent.com/divyanshusahu/commit-celebration/HEAD/install.sh | bash\n```\n\nWhat this does:\n\n- Downloads the latest `commit-celebration` binary for your OS/arch to `~/.local/bin`\n- Makes it executable\n- Runs `commit-celebration install` to enable a global `post-commit` hook\n- Leaves a note if `~/.local/bin` is not on your PATH\n\n### Enable/disable the global hook\n\n- Enable (done automatically by the installer): `commit-celebration install`\n- Disable and revert: `commit-celebration uninstall`\n\nNow make a commit anywhere and enjoy a celebratory sound.\n\n### 3) Customize the sounds\n\n- Default non-dev location: `~/.commit-celebration/sounds`\n- Dev builds (running from source): `./sounds` (relative to the repo root)\n\nHow to customize:\n\n- Drop your own `.mp3`, `.wav`, or `.m4a` files into the sounds folder.\n- Remove any files you don’t want.\n- The app picks a random file each time.\n\nImportant note about the `update` command: `commit-celebration update` now updates both the binary and the sounds. If you’ve added custom files to the sounds folder, back them up first; the folder will be refreshed from the latest release.\n\n### Upgrade\n\n- Self-update to the latest release (binary + sounds): `commit-celebration update`\n- Verify version: `commit-celebration version`\n\n### Uninstall\n\n- Disable global hook: `commit-celebration uninstall`\n- Optional cleanup:\n  - Remove the sounds cache: `rm -rf ~/.commit-celebration`\n  - Remove the binary from your PATH (e.g., `~/.local/bin/commit-celebration`)\n\n## How it is built (and how it works)\n\n- The global `post-commit` hook script is written to `~/.commit-celebration/git-hooks/post-commit` and runs the binary in the background.\n- On execution, the app ensures a local sounds cache exists. If empty, it resolves a release tag (embedded at build-time, or via GitHub’s `releases/latest`), downloads `sounds-pack.zip` from the repository’s Releases, and extracts it into the sounds directory.\n- A random track is selected and played using:\n  - macOS: `afplay`\n  - Linux: `paplay`, `aplay`, or `mpg123` (first available)\n  - Windows: PowerShell `Media.SoundPlayer`\n\nSelf‑update behavior (`commit-celebration update`):\n\n- Resolves the latest GitHub release tag\n- Downloads the OS/arch‑specific binary and replaces the current executable (POSIX)\n- On Windows, writes a `.new` file alongside the current `.exe` (manual swap required)\n- Clears and refreshes the sounds cache from the `sounds-pack.zip` asset\n\nBuild and release:\n\n- Standard Go static binaries built per OS/arch (see `release.sh`).\n- Build-time variables (`Version`, `BuildTime`) are injected via `-ldflags`.\n- Sounds pack is zipped as `sounds-pack.zip` and published with the release.\n\n## Local development setup\n\nRequirements:\n\n- Go 1.21+ (module targets Go 1.24)\n- zip utility (for releasing)\n- GitHub CLI (`gh`) if you plan to publish releases\n\nQuick start:\n\n- Add a couple of small `.mp3`/`.wav` files under `./sounds`.\n- Build and run locally:\n  - `go build -o commit-celebration`\n  - `./commit-celebration` (plays a random sound)\n  - `./commit-celebration version`\n- Test the hook end‑to‑end:\n  - `./commit-celebration install`\n  - Make a commit in any repo\n  - `./commit-celebration uninstall` to revert\n\nReleasing (maintainers):\n\n- Prepare sounds under `./sounds`.\n- Run `./release.sh vX.Y.Z`.\n- Artifacts are produced under `./dist/` and uploaded via `gh release`.\n\n## Badges and demo\n\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](LICENSE)\n[![Go Version](https://img.shields.io/badge/go-1.24+-blue.svg)](go.mod)\n[![Releases](https://img.shields.io/github/v/release/divyanshusahu/commit-celebration)](https://github.com/divyanshusahu/commit-celebration/releases)\n\n## Contributing guide\n\nWe welcome contributions that keep the tool simple and robust.\n\n- Open an issue to discuss significant changes first.\n- Keep pull requests small and focused.\n- Follow idiomatic Go; run `go fmt`.\n- Update this README if behavior changes.\n\n## Troubleshooting\n\n- No sound on Linux: install one of `paplay`, `aplay`, or `mpg123` and ensure it is on PATH.\n- Already using a global hooks path: the tool sets `git config --global core.hooksPath` to `~/.commit-celebration/git-hooks`. If you rely on another global hooks setup, merge your logic into the generated `post-commit` or avoid installing globally.\n- Network restrictions: the app contacts GitHub (API + Releases) to fetch the latest version and the sounds pack. Ensure HTTPS to GitHub is allowed.\n\n## Security \u0026 privacy\n\n- No telemetry, no background daemons.\n- Network access only to GitHub when updating/version-detecting or downloading sounds.\n\n## License\n\nMIT License. See `LICENSE` for details.\n\nAudio credit: Default sounds are from \u003chttps://www.freesoundslibrary.com/\u003e and retain their respective licenses/attributions from that source.\n\n—\n\nBuilt with Go. Have fun shipping—one commit at a time.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivyanshusahu%2Fcommit-celebration","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdivyanshusahu%2Fcommit-celebration","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdivyanshusahu%2Fcommit-celebration/lists"}