{"id":23509115,"url":"https://github.com/scriptingosx/swift-prefs","last_synced_at":"2025-09-02T04:09:34.555Z","repository":{"id":229029474,"uuid":"775088195","full_name":"scriptingosx/swift-prefs","owner":"scriptingosx","description":"Some tools to work with macOS preferences/defaults/settings","archived":false,"fork":false,"pushed_at":"2024-03-22T09:28:27.000Z","size":20,"stargazers_count":38,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-04-17T04:37:18.305Z","etag":null,"topics":["command-line-tool","configuration-profiles","defaults","macadmins","macos","plist","swift"],"latest_commit_sha":null,"homepage":"","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/scriptingosx.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}},"created_at":"2024-03-20T18:31:16.000Z","updated_at":"2025-04-06T22:54:12.000Z","dependencies_parsed_at":"2024-12-25T11:37:55.813Z","dependency_job_id":"be904437-bdfe-49e9-b1bf-4a5cfb0f5ab3","html_url":"https://github.com/scriptingosx/swift-prefs","commit_stats":null,"previous_names":["scriptingosx/swift-prefs"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/scriptingosx/swift-prefs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptingosx%2Fswift-prefs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptingosx%2Fswift-prefs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptingosx%2Fswift-prefs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptingosx%2Fswift-prefs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/scriptingosx","download_url":"https://codeload.github.com/scriptingosx/swift-prefs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/scriptingosx%2Fswift-prefs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273228142,"owners_count":25067732,"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-02T02:00:09.530Z","response_time":77,"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":["command-line-tool","configuration-profiles","defaults","macadmins","macos","plist","swift"],"created_at":"2024-12-25T11:37:48.941Z","updated_at":"2025-09-02T04:09:34.538Z","avatar_url":"https://github.com/scriptingosx.png","language":"Swift","readme":"# swift-prefs\n\nA selection of command line tools for working with setting/defaults/preferences on macOS.\n\n## `prefs`\n\nThis tool is inspired by [Greg Neagle's `fancy_defaults_read.py`](https://gist.github.com/gregneagle/010b369e86410a2f279ff8e980585c68) and a remake of [my earlier Python tool](https://github.com/scriptingosx/PrefsTool).\n\nIn the simplest use case you can just pass the app identifier:\n\n```\n% prefs com.apple.screensaver\nmoduleDict [host]: {\n    moduleName = \"Computer Name\";\n    path = \"/System/Library/Frameworks/ScreenSaver.framework/PlugIns/Computer Name.appex\";\n    type = 0;\n}\nPrefsVersion [host]: 100\nidleTime [host]: 0\nlastDelayTime [host]: 1200\ntokenRemovalAction [host]: 0\nshowClock [host]: 0\nCleanExit [host]: 1\n```\n\nThe tool will print _all_ composited preferences keys and their type and value, with the preference domain where the value was set. The output format is:\n\n```\nprefKey [domain]: value\n```\n\nA preference domain of `managed` means the value is set with a configuration profile.\n\nWhile preference values set in `.GlobalPreferences.plist` in the different domains are composited into the the application defaults, they are _not_ shown by default, since there are many of them and they will make the output fairly unreadable. If you want to see them add the `--globals` (or `-g`) option:\n\n```\n% prefs --globals com.apple.screensaver\n```\n\nYou can also add one or more keys after the app identifier to get just specific values:\n\n```\n% prefs com.apple.screensaver idleTime AppleLocale       \nidleTime [host]: 0\nAppleLocale [global/user]: en_US@rg=nlzzzz\n```\n\nYou can also add the `--value` option to show just the value in the output (might be useful when you want to get the composited value for another script.\n\n```\n% prefs --value com.apple.screensaver idleTime\n1200\n```\n\n### Known Issues\n\n- doesn't read preferences of sandboxes apps from their containers\n\n## plist2profile\n\nThis tool is a re-interpretation in Swift of [Tim Sutton's mcxToProfile](https://github.com/timsutton/mcxToProfile).\n\nIt will convert a normal flat plist file into a custom mobileconfig/configuration profile that can be used for manual installation or with an MDM server.\n\nIn the simplest form, use it like this:\n\n```\n% plist2profile --identifier example.settings com.example.settings.plist\n```\n\nThis will generate a file named `example.settings.mobileconfig` in the current working directory which manages the preference keys in the `com.example.settings.plist` in the `com.example.settings` preference domain. You can add multiple plist files.\n\nThe preference domain for the settings is determined from the file name of each plist file given (removing the `plist` file extension).\n\nYou can add a display and organization name that will be used in the respective fields using the `--displayname` and `--organization` options.\n\nBy default, the profile is created with a `System` scope. you can change it to `User` with the `--user` flag.\n\nThere are two ways to assemble custom preference profile, the 'traditional' mcx format and a more modern format, which [Bob Gendler described in this post](https://boberito.medium.com/config-profile-and-manage-all-the-things-just-about-cafea8627d4b). This tool creates the modern format by default, but can also create the traditional format when you set the `--mcx` key.\n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptingosx%2Fswift-prefs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fscriptingosx%2Fswift-prefs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fscriptingosx%2Fswift-prefs/lists"}