{"id":18644289,"url":"https://github.com/rphii/c-file-tagger","last_synced_at":"2025-04-11T12:30:58.703Z","repository":{"id":247296638,"uuid":"824113946","full_name":"rphii/c-file-tagger","owner":"rphii","description":"Simple CLI tool to store, systematically retrieve and manage tags of anything","archived":false,"fork":false,"pushed_at":"2025-02-14T21:45:29.000Z","size":1693,"stargazers_count":3,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-25T13:45:33.833Z","etag":null,"topics":["boolean-algebra","c","cli","command-line-tool","file-tagging","linux","lookup-table","tagging","tags","vector"],"latest_commit_sha":null,"homepage":"","language":"C","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/rphii.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-07-04T11:45:32.000Z","updated_at":"2025-02-14T21:45:32.000Z","dependencies_parsed_at":"2024-09-14T05:14:33.441Z","dependency_job_id":"c35815fa-e8b6-464c-993e-8d03dda3e6f7","html_url":"https://github.com/rphii/c-file-tagger","commit_stats":null,"previous_names":["rphii/c-file-tagger"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rphii%2Fc-file-tagger","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rphii%2Fc-file-tagger/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rphii%2Fc-file-tagger/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rphii%2Fc-file-tagger/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rphii","download_url":"https://codeload.github.com/rphii/c-file-tagger/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248401936,"owners_count":21097328,"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":["boolean-algebra","c","cli","command-line-tool","file-tagging","linux","lookup-table","tagging","tags","vector"],"created_at":"2024-11-07T06:11:10.872Z","updated_at":"2025-04-11T12:30:58.682Z","avatar_url":"https://github.com/rphii.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# EARLY VERSION\n# c-file-tagger\n\n[](https://github.com/rphii/c-file-tagger/assets/46871963/a05e7a42-4153-417c-8d75-81342cbb66dd)\n\n- *\\*The command* [`wp`](examples/wp.sh) *is just a bash script that sets my background from a list of files.*\n- *\\*The video is from an older date and the arguments have changed slighly*\n\n## Dependencies\n\n- [rphii/rphiic](https://github.com/rphii/rphiic)\n\n## Install\n\n    git clone https://github.com/rphii/c-file-tagger\n    cd c-file-tagger/src\n    make install\n\n## Usage\n\nList all tags:\n\n    cft --input tags.cft --list-tags\n    cft -il tags.cft\n\n    # list only tags of filename-A \u0026 filename-B\n    cft --input tags.cft --list-tags filename-A filename-B\n\nList all files:\n\n    cft --input tags.cft --list-files\n    cft -iL tags.cft\n\n    # list only files filename-A \u0026 filename-B\n    cft --input tags.cft --list-files filename-A filename-B\n\nList all tags with files associated\n\n    cft --input tags.cft --list-tags --list-files\n    cft -ilL tags.cft\n\n    # to disable decoration\n    cft --input tags.cft --list-tags --list-files --decoration no\n    cft -ilLd tags.cft no\n\nList all files with tags associated\n\n    cft --list-files --list-tags\n    cft -Ll\n\n    # to disable decoration\n    cft --input tags.cft --list-files --list-tags --decoration no\n    cft -iLld tags.cft no     # should in theory give the same output as your file(s) (combined)\n\nTags have to be matched exactly (yes, case sensitive). (...reminder that this is an early version,\nbut I want the program to be quite flexible later on, so I'm thinking of adding an option, or\nsomething...)\n\nList files associated with either `sky` or `cloud`:\n\n    cft --input tags.cft --any sky,cloud\n    cft -i tags.cft -O sky,cloud\n\nList files associated with `sky` and `cloud`:\n\n    cft --input tags.cft --and sky,cloud\n    cft -i tags.cft -A sky,cloud\n\nList files associated with neither `sky` nor `cloud`:\n\n    cft --input tags.cft --not sky,cloud\n    cft -i tags.cft -N sky,cloud\n\nIf one were to combine `--any` `--and` and `--not`, the current order is fixed and as written in the\ncurrent sentence. Later on I want to allow more complex expressions. One can for example search for\nany file with tags `sky` or `cloud`, of which include `girl` and `blue`, but is not `nfsw` nor\n`sketchy`:\n\n    cft --input tags.cft --any sky,cloud --and girl,blue --not nsfw,sketchy\n\nSearching files for substrings is also possible with the help of other CLI tools:\n\n    cft --input tags.cft --any $(cft --list-tags --decorate no | grep SUBSTRING-TO-SEARCH | tr '\\n' ',')\n    cft -i tags.cft -O $(cft -ld no | grep FUZZY-SEARCH | tr '\\n' ',')\n\nAlmost none of the other options work and are more of a sketched out plan or route I might take. All\nthe other options can be listed with:\n\n    cft --help\n\n## Adding Tags\n\nBy default no input nor output file is provided. Tag files have to end in `.cft`.\n\nThe file format is similar to that of a `.csv`. The first entry is a file name (or anything you\nwant, basically, doesn't have to be a file) and the rest are all tags associated with said file\n(delimiter is a comma).\n\nIt is possible to specify the use of **one output file**:\n\n    cft --output some/output/file.cft\n    cft -o some/output/file.cft\n\nOne can also specify **multiple** additional input files:\n\n    cft --input path/file-A.cft --input path/file-B.cft\n    cft -ii path/file-A.cft path/file-B.cft\n    cft --input ~/some/directory --recursive      # searches all files ending in *.cft recursively\n    cft -ir ~/some/directory\n\nIt is also possible to merge tag files. The sources are `--input` and it will merge into `--output`.\n\n    cft --merge -ii path/file-A.cft path/file-B.cft     # merge into default file\n    cft --merge -oii path/output.cft path/file-A.cft path/file-B.cft\n\nIf one has filenames in their tags file, one can let **cft** expand the paths using `--expand`.\n\n    cft --input tags.cft --expand --list-files\n    cft -ieL tags.cft\n\n    # this will expand based on the following rules\n    filename    -\u003e prepend directory of tags file, starting from root\n    ~/filename  -\u003e replace ~ with home directory\n    ../filename -\u003e prepend directory of tags file, starting from root. any '..' will also get replaced\n    /filename   -\u003e since already at root, do nothing (will still treat '..')\n\n## About Tags\n\nTags are your normal, run-off-the-mill strings, with one small exception: They support a basic\nfolder structure. You can simply make one with a `:`. So, one can for example, instead of tagging\nfiles with a generous:\n\n    dragon-ball-wallpaper,anime\n    bleach-wallpaper,anime\n    some-anime-wallpaper,anime\n\nrather use this approach:\n\n    dragon-ball-wallpaper,anime:dragon-ball\n    bleach-wallpaper,anime:bleach\n    some-anime-wallpaper,anime\n\nThe folder structuring with `:` allows for more than a single level, too.\n\nWhen searching for files with `anime`, one will find all three files regardless of folder or not.\nTo only find the Bleach-Wallpaper, you would do `cft --any anime:bleach`, which will respect your\nchoice of tag and only list those tagged accordingly.\n\nTo add tags with the cli to **one output file**, one can do:\n\n    cft -o path/output.cft string-to-tag --tag list,of,tags\n    cft -o path/output.cft string-to-tag -t list,of,tags\n\n### TODO so I won't forget\n- undo? hmm\n- -lL filename = wrong count of files in description!\n- don't add -t tag: (empty subfolder) as tag\n- clean up the code since it's messy -\u003e especially since I switched from array of tags to lookup tables ...\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frphii%2Fc-file-tagger","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frphii%2Fc-file-tagger","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frphii%2Fc-file-tagger/lists"}