{"id":13621123,"url":"https://github.com/balacode/cmdx","last_synced_at":"2026-02-04T05:16:11.615Z","repository":{"id":57579369,"uuid":"122683018","full_name":"balacode/cmdx","owner":"balacode","description":"A command line tool to process files and source code. Delete duplicate files. Make hundreds of simultaneous text replacements.","archived":false,"fork":false,"pushed_at":"2022-05-20T08:38:27.000Z","size":253,"stargazers_count":9,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-11-08T07:39:47.619Z","etag":null,"topics":["file-handling","file-management","logging","text-processing","time-management"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/balacode.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}},"created_at":"2018-02-23T23:22:45.000Z","updated_at":"2023-09-08T17:37:06.000Z","dependencies_parsed_at":"2022-09-26T19:12:10.430Z","dependency_job_id":null,"html_url":"https://github.com/balacode/cmdx","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balacode%2Fcmdx","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balacode%2Fcmdx/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balacode%2Fcmdx/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/balacode%2Fcmdx/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/balacode","download_url":"https://codeload.github.com/balacode/cmdx/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248972899,"owners_count":21191879,"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":["file-handling","file-management","logging","text-processing","time-management"],"created_at":"2024-08-01T21:01:02.714Z","updated_at":"2026-02-04T05:16:11.582Z","avatar_url":"https://github.com/balacode.png","language":"Go","funding_links":[],"categories":["Go"],"sub_categories":[],"readme":"# CMDX Utilities Suite\nA command line tool to manage files and process source code.\n\nThis tool is a sort of Swiss-Army-Knife for managing files and text processing.\nI wanted to avoid having too many little command line utilities,\nso I created CMDX which means Command-line Extensions.\n\n## Installation:\nUse `go get` to install the utility and its dependencies. (If you use `git clone`, you'll have to also clone `zr` and `zr_fs` manually and make sure they're in the github.com/balacode branch.)\n\n    go get github.com/balacode/cmdx\n\nThis will also install *github.com/balacode/zr* and *github.com/balacode/zr_fs* libraries (Zircon-Go) which CMDX uses. Once installed, change to `{go src path}/github.com/balacode/cmdx` and type `go build`.\n\n## Usage Guide:\n\n*I am in the process of adding a detailed explanation for the usage of each command. In the meantime, you can check the source code or ask me directly. Your questions will help make the documentation more concise.*\n\nBelow is a brief summary of the available commands.\n\n## File Manipulation Commands:\n\n**DD (del-dup): Delete Duplicates**\n\n    cmdx dd /source /target\n\nDeletes all files in /target that already exist in /source.\nThe command does not care about file names.\nInstead it compares the contents of files with identical sizes.\n\n**Use this command with care: files are deleted without going to trash can** :exclamation:\n\n**LD (list-dup): List Duplicate Files**\nLists duplicate files in the specified folder (or source and target folders).\nDoes not delete or change any files.\n\nTo list all identical files in /source folder:\n\n    cmdx ld /source\n\nTo list list all files in */target* that have identical files in */source*:\n\n    cmdx ld /source /target\n\n**RD (ren-dup): Rename Duplicate Files**\n\nGiven two folder paths: */source* and */target*,\nthis command finds files in /target that are identical to files\nin /source and renames them to their file names in /source:\n\n    cmdx rd /source /target\n\n**RH (ren-hash): Rename-Hash**\nRenames files by prefixing their name with a hash.\n\n## Text Manipulation Commands:\n\n**FW (file-words):**\nLists all words with alphanumeric characters from {file}:\n\n    cmdx fw {file}\n\n**ME (mark-errors):**\nInserts build errors as comments at the source of the error,\nso you don't need to manually look-up the line numbers and\nfile names to edit. Just use your editor to find all error\nmarkers, fix the error, and delete the comment when the error\nis fixed.\n\nTo make this command work, send the output of the\n`go build` or `go install` command to a build log file:\n\n    go build -gcflags=\"-e\" 2\u003e build.log\n\nThe `=gcflags=\"-e\"` option instructs the Go compiler to\noutput all build errors. Without this option, the compiler\nstops reporting errors after about 10 errors.\n\nNext, run the mark-errors command with the name of the build log:\n\n    cmdx mark-errors -buildlog=.\\build.log\n\nAfter you run the command, you will see comments such as the following:\n\n```go\n    func main() {\n        var args = os.Args\n        if len(args) = 1 {\n                   //^ syntax error: len(args) = 1 used as value\n        }\n    ...\n```\n\n**MT (mark-time):**\nChanges timestamps in source files.\nRequires paths (in hardcoded.go) to be set up.\n\n**RL (rep-lines):**\nReplaces lines in file(s). Requires {command-file}.\nThis command allows you to replace several blocks of code at once.\n\n**RS (replace-strings):**\nMakes multiple (different) replacements simultaneously in multiple files.\nYou can make thousands of simultaneous replacements as the command\nuses goroutines to search and replace multiple files concurrently\nonce they are loaded in RAM.\n\n    cmdx rs replacements.repl\n\nThe path, the types of files and the replacements are\nspecified in a replacements file. Example replacements file:\n\n    mark ~~\n    path X:\\path\n    case on\n    word on\n\n    ~~ comment\n\n    find1 ~~ replace1\n    find2 ~~ replace2\n    for (var i = 0; i \u003c 10; i++) {  ~~  for i := 0; i \u003c 10; i++ {\n\n- mark: the delimiter to denote comments and separate search and replacement text.\n- path: the replacement path (also replaces subfolders). You can only specify one path, for now.\n- case: set 'on' to match case, or 'off' to ignore case.\n- word: set 'on' to match whole words, or 'off' to replace substrings.\n- comments start with the marker.\n- text to find is on the left of '~~' and the replacement text on the right. You can list as many replacements as needed.\n\n**SF (sort-file):**\n\n    cmdx sf {filename}\n\nSorts all lines in a file and deletes duplicate lines.\nThis command is useful for sorting log files, dictionary lists, etc.\n\n## Other Commands:\nMore specifics on these commands will be provided later.\n\n**RT (rep-time):**\nReplaces time entries in log files.\n\n**RI (run):**\nRuns the tool in source-code interactive mode.\n\n**TR (time-report):**\nSummarizes time from log files and presents it in a calendar format.\nFor example:\n\n    2018 FEBRUARY\n    *-----------------------------------------------------------------------*\n    |  Mon   |  Tue   |  Wed   |  Thu   |  Fri   |  Sat   |  Sun   |  SUM   |\n    |--------|--------|--------|--------|--------|--------|--------|--------|\n    |        |        |        | 1      | 2      | 3      | 4      |   (26) |\n    |        |        |        |   8.44 |   7.55 |   6.66 |   5.77 |  28.42 |\n    |--------|--------|--------|--------|--------|--------|--------|--------|\n    | 5      | 6      | 7      | 8      | 9      | 10     | 11     |   (13) |\n    |   4.88 |   3.99 |   2.15 |   1.54 |      0 |      1 |      2 |  15.56 |\n    |--------|--------|--------|--------|--------|--------|--------|--------|\n    | 12     | 13     | 14     | 15     | 16     | 17     | 18     |   (22) |\n    |    1.15|    6.8 |   3.91 |        |   4.32 |    8.9 |        |  25.08 |\n    |--------|--------|--------|--------|--------|--------|--------|--------|\n    | 19     | 20     | 21     | 22     | 23     | 24     | 25     |   (10) |\n    |     10 |        |        |        |        |        |        |   10.0 |\n    |--------|--------|--------|--------|--------|--------|--------|--------|\n    | 26     | 27     | 28     |        |        |        |        |        |\n    |        |        |        |        |        |        |        |        |\n    |--------|--------|--------|--------|--------|--------|--------|--------|\n    |        |        |        |        |        |        |        |        |\n    |        |        |        |        |        |        |        |        |\n    *-----------------------------------------------------------------------*\n    (71)\n    95.98\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalacode%2Fcmdx","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbalacode%2Fcmdx","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbalacode%2Fcmdx/lists"}