{"id":50525547,"url":"https://github.com/maximbilan/zatt","last_synced_at":"2026-06-03T07:31:24.866Z","repository":{"id":345512573,"uuid":"1186056998","full_name":"maximbilan/zatt","owner":"maximbilan","description":"Minimal macOS CLI to control MacBook battery charging via SMC","archived":false,"fork":false,"pushed_at":"2026-03-19T14:23:32.000Z","size":38,"stargazers_count":3,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-03-20T04:34:26.425Z","etag":null,"topics":["apple-silicon","battery","charging","cli","homebrew","macbook","macos","power-management","smc","zig"],"latest_commit_sha":null,"homepage":null,"language":"Zig","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/maximbilan.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-03-19T08:13:24.000Z","updated_at":"2026-03-19T20:23:42.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/maximbilan/zatt","commit_stats":null,"previous_names":["maximbilan/zatt"],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/maximbilan/zatt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2Fzatt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2Fzatt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2Fzatt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2Fzatt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/maximbilan","download_url":"https://codeload.github.com/maximbilan/zatt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/maximbilan%2Fzatt/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33853984,"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-06-03T02:00:06.370Z","response_time":59,"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":["apple-silicon","battery","charging","cli","homebrew","macbook","macos","power-management","smc","zig"],"created_at":"2026-06-03T07:31:20.476Z","updated_at":"2026-06-03T07:31:24.856Z","avatar_url":"https://github.com/maximbilan.png","language":"Zig","funding_links":[],"categories":[],"sub_categories":[],"readme":"# zatt\n\nMinimal macOS CLI for controlling MacBook battery charging over the Apple SMC.\n\n`zatt` exists for a specific gap in macOS: the system shows battery health and\ncharge state, but it does not give you a simple built-in way to tell the SMC to:\n\n- stop charging while the charger is connected\n- resume charging again later\n- apply a charge limit from the command line\n- verify the real battery current instead of trusting the menu bar icon\n\nThis is useful if you want to keep a MacBook plugged in for long periods without\nholding the battery at 100% all the time, or if you want a lightweight way to\nscript charge control without running a full background app.\n\n`zatt` talks directly to the Apple SMC and battery power-source APIs. It is a\nsmall single-binary CLI written in Zig with no external runtime dependencies.\n\n## What It Solves\n\nmacOS can be confusing when you are trying to manage charging manually:\n\n- the menu bar battery icon can lag behind the real battery state\n- a Mac can be on AC power without actually charging the battery\n- the system UI does not expose the underlying SMC charging inhibit toggle\n- charge-limit behavior is hard to script from shell tools or automation\n\n`zatt` addresses that by giving you:\n\n- direct SMC write commands for charging enable/disable and charge limits\n- read-only status output that combines battery APIs and SMC state\n- a live `watch` mode so you can see real charging current as it changes\n- a `--wait` option for write commands so the CLI can observe whether charging\n  has actually settled after the write\n\n## How To Read The Output\n\nThe most important distinction in `zatt` is between:\n\n- external power is connected\n- battery current is actually flowing into the pack\n\nThose are not always the same thing. A MacBook can be plugged in and powered by\nthe charger while the battery is not charging at all.\n\nFor that reason, `zatt` emphasizes:\n\n- `Actual charging`\n- `Charge current`\n- `SMC inhibit`\n\ninstead of relying on the macOS menu bar icon alone.\n\nIf the menu bar says \"charging\" but `zatt` shows `Actual charging: no` and\n`Charge current: 0 mA`, the battery is not actively taking charge at that\nmoment. The menu bar can lag by 1-2 minutes after a real state change.\n\n## Install\n\n```bash\nbrew tap maximbilan/zatt https://github.com/maximbilan/zatt\nbrew install maximbilan/zatt/zatt\n```\n\nHomebrew's `brew install user/repo/formula` shorthand only works when the GitHub\nrepository is named `homebrew-\u003crepo\u003e`. Because this project lives in\n`maximbilan/zatt`, the explicit `brew tap ... \u003cURL\u003e` form is required.\n\n## Usage\n\n```bash\nzatt status\nzatt watch\nzatt debug\nzatt raw-status\nsudo zatt disable\nsudo zatt disable --wait\nsudo zatt enable\nsudo zatt enable --wait\nsudo zatt limit 80\nsudo zatt limit reset\n```\n\nTypical flow:\n\n```bash\nzatt status\nsudo zatt disable --wait\nzatt watch\nsudo zatt enable --wait\nsudo zatt limit 80\n```\n\n`zatt debug` prints an interpreted charging diagnostic view for local testing.\n`zatt raw-status` dumps the raw IOPS, `AppleSmartBattery`, and SMC fields that\nback the charging state.\n`zatt watch` refreshes the real battery charging state every second so you do\nnot need to wait for the macOS menu bar icon to catch up.\n\nWrite-command options:\n\n- `--wait`: keep polling until the observed battery current settles or the wait\n  timeout is reached\n\n## Notes\n\n- `status`, `watch`, `debug`, and `raw-status` do not require `sudo`\n- write commands require `sudo` because they talk to privileged SMC interfaces\n- this project targets Apple Silicon Macs on macOS 13+\n- `limit` only accepts `80`, `100`, or `reset` on Apple Silicon\n- direct `BCLM`/`CHWA` charge-limit writes are blocked by macOS 15+ entitlement enforcement\n- battery health text is shown as reported by macOS, for example `Normal`,\n  `Check Battery`, or similar platform-specific values\n\n## Build\n\n```bash\nzig build\nzig build test\nzig build release\n```\n\n`zig build release` produces:\n\n- `zig-out/bin/zatt`\n- `zig-out/zatt-macos-arm64.tar.gz`\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximbilan%2Fzatt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaximbilan%2Fzatt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaximbilan%2Fzatt/lists"}