{"id":25937947,"url":"https://github.com/lanseria/wr-cl","last_synced_at":"2025-10-10T14:13:45.638Z","repository":{"id":278489880,"uuid":"935791244","full_name":"lanseria/wr-cl","owner":"lanseria","description":"word replacer command line tool","archived":false,"fork":false,"pushed_at":"2025-02-27T03:47:19.000Z","size":375,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-03-04T03:33:57.976Z","etag":null,"topics":["cli","docx","python","replacer","word"],"latest_commit_sha":null,"homepage":"","language":"Python","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/lanseria.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":"2025-02-20T02:56:39.000Z","updated_at":"2025-02-27T03:46:57.000Z","dependencies_parsed_at":"2025-02-20T04:21:30.180Z","dependency_job_id":"3b3cb7e0-de21-4fed-b5a9-e36fd7baea0d","html_url":"https://github.com/lanseria/wr-cl","commit_stats":null,"previous_names":["lanseria/wr-cl"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/lanseria/wr-cl","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanseria%2Fwr-cl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanseria%2Fwr-cl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanseria%2Fwr-cl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanseria%2Fwr-cl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lanseria","download_url":"https://codeload.github.com/lanseria/wr-cl/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lanseria%2Fwr-cl/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":279004178,"owners_count":26083688,"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-10-10T02:00:06.843Z","response_time":62,"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":["cli","docx","python","replacer","word"],"created_at":"2025-03-04T03:32:06.473Z","updated_at":"2025-10-10T14:13:45.621Z","avatar_url":"https://github.com/lanseria.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wr-cl\n\nword replacer command line tool\n\n## 介绍\n\n这是一款命令行工具，用于替换 word docx 文件中的指定单词。\n\n## 特点\n\n- 不改变原 word 样式\n- 命令行工具，方便使用\n- 支持批量替换，可以一次替换多个文件\n- 支持正则表达式，可以匹配多个单词\n- 使用 `python3` `pyinstaller` 打包成cli文件，方便 windows/macos/linux 用户使用\n- 支持多线程处理，加速处理速度\n- 使用 github actions 自动打包 windows/macos/linux 各个平台的cli文件，供下载\n\n## 下载解压\n\n[下载地址](https://github.com/lanseria/wr-cl/releases)\n\n## 使用方法\n\n1. 创建配置文件 `config.json`:\n\n```json\n{\n  \"replacements\": {\n    \"pattern_type\": \"plain|regex\",\n    \"rules\": [\n      {\n        \"old_text\": \"\\\\b公司A\\\\b\",\n        \"new_text\": \"DeepSeek\",\n        \"options\": {\n          \"case_sensitive\": true,\n          \"whole_word\": true,\n          \"preserve_format\": true\n        }\n      }\n    ]\n  },\n  \"file_settings\": {\n    \"input_path\": \"./docs\",\n    \"output_path\": \"./modified\"\n  },\n  \"advanced\": {\n    \"max_workers\": 4,\n    \"timeout\": 30\n  }\n}\n```\n\n2. 运行命令：\n\n```bash\nwr-cl --config config.json\n```\n\n### 可选参数\n\n- `--dry-run`: 预览模式，不会修改原文件\n- `--log-level`: 日志等级 (debug/info/warning/error)\n\n## 开发\n\n1. 克隆仓库：\n\n```bash\ngit clone https://github.com/lanseria/wr-cl.git\ncd wr-cl\n```\n\n2. 安装依赖：\n\n```bash\n# 创建虚拟环境（venv 是 Python 内置工具）\npython3 -m venv myenv\n# macOS/Linux\nsource myenv/bin/activate\n\n# Windows (PowerShell)\n.\\myenv\\Scripts\\Activate.ps1\n\npip install .\n\npip install \".[dev]\"\n\npip install \".[build]\"\n\ndeactivate\n```\n\n3. 运行测试：\n\n```bash\npytest\n# 运行代码格式化\nblack .\nisort .\n```\n\n4. 打包\n\n```bash\nrm -rf dist/ build/\npython build.py\n```\n\n5. 运行\n\n```bash\n# 复制配置模板\ncp config.json.template config.json\n# 编辑配置文件，修改所需的替换规则\n\n# Windows\ndist\\wr-cl.exe --config config.json\n\n# macOS/Linux\n./dist/wr-cl --config config.json\n```\n\n6. 发布\n\n```bash\ngit tag -d v1.1.0 \ngit push origin --delete v1.1.0\ngit tag -a v1.1.0 -m \"Release version 1.1.0\"\ngit push origin v1.1.0\n```\n\n## 许可证\n\nMIT","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanseria%2Fwr-cl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flanseria%2Fwr-cl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flanseria%2Fwr-cl/lists"}