{"id":28817502,"url":"https://github.com/rafaelcn/auto-move","last_synced_at":"2025-10-16T18:54:59.507Z","repository":{"id":84574953,"uuid":"220328239","full_name":"rafaelcn/auto-move","owner":"rafaelcn","description":"A tool to move files based on a set of rules (defined by you)","archived":false,"fork":false,"pushed_at":"2023-11-14T15:27:02.000Z","size":40,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-10-31T02:12:09.753Z","etag":null,"topics":["go","tool"],"latest_commit_sha":null,"homepage":"","language":"Go","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/rafaelcn.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":"2019-11-07T21:01:30.000Z","updated_at":"2024-01-14T12:45:04.000Z","dependencies_parsed_at":"2024-06-21T14:25:05.992Z","dependency_job_id":"fbb02127-45b6-4188-a93f-dd95f16afe9f","html_url":"https://github.com/rafaelcn/auto-move","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/rafaelcn/auto-move","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelcn%2Fauto-move","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelcn%2Fauto-move/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelcn%2Fauto-move/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelcn%2Fauto-move/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rafaelcn","download_url":"https://codeload.github.com/rafaelcn/auto-move/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rafaelcn%2Fauto-move/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260606540,"owners_count":23035357,"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":["go","tool"],"created_at":"2025-06-18T18:12:54.540Z","updated_at":"2025-10-16T18:54:59.501Z","avatar_url":"https://github.com/rafaelcn.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Auto Move\n\nA tool to move files based on a set of rules, defined by you. The rules are \nencoded in a JSON file, and many rules can be written (each one in a \nrespective) .json file.\n\nSome examples of rules are given in the rules directory and each rule is of a \nrespective _type_ with an empty predicate.\n\n## Rules\n\nAs said before, each rule is defined in a json file and the basic structure of \na given rule is defined below:\n\n```\n{\n    \"dirs\": {\n        \"watch\": [\n            \"\"\n        ],\n        \"to\": \"\"\n    },\n\n    \"rule\": {\n        \"type\": \"\",\n        \"predicate\": []\n    }\n}\n```\n\nAuto move can watch an array of directories as show inside the `dirs` object and \nall of the files inside of it, that follows the given predicate, will be moved to\nthe `to` directory.\n\nA rule is made up of two things, a **type** and a **predicate**. A type can be \none of the four defined below:\n\n- filetype\n- filename\n- prefix\n- suffix\n\nMore types can (and might) be implemented in the code. \n\nThe types itself - well, defines the type of the rule - instructs how a predicate \nwill be writtten. A filetype rule will accept predicates of file extensions to be\nused, that means the auto-move will look for all defined file extensions in \npredicate in order to know what has to be moved or not.\n\nA filename rule roughly interpreted as a _regex_, although is not a _regex_ per say\nit will follow a predicate pattern in order to know what file has to be moved. There\nare only two types of predicates that can be used to represent a filename: an unicode \nletter that is represented in the predicate with the letter `L` and a digit that is \nrepresented in the predicate with the letter `D`. Combined, the two patterns can be\nused to match the following filenames:\n\n- `filename-2018-05-23.txt` can be matched with `LLLLLLLL-DDDD-DD-DD.txt`\n- `coração-1.txt` can be matched with `LLLLLLL-D.txt`\n\nAll alphanumeric digits which aren't specified with the `L` or `D` have to\nbe math exactly as they are in the filename. One side note on this type is that I \nhaven't tried this with non latin letters so be aware that problems might occur. \n\nThe prefix and suffix types are quite easy to understand as they just filter the\nprefix or suffix alphanumeric digits of a filename. Note that these two types \ndoesn't implement the matching rules of the previously defined type.\n\n## Build\n\nTo build the code you can simply call `go` directly with a build instruction or\nuse the defined Makefile in Unix like systems which support make. An example of\nhow the project can be build is shown below for reference.\n\n`go build -o auto-move.exe main.go config.go move.go watch.go`","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelcn%2Fauto-move","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frafaelcn%2Fauto-move","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frafaelcn%2Fauto-move/lists"}