{"id":30873741,"url":"https://github.com/jonesiscoding/mac-libs","last_synced_at":"2025-09-07T23:50:09.115Z","repository":{"id":152471032,"uuid":"535008333","full_name":"jonesiscoding/mac-libs","owner":"jonesiscoding","description":"A library of common reusable bash functions for macOS","archived":false,"fork":false,"pushed_at":"2025-06-09T17:58:42.000Z","size":118,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-09T18:46:55.231Z","etag":null,"topics":["bash","jamf","library","macos","script","terminal"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"lgpl-2.1","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jonesiscoding.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":"2022-09-10T13:35:41.000Z","updated_at":"2025-06-09T17:58:46.000Z","dependencies_parsed_at":null,"dependency_job_id":"7425cc5d-d3ee-4017-a0a8-844d19876f32","html_url":"https://github.com/jonesiscoding/mac-libs","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/jonesiscoding/mac-libs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonesiscoding%2Fmac-libs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonesiscoding%2Fmac-libs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonesiscoding%2Fmac-libs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonesiscoding%2Fmac-libs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jonesiscoding","download_url":"https://codeload.github.com/jonesiscoding/mac-libs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jonesiscoding%2Fmac-libs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":274113046,"owners_count":25224334,"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-09-07T02:00:09.463Z","response_time":67,"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":["bash","jamf","library","macos","script","terminal"],"created_at":"2025-09-07T23:50:01.664Z","updated_at":"2025-09-07T23:50:09.094Z","avatar_url":"https://github.com/jonesiscoding.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mac-libs\nA library of common reusable bash functions, with 0 non-native dependencies, to assist in the management of macOS computers.\n\nWhile all the functionality can be replicated within macOS itself, there are two advantages to using the library:\n\n* Less code to touch if the method to do something in macOS changes.\n* Less remembering (or searching for) obscure macOS utilities, flags, and filters. \n\n### Usage\n\n* Source one of the stub files below, depending on how your script to be run.\n* Source each of the function files that contain the functions you want to use.  \n  * Internal dependencies are taken care of automatically.\n  * See individual function files for arguments \u0026 additional notes.\n* If using `jamf.sh` or `root.sh`, initialize the user with one of the `user::init` functions.\n\n#### Stub Files\n\n| File      | For                                             | Effects                                                                 |\n|-----------|-------------------------------------------------|-------------------------------------------------------------------------|\n| `core.sh` | Scripts run as shell user                       | User functions automatically run on $USER                               |\n| `root.sh` | Scripts run as root, affecting a different user | Must call `user::init \u003cusername\u003e` or `user::init::console` to set user. |\n| `jamf.sh` | Scripts run via Jamf Pro | * User functions automaticaly run on username supplied by Jamf as $3.\u003cbr\u003e* `$jamfUser` automatically set to `$3`\u003cbr\u003e* `$jamfHost` automatically set to `$2\u003cbr\u003e* `$jamfRoot` automatically set to `$1`\u003cbr\u003e* All arguments shifted, $4 becomes $1 |\n\n\n### User Functions\n\nAll functions based on user information in this library run on a specific _reference user_, based on the chosen sub file (see above) and the `user::init` function used.\n\n### Optional Installer Script\n\nIf your script is running as root, you can silently install the library using the 1-liner below:\n\n    /bin/bash -c \"$(curl -fsSL https://raw.githubusercontent.com/jonesiscoding/mac-libs/HEAD/bin/install.sh)\" || exit 1\n\nThe installer will check this repo for the most recent release, then if needed, download \u0026 extract to `/usr/local/sbin/lib/mac-libs/`.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonesiscoding%2Fmac-libs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjonesiscoding%2Fmac-libs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjonesiscoding%2Fmac-libs/lists"}