{"id":47744098,"url":"https://github.com/siterelenby/git-leash","last_synced_at":"2026-04-08T05:00:40.193Z","repository":{"id":348644835,"uuid":"1199124052","full_name":"SiteRelEnby/git-leash","owner":"SiteRelEnby","description":"A git commit hook to block commits in certain repos based on configurable time windows. \"Helps you stay focused on what you should be doing at certain times of day\". Especially if you're a puppy.","archived":false,"fork":false,"pushed_at":"2026-04-04T03:50:31.000Z","size":45,"stargazers_count":29,"open_issues_count":1,"forks_count":2,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-07T04:03:19.604Z","etag":null,"topics":["adhd","bash","cli","developer-console","focus","focus-management","furry","git","git-hooks","pre-commit-hook","productivity","puppygirl"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SiteRelEnby.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,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-04-02T04:18:36.000Z","updated_at":"2026-04-06T05:31:34.000Z","dependencies_parsed_at":"2026-04-06T03:00:37.532Z","dependency_job_id":null,"html_url":"https://github.com/SiteRelEnby/git-leash","commit_stats":null,"previous_names":["siterelenby/git-leash"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/SiteRelEnby/git-leash","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiteRelEnby%2Fgit-leash","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiteRelEnby%2Fgit-leash/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiteRelEnby%2Fgit-leash/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiteRelEnby%2Fgit-leash/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SiteRelEnby","download_url":"https://codeload.github.com/SiteRelEnby/git-leash/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SiteRelEnby%2Fgit-leash/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31540826,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"online","status_checked_at":"2026-04-08T02:00:06.127Z","response_time":54,"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":["adhd","bash","cli","developer-console","focus","focus-management","furry","git","git-hooks","pre-commit-hook","productivity","puppygirl"],"created_at":"2026-04-03T00:22:26.497Z","updated_at":"2026-04-08T05:00:40.132Z","avatar_url":"https://github.com/SiteRelEnby.png","language":"Shell","readme":"# git-leash\n\n*Helps you stay focused on what you're supposed to be doing.*\n\nA git pre-commit hook that blocks commits during configured focus windows. Overridable when you genuinely need to ship. Stealth-installable so it doesn't pollute your repo.\n\nBy a puppygirl.\n\n## Install\n\n```bash\ncp leash ~/.local/bin/ \u0026\u0026 chmod +x ~/.local/bin/leash\n# or install directly from GitHub\n# curl -s https://raw.githubusercontent.com/SiteRelEnby/git-leash/refs/heads/main/leash \u003e ~/.local/bin/leash \u0026\u0026 \\\n  chmod +x ~/.local/bin/leash\n```\n\nMake sure `~/.local/bin` is in your `PATH`.\n\nThen, in any repo:\n\n```bash\n# install the hook to this repo\nleash install\n\n# or install globally (all repos)\nleash install --global\n```\n\n`leash install` automatically adds `.leash` and `.leash-slip` to `.git/info/exclude` — no `.gitignore` modifications, nothing tracked, pure stealth.\n\n## Config\n\nPlace at `~/.leash` (global) or `.leash` in your repo root (project-local overrides global).\n\n```ini\n[schedule \"work-hours\"]\ndays=mon,tue,wed,thu,fri\nstart=09:00\nend=17:00\ntimezone=local\n\n# only block personal repos — work repos are fine\nblock=remote:github.com/myuser/*\nblock=dir:side-project\ntask=finish the auth refactor\n\n[schedule \"go-to-bed\"]\ndays=mon,tue,wed,thu,sun\nstart=23:00\nend=06:00\ntask=go to sleep you disaster\n# no filter = block everything. go to sleep.\n\n[task]\n# global fallback when a schedule doesn't have its own\ncurrent=stop getting distracted\n\n[messages]\ntone=puppy\n\n[override]\nenv_var=UNLEASH\nslip_file=.leash-slip\n```\n\nRun `leash example` for a fully commented config.\n\n### Schedules\n\nNamed blocks that define when commits are restricted. Multiple schedules stack — if **any** match, the commit is blocked.\n\n- `days` — comma-separated, lowercase (default: `mon,tue,wed,thu,fri`)\n- `start` / `end` — 24h time. Overnight windows work (`23:00` to `06:00`)\n- `timezone` — `local` or IANA zone like `America/New_York`\n\n### Repo filters\n\nWithout filters, a schedule blocks **all** repos. Add filters to be selective.\n\n**`allow=`** (allowlist) — only matching repos can commit during this window, everything else is blocked. This is the one you probably want for \"let me commit to work repos during work hours\":\n\n```ini\n[schedule \"work-hours\"]\ndays=mon,tue,wed,thu,fri\nstart=09:00\nend=17:00\nallow=remote:github.com/company/*\nallow=path:/home/user/work/*\nallow=dir:work-project\n```\n\n**`block=`** (denylist) — only matching repos are blocked, everything else is fine:\n\n```ini\nblock=remote:github.com/myuser/*\nblock=dir:side-project\n```\n\n**Pick one per schedule.** If both `allow=` and `block=` are present, `allow=` wins and `block=` is ignored (leash will warn you about this). Set `suppress_warnings=true` in `[messages]` to silence the warning if you know what you're doing.\n\n**Prefixes (required):**\n| Prefix | Matches against |\n|---|---|\n| `remote:` | All remote URLs (not just origin) — protocol and `.git` suffix stripped |\n| `path:` | Repo root absolute path |\n| `dir:` | Repo directory name (basename) |\n\nMultiple lines of the same type stack as OR — any match counts.\n\n### Task\n\nOptional reminder shown in the block message. Can be set per-schedule or globally as a fallback:\n\n```ini\n[schedule \"work-hours\"]\ntask=finish the auth refactor\n\n[schedule \"go-to-bed\"]\ntask=go to sleep you disaster\n\n[task]\n# fallback when a schedule doesn't have its own\ncurrent=stop getting distracted\n```\n\nSet the global task from the CLI:\n\n```bash\nleash task \"finish the auth refactor\"\n```\n\n### Message tone\n\n```ini\n[messages]\ntone=default   # normal focus-helper vibes\ntone=puppy     # i know what you are\n```\n\n## Overrides\n\nWhen you genuinely need to commit during a focus window:\n\n```bash\n# environment variable (configurable name)\nUNLEASH=1 git commit -m \"it's fine\"\n\n# one-time pass — auto-deleted after one commit\nleash slip\n\n# nuclear option (skips all git hooks)\ngit commit --no-verify\n```\n\n## Commands\n\n```\nleash install [--global]    Install the pre-commit hook\nleash uninstall [--global]  Remove the pre-commit hook\nleash slip                  Create a one-time commit pass\nleash status                Show config, schedule, and block status\nleash task [description]    Show or set the current task reminder\nleash check                 Run the hook check manually\nleash example               Print a fully commented example config\nleash help                  Show help\nleash version               Show version\n```\n\n## How it works\n\n`leash install` writes a pre-commit hook that calls back to the `leash` script. On each `git commit`:\n\n1. Check overrides (env var, slip file) — fast exit if set\n2. Read config (`~/.leash` + `.leash`, project wins)\n3. Check each schedule: day, time, repo filters\n4. If blocked: bark, show task, print override hints, exit 1\n\nThe hook remembers where `leash` was installed from, but also checks `PATH` as a fallback. If `leash` can't be found at all, it warns but allows the commit — it won't silently break your workflow.\n\n## Stealth\n\nThe whole point is that this doesn't leave traces in your repo:\n\n- `.leash` and `.leash-slip` are added to `.git/info/exclude` (repo-local gitignore, untracked)\n- The hook lives in `.git/hooks/` (not tracked)\n- Nothing touches `.gitignore`\n\nIf there's an existing pre-commit hook, it gets backed up to `pre-commit.leash-backup` and chained — leash runs first, then your original hook.\n\n## Requirements\n\nBash 4+ and coreutils. That's it.\n\n## License\n\nBSD 3-Clause\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiterelenby%2Fgit-leash","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsiterelenby%2Fgit-leash","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsiterelenby%2Fgit-leash/lists"}