# ewx **Repository Path**: ouhaoqiang/ewx ## Basic Information - **Project Name**: ewx - **Description**: 一个用于替换Word、Excel模板的服务。 目前支持docx、xlsx格式 - **Primary Language**: Unknown - **License**: MIT - **Default Branch**: master - **Homepage**: None - **GVP Project**: No ## Statistics - **Stars**: 0 - **Forks**: 0 - **Created**: 2026-02-03 - **Last Updated**: 2026-02-13 ## Categories & Tags **Categories**: Uncategorized **Tags**: Word, Excel, docx, xlsx, 办公 ## README # ewx ## 运行服务 ### linux ```shell ./ewx ``` ### windows - Windows系统,运行后会自动跳转浏览器打开 ```shell # 使用cmd命令窗口运行 ewx.exe ``` ## 命令帮助 ```shell ./ewx -h # 或 ewx.exe -h ``` ## 命令行快速使用 1. 你需要创建一个Excel文件`test.xlsx`,在任意单元格填入{{ .name }}、{{ .age }}等替换用的占位符。 如此链接下的文件: [file](https://gitee.com/ouhaoqiang/ewx/tree/master/server/test/file) 2. 创建一个`config.yaml`配置文件,内容如下: 如此文件: [config.yaml](https://gitee.com/ouhaoqiang/ewx/raw/master/server/test/config.yaml) ```yaml name: 张三 age: 18 ``` 3. 执行替换 ```shell ewx excel test.xlsx ``` 4. 查看是否替换完成 > 会在当前目录下生成`._xxxxxxxx-xxxxxx`格式的目录 > > 如果是Windows系统,会自动打开生成的目录 ## 编译构建 ### 使用makefile编译 ```shell git clone https://gitee.com/ouhaoqiang/ewx.git cd ./ewx/cmd/ewx/ make build ./ewx version ``` ### 手动编译 ```shell git clone https://gitee.com/ouhaoqiang/ewx.git # 先构建前端(前端页面需要嵌套在二进制文件中的, 所以需要先构建前端) cd ./ewx/web/ pnpm install pnpm run release # 确认构建成功 ls ../server/app/router/dist/ # 构建二进制文件 cd ../cmd/ewx/ go mod tidy go build ./ewx version ``` ## 依赖库 - 本项目使用"github.com/xuri/excelize/v2"操作Excel文件,感谢该库的作者提供的便利。[excelize](https://github.com/xuri/excelize)