{"id":16852631,"url":"https://github.com/deckarep/watchman","last_synced_at":"2025-03-18T10:16:57.836Z","repository":{"id":204073772,"uuid":"637950962","full_name":"deckarep/watchman","owner":"deckarep","description":"Watchman is a tool/script that will watch a folder based on a file specification and execute a transform. Early development. Tested on MacOS only.","archived":false,"fork":false,"pushed_at":"2023-10-29T00:56:12.000Z","size":30,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-01-24T16:35:32.724Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"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/deckarep.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":"2023-05-08T19:02:49.000Z","updated_at":"2023-05-08T19:05:12.000Z","dependencies_parsed_at":"2024-01-18T00:08:57.063Z","dependency_job_id":null,"html_url":"https://github.com/deckarep/watchman","commit_stats":null,"previous_names":["deckarep/watchman"],"tags_count":2,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deckarep%2Fwatchman","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deckarep%2Fwatchman/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deckarep%2Fwatchman/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/deckarep%2Fwatchman/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/deckarep","download_url":"https://codeload.github.com/deckarep/watchman/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244198395,"owners_count":20414443,"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","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":[],"created_at":"2024-10-13T13:48:06.999Z","updated_at":"2025-03-18T10:16:57.831Z","avatar_url":"https://github.com/deckarep.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"## Watchman\n\n### Objective\n\nThis tool currently only targets `MacOS desktop` environments and acts as a background process which monitors a designated\nfolder that allows a user the ability to drag and drop files to a designated folder which causes a command to be executed \nfor each file. This background process is meant to be very simple to use and tweak the behavior of the command so as not \nto incapacitate the user's computer.\n\n### Developer Note\n\nThis tool is not yet stable or well documented and not yet production ready. Use at your own risk.\n\n\n### Configuration\n\nHere is a *sample configuration* for an imaginary command line tool called `oggify` that converts `.ogg` files to `.mp3`. \nSuch a tool is not part of this repo but a tool that you would find suitable to be regularly used in your conversion \nworkflow. Perhaps a tool such as `ffmpeg` or a tool that can convert `.doc` files to `.pdf` as an example.\n\n```json\n{\n  \"primary_interval\": \"30s\",\n  \"max_workers\": 3,\n  \"entries\": [\n    {\n      \"name\": \"oggify.mp3.to.ogg.converter\",\n      \"interval\": \"2m\",\n      \"command\": \"/usr/local/bin/oggify\",\n      \"args\": [\n        \"--in\",\n        \"{SOURCE_FILE}\",\n        \"--out\",\n        \"{DEST_FILE}\",\n        \"--additional-args\"\n      ],\n      \"folder\": \"~/Desktop/folder-to-watch/\",\n      \"from_ext\": \".mp3\",\n      \"to_ext\": \".ogg\"\n    }\n  ]\n}\n```\n\n### Usage\n\n#### Installation\n\nFirst, install Watchman using the usual Go toolchain commands.\n```sh\ngo get github.com/deckarep/watchman\ngo build\n```\n\nNext, create your config: `config.json` file as needed and refer to the sample above.\n\nInstall the service using:\n```sh\n./Watchman install config/your_config.json \n```\n\nIf everything worked correctly, your service config file and the Watchman binary were copied here. The Watchman binary \nacts both a controller for you; the end user but is also responsible for running your service configs as needed:\n```sh\n/Users/{USER}/Library/Application Support/com.{USER}.scripts.go.watchman.svc\n```\n\nAdditionally, the service should be running at this point:\n```sh\n./Watchman status\n\n# Output:\n# Command.status: \"running\" , Current PID: 60098, Last exit status: 0\n```\n\nTo stop or remove the service:\n```sh\n# TODO\n```\n\n#### Troubleshooting:\n\nWatchman can run locally while you are trying to work out your config file and conversion binaries. Just invoke it with\nno arguments.\n```sh\n./Watchman\n```\n\nTailing the service logs:\n```\ntail -f /tmp/com.{USER}.scripts.go.watchman.svc.log\n```\n\n### Ignore below, this tool will now manage the creation of launch configs.\n\nCreating a MacOS launch config to manage this process\n* Easy [Launchd Config Creator Here!](https://launched.zerowidth.com/)\n* [Further reference](https://www.launchd.info/)","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeckarep%2Fwatchman","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdeckarep%2Fwatchman","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdeckarep%2Fwatchman/lists"}