zen-gitsync 2.12.6 → 2.12.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. package/README.md +695 -695
  2. package/package.json +1 -1
  3. package/scripts/README_COLOR_CONVERTER.md +196 -196
  4. package/scripts/README_FONTSIZE_CONVERTER.md +278 -278
  5. package/scripts/README_SPACING_CONVERTER.md +126 -126
  6. package/scripts/README_STYLE_VARS.md +180 -180
  7. package/src/ui/public/assets/EditorView-DDyMmxPI.js +0 -0
  8. package/src/ui/public/assets/{EditorView-DEd8QuPp.css → EditorView-DK-Xgt7r.css} +1 -1
  9. package/src/ui/public/assets/SourceMapView-DakscAmd.js +3 -0
  10. package/src/ui/public/assets/{css.worker-Wv5dxAWO.js → css.worker-CvXBzhp8.js} +1 -1
  11. package/src/ui/public/assets/{html.worker-CQP8QQsS.js → html.worker-BO6WuOEO.js} +1 -1
  12. package/src/ui/public/assets/index-CPUqt5Ue.js +73 -0
  13. package/src/ui/public/assets/index-a-r8YYZJ.css +1 -0
  14. package/src/ui/public/assets/{json.worker-DzV-CpCQ.js → json.worker-BkJRGcCJ.js} +1 -1
  15. package/src/ui/public/assets/{ts.worker-Dth06zuC.js → ts.worker-B0J26iPs.js} +15 -15
  16. package/src/ui/public/assets/{vendor-BB71wW_m.js → vendor-BMFU1ekz.js} +249 -242
  17. package/src/ui/public/assets/vendor-BPPhhD0O.css +1 -0
  18. package/src/ui/public/favicon.svg +75 -75
  19. package/src/ui/public/index.html +22 -22
  20. package/src/ui/public/logo.svg +74 -74
  21. package/src/ui/public/assets/EditorView-CItjMDNe.js +0 -0
  22. package/src/ui/public/assets/SourceMapView-qlixRY_C.js +0 -3
  23. package/src/ui/public/assets/index-BFhllyJb.js +0 -73
  24. package/src/ui/public/assets/index-wBVvNuoD.css +0 -1
  25. package/src/ui/public/assets/vendor-B2yudN8R.css +0 -1
  26. /package/src/ui/public/assets/{editor.worker-Bd9IXS8d.js → editor.worker-Cn2oRESe.js} +0 -0
  27. /package/src/ui/public/assets/{rolldown-runtime-BM3Ffeng.js → rolldown-runtime-CMxvf4Kt.js} +0 -0
package/README.md CHANGED
@@ -1,695 +1,695 @@
1
- # zen-gitsync
2
-
3
- [English](#zen-gitsync) | [中文](#zh)
4
-
5
- A Git automation platform with interactive commits, scheduled sync, custom command orchestration, file locking, and a visual GUI.
6
-
7
- ## Table of Contents
8
-
9
- - [Installation](#installation)
10
- - [What''s New](#v2xx--whats-new)
11
- - [GUI](#gui)
12
- - [Core Git Panel](#core-git-panel)
13
- - [Branch Management](#branch-management)
14
- - [Stash Management](#stash-management)
15
- - [Tag Management](#tag-management)
16
- - [Commit Message Templates](#commit-message-templates)
17
- - [Custom Commands](#custom-commands)
18
- - [Flow Orchestration](#flow-orchestration-visual-workflow-designer)
19
- - [NPM Scripts Panel](#npm-scripts-panel)
20
- - [Built-in Terminal](#built-in-terminal)
21
- - [Project Startup](#project-startup)
22
- - [Built-in Code Editor](#built-in-code-editor)
23
- - [Source Map](#source-map-ai-codebase-visualization)
24
- - [Settings](#settings)
25
- - [CLI Commands](#cli-commands)
26
-
27
- ---
28
-
29
- ## Installation
30
-
31
- Install globally via npm:
32
-
33
- ```bash
34
- npm install -g zen-gitsync
35
- ```
36
-
37
- ---
38
-
39
- ## v2.x.x — What''s New
40
-
41
- - **Visual GUI** — Full graphical interface for Git operations
42
- - **Branch management** — Create, switch, and track local/remote branches
43
- - **Stash management** — Save and restore stashes with locked-file filtering
44
- - **Tag management** — Create lightweight and annotated tags
45
- - **Merge support** — Detect and complete in-progress merges
46
- - **Flow orchestration** — Drag-and-drop visual workflow designer
47
- - **NPM scripts panel** — Discover and run npm scripts from `package.json`
48
- - **Built-in terminal** — Run commands with real-time streaming output
49
- - **Custom commands** — Save, parameterize, and reuse shell commands
50
- - **Project startup** — Auto-run commands or workflows when a project opens
51
- - **Built-in code editor** — Monaco-based file editor with Markdown preview
52
- - **Source map** — AI-generated interactive codebase dependency graph
53
- - **AI commit message** — Generate commit message from staged diff automatically
54
- - **Commit templates** — Save type/scope/description/message templates
55
- - **Theme & language** — Light/dark theme and Chinese/English UI
56
-
57
- ---
58
-
59
- ## GUI
60
-
61
- ### Launch the GUI:
62
- ```shell
63
- $ g ui
64
- ```
65
-
66
- ![ui](https://raw.githubusercontent.com/xz333221/zen-gitsync/main/public/images/zen-gitsync-ui-git.png)
67
-
68
- The GUI runs as a local web server and opens in your default browser. It attaches to the current Git repository automatically. The activity bar on the left switches between three views: **Git**, **Editor**, and **Source Map**.
69
-
70
- ---
71
-
72
- ### Core Git Panel
73
-
74
- | Feature | Description |
75
- |---|---|
76
- | File list | Shows all changed files grouped by staged / unstaged / untracked / conflicted |
77
- | View toggle | Switch between flat list and directory tree view (persisted) |
78
- | Selection mode | Multi-select files to stage or stash only chosen files. When the Git view is the active tab, **Quick Commit / Quick Push** and **AI commit message** automatically scope their action to the current selection (button label switches to *Commit Selected* / *Push Selected*). |
79
- | Per-file actions | Stage, unstage, or revert individual files |
80
- | Stage | Stage all or selected files (respects locked files) |
81
- | Commit | Structured form (type / scope / description / body / footer) or free-text |
82
- | AI commit message | Generate commit message from staged diff using an AI model |
83
- | Push | Push to remote with live progress modal |
84
- | Quick commit+push | One-click stage → commit → push |
85
- | Pull / Fetch | Pull from or fetch the upstream branch |
86
- | Merge | Merge another branch; detects and surfaces in-progress merge state |
87
- | Diff viewer | Monaco-based side-by-side diff for any changed file |
88
- | Commit log | Browse commit history with author, date, branch tags, and changed files |
89
- | Remote URL | Display and one-click copy the remote repository URL |
90
- | Auto-refresh | Silently refreshes status and branch info when the window gains focus, the tab becomes visible, or you switch back to the **Git** view in the Activity Bar |
91
-
92
- #### Structured Commit Form
93
-
94
- The commit form supports two modes toggled by a switch:
95
-
96
- - **Standard mode** — separate fields for type (`feat` / `fix` / `docs` / `style` / `refactor` / `test` / `chore`), scope, short description, body, and footer — produces a Conventional Commits message automatically
97
- - **Free-text mode** — single text area for any commit message
98
-
99
- In either mode, click **AI Generate** to fill in the fields automatically based on the staged diff.
100
-
101
- ---
102
-
103
- ### Branch Management
104
-
105
- - View all local and remote branches
106
- - Create a new branch from any base branch
107
- - Switch branches
108
- - Track upstream status (commits ahead / behind)
109
-
110
- ---
111
-
112
- ### Stash Management
113
-
114
- - Save stash with an optional message
115
- - Optionally include untracked files
116
- - Optionally exclude locked files from stash
117
- - Apply, pop, or drop individual stash entries
118
-
119
- ---
120
-
121
- ### Tag Management
122
-
123
- - Create **lightweight** or **annotated** tags
124
- - Target a specific commit
125
- - List, push, or delete tags
126
-
127
- ---
128
-
129
- ### Commit Message Templates
130
-
131
- Save reusable templates for:
132
- - **Type** — `feat`, `fix`, `chore`, …
133
- - **Scope** — component or module name
134
- - **Description** — short summary
135
- - **Full message** — complete commit message
136
-
137
- ---
138
-
139
- ### Custom Commands
140
-
141
- ![Command Orchestration](https://home.flowdash.cn/upload/VditorFiles/2026-1/zen-gitsync_SBAJdlvm.png)
142
-
143
- Create, manage, and run shell commands from the sidebar:
144
-
145
- - Define commands with a name, shell command, and working directory
146
- - Add **parameters** with names, descriptions, and default values (referenced via `{{paramName}}`)
147
- - Run a command instantly in a new terminal session
148
- - Save command **templates** for quick reuse
149
-
150
- ---
151
-
152
- ### Flow Orchestration (Visual Workflow Designer)
153
-
154
- Build automated pipelines with a drag-and-drop canvas:
155
-
156
- | Node type | Purpose |
157
- |---|---|
158
- | **Start** | Entry point of the flow (one per flow, not deletable) |
159
- | **Command** | Execute a saved custom command |
160
- | **Wait** | Pause execution for 1–3600 seconds |
161
- | **Version** | Bump `package.json` version (patch / minor / major) or modify a dependency |
162
-
163
- - Nodes are executed in topological order
164
- - Flows are saved and editable
165
- - Each node can be individually enabled or disabled
166
-
167
- ---
168
-
169
- ### NPM Scripts Panel
170
-
171
- - Automatically discovers all `package.json` files in the project tree
172
- - Lists their `scripts` entries
173
- - Run any script with one click
174
- - Configure the scan root and exclusion patterns per package
175
-
176
- ---
177
-
178
- ### Built-in Terminal
179
-
180
- - Open new terminal sessions from within the GUI
181
- - Commands stream output in real time (Server-Sent Events)
182
- - Running processes are tracked and can be stopped individually
183
- - Cross-platform: uses `cmd.exe` on Windows, `sh` on Unix
184
-
185
- ---
186
-
187
- ### Project Startup
188
-
189
- Configure commands or workflows to run automatically when a project is opened:
190
-
191
- - Toggle auto-run on / off
192
- - Drag to reorder startup items
193
- - Mix custom commands and flow workflows in any order
194
-
195
- ---
196
-
197
- ### Built-in Code Editor
198
-
199
- A full IDE-like editor (second icon in the activity bar) for browsing and editing project files without leaving the tool:
200
-
201
- | Feature | Description |
202
- |---|---|
203
- | File tree | Collapsible directory tree with file-type icons |
204
- | Multi-tab editing | Open multiple files simultaneously; tabs show unsaved (●) indicator |
205
- | Monaco editor | Syntax highlighting for JS, TS, Vue, Python, Go, JSON, CSS, and more |
206
- | Markdown preview | Toggle between source and rendered preview for `.md` files |
207
- | Save | `Ctrl+S` to save; optional auto-save on focus loss |
208
- | Create | New file or folder inline in the file tree |
209
- | Rename / Delete | Rename or delete any file or folder directly from the tree |
210
- | Resizable sidebar | Drag the divider to adjust file tree width |
211
- | Theme sync | Editor theme follows the global light / dark setting |
212
-
213
- ---
214
-
215
- ### Source Map (AI Codebase Visualization)
216
-
217
- A dedicated view (third icon in the activity bar) that uses an AI model to build a visual dependency graph of your project:
218
-
219
- | Feature | Description |
220
- |---|---|
221
- | File scanner | Recursively scans all source files and builds a file tree |
222
- | AI analysis | Sends file contents to an OpenAI-compatible model to infer structure |
223
- | Dependency graph | Interactive node-edge graph (drag, zoom, fit-view, minimap) |
224
- | Subsystems | Automatically clusters files into color-coded subsystems |
225
- | Node detail | Click a node to view its source code in a Monaco editor panel |
226
- | Tech stack | Detects the language and frameworks in use |
227
- | Entry point | Identifies the main entry file and function |
228
- | Analysis log | Real-time progress log during scanning and analysis |
229
- | Resizable panels | File tree, graph, and source panels are all independently resizable |
230
-
231
- Configure the model endpoint, API key, and model name in **Settings → AI**.
232
-
233
- ---
234
-
235
- ### Settings
236
-
237
- | Setting | Description |
238
- |---|---|
239
- | Git user | Set `user.name` and `user.email` |
240
- | Default commit message | Fallback message when none is provided |
241
- | Theme | Light / dark (follows system preference by default) |
242
- | Language | Chinese / English |
243
- | File locking | Lock files so they are never staged or stashed |
244
- | NPM paths | Configure where to look for `package.json` files |
245
-
246
- ---
247
-
248
- ## Development Notes
249
-
250
- ### Line endings
251
-
252
- The repo ships a `.gitattributes` that locks source files to **LF** and Windows scripts (`.bat` / `.cmd` / `.ps1`) to **CRLF**. This takes precedence over `core.autocrlf`, so the working tree is identical on Windows, macOS, and Linux — generated files like `auto-imports.d.ts` and `components.d.ts` will not show up as "modified" just because the dev server rewrote them with different line endings.
253
-
254
- If you change `.gitattributes` rules, renormalize the index in one shot:
255
-
256
- ```bash
257
- git add --renormalize .
258
- ```
259
-
260
- ---
261
-
262
- ## CLI Commands
263
-
264
- ### Interactive commit:
265
- ```bash
266
- $ g
267
- Enter your commit message: fix login page style
268
- ```
269
-
270
- ### Commit directly (skip prompt):
271
- ```bash
272
- $ g -y
273
- ```
274
-
275
- ### Commit with inline message:
276
- ```bash
277
- $ g -m <message>
278
- $ g -m=<message>
279
- ```
280
-
281
- ### Set default commit message:
282
- ```bash
283
- $ g --set-default-message="update"
284
- ```
285
-
286
- ### Get current config:
287
- ```bash
288
- $ g get-config
289
- ```
290
-
291
- ### Show help:
292
- ```shell
293
- $ g -h
294
- $ g --help
295
- ```
296
-
297
- ### Scheduled auto-commit (default interval: 1 hour):
298
- ```bash
299
- $ g -y --interval
300
- $ g -y --interval=<seconds>
301
- ```
302
-
303
- ### Specify working directory:
304
- ```bash
305
- $ g --path=<path>
306
- $ g --cwd=<path>
307
- ```
308
-
309
- ### Sync a folder in background (Windows):
310
- ```shell
311
- start /min cmd /k "g -y --path=<your-folder> --interval"
312
- ```
313
-
314
- ### Scheduled command execution (Windows):
315
- ```shell
316
- start /min cmd /k "g --cmd=\"echo hello\" --cmd-interval=5" # every 5 seconds
317
- start /min cmd /k "g --cmd=\"echo at-time\" --at=23:59" # once at 23:59
318
- start /min cmd /k "g --cmd=\"echo daily\" --at=23:59 --daily" # daily at 23:59
319
- ```
320
-
321
- ### Suppress git diff output:
322
- ```shell
323
- $ g --no-diff
324
- ```
325
-
326
- ### Print formatted git log:
327
- ```shell
328
- $ g log
329
- $ g log --n=5
330
- ```
331
-
332
- ### File locking (only effective within the tool):
333
- ```shell
334
- # Lock a file (locked files are excluded from commits and stashes)
335
- $ g --lock-file=config.json
336
-
337
- # Unlock a file
338
- $ g --unlock-file=config.json
339
-
340
- # List all locked files
341
- $ g --list-locked
342
-
343
- # Check if a file is locked
344
- $ g --check-lock=config.json
345
- ```
346
-
347
- ---
348
-
349
- <a name="zh"></a>
350
-
351
- # zen-gitsync
352
-
353
- [English](#zen-gitsync) | [中文](#zh)
354
-
355
- `zen-gitsync` 是一个 Git 自动化工作平台,支持交互式提交、定时同步、自定义命令编排、文件锁定与可视化 GUI 界面。
356
-
357
- ## 目录
358
-
359
- - [安装](#安装)
360
- - [新特性](#v2xx--新特性)
361
- - [GUI 界面](#gui-界面)
362
- - [核心 Git 面板](#核心-git-面板)
363
- - [分支管理](#分支管理)
364
- - [Stash 管理](#stash-管理)
365
- - [Tag 管理](#tag-管理)
366
- - [提交信息模板](#提交信息模板)
367
- - [自定义命令](#自定义命令)
368
- - [可视化流程编排](#可视化流程编排)
369
- - [NPM 脚本面板](#npm-脚本面板)
370
- - [内置终端](#内置终端)
371
- - [项目启动](#项目启动)
372
- - [内置代码编辑器](#内置代码编辑器)
373
- - [源码地图](#源码地图ai-代码库可视化)
374
- - [设置](#设置)
375
- - [命令行](#命令行)
376
-
377
- ---
378
-
379
- ## 安装
380
-
381
- 通过 npm 全局安装:
382
-
383
- ```bash
384
- npm install -g zen-gitsync
385
- ```
386
-
387
- ---
388
-
389
- ## v2.x.x — 新特性
390
-
391
- - **可视化 GUI** — 完整的 Git 图形操作界面
392
- - **分支管理** — 创建、切换、追踪本地/远程分支
393
- - **Stash 管理** — 储藏与恢复变更,支持排除锁定文件
394
- - **Tag 管理** — 创建轻量/附注标签
395
- - **合并支持** — 自动检测并引导完成进行中的合并
396
- - **可视化流程编排** — 拖拽式工作流设计器
397
- - **NPM 脚本面板** — 发现并运行 `package.json` 中的脚本
398
- - **内置终端** — 实时流式输出的命令执行终端
399
- - **自定义命令** — 保存、参数化并复用 Shell 命令
400
- - **项目启动** — 打开项目时自动运行命令或工作流
401
- - **内置代码编辑器** — 基于 Monaco 的文件编辑器,支持 Markdown 预览
402
- - **源码地图** — AI 生成的交互式代码库依赖关系图
403
- - **AI 生成提交信息** — 基于 staged diff 自动生成提交消息
404
- - **提交模板** — 保存类型/范围/描述/完整提交信息模板
405
- - **主题与语言** — 支持明/暗主题,中英文界面切换
406
-
407
- ---
408
-
409
- ## GUI 界面
410
-
411
- ### 启动图形界面:
412
- ```shell
413
- $ g ui
414
- ```
415
-
416
- ![ui](https://raw.githubusercontent.com/xz333221/zen-gitsync/main/public/images/zen-gitsync-ui-git.png)
417
-
418
- GUI 以本地 Web 服务器形式运行,自动在浏览器中打开,并附加到当前 Git 仓库。左侧 Activity Bar 可在三个视图之间切换:**Git**、**编辑器**、**源码地图**。
419
-
420
- ---
421
-
422
- ### 核心 Git 面板
423
-
424
- | 功能 | 说明 |
425
- |---|---|
426
- | 文件列表 | 按已暂存/未暂存/未追踪/冲突分组显示所有变更文件 |
427
- | 视图切换 | 平铺列表与目录树形视图切换(持久化保存) |
428
- | 选择模式 | 多选文件,仅对选中文件执行暂存或储藏。在 Git 视图下,**一键提交 / 一键推送** 与 **AI 生成提交信息** 会自动仅作用于当前勾选的文件(按钮文案切换为「一键提交所选」/「一键推送所选」) |
429
- | 单文件操作 | 对每个文件独立执行暂存、取消暂存或还原 |
430
- | 暂存 | 暂存全部或选中文件(自动排除锁定文件) |
431
- | 提交 | 结构化表单(类型/范围/描述/正文/页脚)或自由文本 |
432
- | AI 生成提交信息 | 基于 staged diff 自动生成提交消息 |
433
- | 推送 | 推送到远程,实时显示进度弹窗 |
434
- | 快速提交+推送 | 一键完成暂存 → 提交 → 推送 |
435
- | 拉取 / Fetch | 从上游拉取或仅获取远程信息 |
436
- | 合并 | 合并其他分支,自动检测并引导处理合并中间状态 |
437
- | Diff 查看器 | 基于 Monaco 编辑器的并排文件差异视图 |
438
- | 提交日志 | 浏览历史提交(作者、时间、分支标签、变更文件) |
439
- | 远程地址 | 显示并一键复制远程仓库 URL |
440
- | 自动刷新 | 窗口获得焦点、标签页重新可见,或从 Activity Bar 切回 **Git** 视图时,自动静默刷新文件状态与分支信息 |
441
-
442
- #### 结构化提交表单
443
-
444
- 提交表单支持通过开关切换两种模式:
445
-
446
- - **标准模式** — 分别填写类型(`feat` / `fix` / `docs` / `style` / `refactor` / `test` / `chore`)、范围、简短描述、正文和页脚,自动组合成符合 Conventional Commits 规范的提交信息
447
- - **自由模式** — 单一文本框,输入任意提交信息
448
-
449
- 两种模式下均可点击 **AI 生成** 按钮,根据当前 staged diff 自动填充提交信息。
450
-
451
- ---
452
-
453
- ### 分支管理
454
-
455
- - 查看所有本地和远程分支
456
- - 从任意基础分支创建新分支
457
- - 切换分支
458
- - 追踪上游状态(领先/落后提交数)
459
-
460
- ---
461
-
462
- ### Stash 管理
463
-
464
- - 创建 stash,支持自定义备注
465
- - 可选是否包含未追踪文件
466
- - 可选排除已锁定的文件
467
- - 应用(apply)、弹出(pop)或删除(drop)单条 stash
468
-
469
- ---
470
-
471
- ### Tag 管理
472
-
473
- - 创建**轻量标签**或**附注标签**
474
- - 可指定特定 commit
475
- - 列出、推送或删除标签
476
-
477
- ---
478
-
479
- ### 提交信息模板
480
-
481
- 为以下内容保存可复用模板:
482
- - **类型** — `feat`、`fix`、`chore` 等
483
- - **范围** — 组件或模块名
484
- - **描述** — 简短说明
485
- - **完整信息** — 完整提交消息
486
-
487
- ---
488
-
489
- ### 自定义命令
490
-
491
- ![命令编排](https://home.flowdash.cn/upload/VditorFiles/2026-1/zen-gitsync_SBAJdlvm.png)
492
-
493
- 在侧边栏创建、管理并运行 Shell 命令:
494
-
495
- - 定义命令(名称、Shell 命令、工作目录)
496
- - 添加**参数**(名称、描述、默认值,通过 `{{paramName}}` 引用)
497
- - 一键在新终端会话中执行命令
498
- - 保存**命令模板**快速复用
499
-
500
- ---
501
-
502
- ### 可视化流程编排
503
-
504
- 通过拖拽画布构建自动化流程:
505
-
506
- | 节点类型 | 用途 |
507
- |---|---|
508
- | **开始节点** | 流程入口(每个流程唯一,不可删除) |
509
- | **命令节点** | 执行一个已保存的自定义命令 |
510
- | **等待节点** | 暂停执行 1–3600 秒 |
511
- | **版本节点** | 修改 `package.json` 版本号(patch/minor/major)或依赖版本 |
512
-
513
- - 节点按拓扑顺序执行
514
- - 流程可保存并二次编辑
515
- - 每个节点可单独启用/禁用
516
-
517
- ---
518
-
519
- ### NPM 脚本面板
520
-
521
- - 自动扫描项目中所有 `package.json` 文件
522
- - 列出其中的 `scripts` 条目
523
- - 一键运行任意脚本
524
- - 可配置扫描根路径和排除规则
525
-
526
- ---
527
-
528
- ### 内置终端
529
-
530
- - 在 GUI 内直接打开新的终端会话
531
- - 命令输出实时流式显示(Server-Sent Events)
532
- - 追踪运行中的进程,随时可以停止
533
- - 跨平台:Windows 使用 `cmd.exe`,Unix 使用 `sh`
534
-
535
- ---
536
-
537
- ### 项目启动
538
-
539
- 配置在项目打开时自动执行的命令或工作流:
540
-
541
- - 一键开启/关闭自动运行
542
- - 拖拽调整启动项顺序
543
- - 可混合使用自定义命令与流程工作流
544
-
545
- ---
546
-
547
- ### 内置代码编辑器
548
-
549
- Activity Bar 第二个视图,在 GUI 内直接浏览并编辑项目文件:
550
-
551
- | 功能 | 说明 |
552
- |---|---|
553
- | 文件树 | 可折叠的目录树,附带文件类型图标 |
554
- | 多标签页 | 同时打开多个文件,未保存文件显示 ● 标记 |
555
- | Monaco 编辑器 | 支持 JS、TS、Vue、Python、Go、JSON、CSS 等语法高亮 |
556
- | Markdown 预览 | `.md` 文件可切换源码与渲染预览模式 |
557
- | 保存 | `Ctrl+S` 手动保存;可选失去焦点时自动保存 |
558
- | 新建 | 在文件树中内联创建文件或文件夹 |
559
- | 重命名 / 删除 | 在树中直接对文件或文件夹重命名、删除 |
560
- | 侧边栏调整 | 拖拽分隔条自由调整文件树宽度 |
561
- | 主题同步 | 编辑器主题跟随全局明/暗设置 |
562
-
563
- ---
564
-
565
- ### 源码地图(AI 代码库可视化)
566
-
567
- Activity Bar 第三个视图,调用 AI 模型将项目代码库生成可交互的依赖关系图:
568
-
569
- | 功能 | 说明 |
570
- |---|---|
571
- | 文件扫描 | 递归扫描所有源码文件并构建文件树 |
572
- | AI 分析 | 将文件内容发送到 OpenAI 兼容接口,推断项目结构 |
573
- | 依赖关系图 | 可拖拽、缩放、适配视图的节点边图(带缩略图导航) |
574
- | 子系统聚类 | 自动将文件聚类为颜色区分的子系统 |
575
- | 节点详情 | 点击节点在右侧 Monaco 面板中查看对应源码 |
576
- | 技术栈检测 | 识别项目使用的语言和框架 |
577
- | 入口点识别 | 标记主入口文件和入口函数 |
578
- | 分析日志 | 扫描与分析过程实时输出进度日志 |
579
- | 多面板布局 | 文件树、关系图、源码三个面板均可独立拖拽调整宽度 |
580
-
581
- 在 **设置 → AI** 中配置模型接口地址、API Key 和模型名称。
582
-
583
- ---
584
-
585
- ### 设置
586
-
587
- | 设置项 | 说明 |
588
- |---|---|
589
- | Git 用户信息 | 设置 `user.name` 和 `user.email` |
590
- | 默认提交信息 | 未填写时的回退提交消息 |
591
- | 主题 | 明亮/暗黑模式(默认跟随系统) |
592
- | 语言 | 中文 / English |
593
- | 文件锁定 | 锁定文件,使其永远不被暂存或储藏 |
594
- | NPM 路径 | 配置 `package.json` 的扫描位置 |
595
-
596
- ---
597
-
598
- ## 开发约定
599
-
600
- ### 行尾规范
601
-
602
- 仓库根的 `.gitattributes` 把**所有源代码锁定为 LF**(`.ts` `.js` `.vue` `.json` `.md` 等),**Windows 脚本锁定为 CRLF**(`.bat` / `.cmd` / `.ps1`)。`.gitattributes` 的优先级高于 `core.autocrlf`,所以无论本地 git 怎么配,签出与提交的行尾都一致;dev server 重新生成的 `auto-imports.d.ts`、`components.d.ts` 不会再因为行尾不一致而显示为"内容相同的 modified"。
603
-
604
- 如果你修改了 `.gitattributes` 的规则,需要一次性重新归一索引:
605
-
606
- ```bash
607
- git add --renormalize .
608
- ```
609
-
610
- ---
611
-
612
- ## 命令行
613
-
614
- #### 交互式提交:
615
- ```bash
616
- $ g
617
- 请输入你的提交信息: 修复了登录页样式问题
618
- ```
619
-
620
- #### 直接提交(跳过输入):
621
- ```bash
622
- $ g -y
623
- ```
624
-
625
- #### 传入 message 直接提交:
626
- ```bash
627
- $ g -m <message>
628
- $ g -m=<message>
629
- ```
630
-
631
- #### 设置默认提交信息:
632
- ```bash
633
- $ g --set-default-message="提交"
634
- ```
635
-
636
- #### 获取当前配置:
637
- ```bash
638
- $ g get-config
639
- ```
640
-
641
- #### 查看帮助:
642
- ```shell
643
- $ g -h
644
- $ g --help
645
- ```
646
-
647
- #### 定时执行自动提交(默认间隔 1 小时):
648
- ```bash
649
- $ g -y --interval
650
- $ g -y --interval=<seconds>
651
- ```
652
-
653
- #### 指定目录提交:
654
- ```bash
655
- $ g --path=<path>
656
- $ g --cwd=<path>
657
- ```
658
-
659
- #### 后台同步文件夹(Windows):
660
- ```shell
661
- start /min cmd /k "g -y --path=你要同步的文件夹 --interval"
662
- ```
663
-
664
- #### 定时执行命令(Windows):
665
- ```shell
666
- start /min cmd /k "g --cmd=\"echo hello\" --cmd-interval=5" # 每5秒执行一次
667
- start /min cmd /k "g --cmd=\"echo at-time\" --at=23:59" # 在23:59执行一次
668
- start /min cmd /k "g --cmd=\"echo daily\" --at=23:59 --daily" # 每天23:59执行一次
669
- ```
670
-
671
- #### 不显示 git diff 内容:
672
- ```shell
673
- $ g --no-diff
674
- ```
675
-
676
- #### 格式化打印 git log:
677
- ```shell
678
- $ g log
679
- $ g log --n=5
680
- ```
681
-
682
- #### 文件锁定功能(仅在工具中有效):
683
- ```shell
684
- # 锁定文件(锁定后的文件不会被暂存或储藏)
685
- $ g --lock-file=config.json
686
-
687
- # 解锁文件
688
- $ g --unlock-file=config.json
689
-
690
- # 查看所有锁定的文件
691
- $ g --list-locked
692
-
693
- # 检查文件是否被锁定
694
- $ g --check-lock=config.json
695
- ```
1
+ # zen-gitsync
2
+
3
+ [English](#zen-gitsync) | [中文](#zh)
4
+
5
+ A Git automation platform with interactive commits, scheduled sync, custom command orchestration, file locking, and a visual GUI.
6
+
7
+ ## Table of Contents
8
+
9
+ - [Installation](#installation)
10
+ - [What''s New](#v2xx--whats-new)
11
+ - [GUI](#gui)
12
+ - [Core Git Panel](#core-git-panel)
13
+ - [Branch Management](#branch-management)
14
+ - [Stash Management](#stash-management)
15
+ - [Tag Management](#tag-management)
16
+ - [Commit Message Templates](#commit-message-templates)
17
+ - [Custom Commands](#custom-commands)
18
+ - [Flow Orchestration](#flow-orchestration-visual-workflow-designer)
19
+ - [NPM Scripts Panel](#npm-scripts-panel)
20
+ - [Built-in Terminal](#built-in-terminal)
21
+ - [Project Startup](#project-startup)
22
+ - [Built-in Code Editor](#built-in-code-editor)
23
+ - [Source Map](#source-map-ai-codebase-visualization)
24
+ - [Settings](#settings)
25
+ - [CLI Commands](#cli-commands)
26
+
27
+ ---
28
+
29
+ ## Installation
30
+
31
+ Install globally via npm:
32
+
33
+ ```bash
34
+ npm install -g zen-gitsync
35
+ ```
36
+
37
+ ---
38
+
39
+ ## v2.x.x — What''s New
40
+
41
+ - **Visual GUI** — Full graphical interface for Git operations
42
+ - **Branch management** — Create, switch, and track local/remote branches
43
+ - **Stash management** — Save and restore stashes with locked-file filtering
44
+ - **Tag management** — Create lightweight and annotated tags
45
+ - **Merge support** — Detect and complete in-progress merges
46
+ - **Flow orchestration** — Drag-and-drop visual workflow designer
47
+ - **NPM scripts panel** — Discover and run npm scripts from `package.json`
48
+ - **Built-in terminal** — Run commands with real-time streaming output
49
+ - **Custom commands** — Save, parameterize, and reuse shell commands
50
+ - **Project startup** — Auto-run commands or workflows when a project opens
51
+ - **Built-in code editor** — Monaco-based file editor with Markdown preview
52
+ - **Source map** — AI-generated interactive codebase dependency graph
53
+ - **AI commit message** — Generate commit message from staged diff automatically
54
+ - **Commit templates** — Save type/scope/description/message templates
55
+ - **Theme & language** — Light/dark theme and Chinese/English UI
56
+
57
+ ---
58
+
59
+ ## GUI
60
+
61
+ ### Launch the GUI:
62
+ ```shell
63
+ $ g ui
64
+ ```
65
+
66
+ ![ui](https://raw.githubusercontent.com/xz333221/zen-gitsync/main/public/images/zen-gitsync-ui-git.png)
67
+
68
+ The GUI runs as a local web server and opens in your default browser. It attaches to the current Git repository automatically. The activity bar on the left switches between three views: **Git**, **Editor**, and **Source Map**.
69
+
70
+ ---
71
+
72
+ ### Core Git Panel
73
+
74
+ | Feature | Description |
75
+ |---|---|
76
+ | File list | Shows all changed files grouped by staged / unstaged / untracked / conflicted |
77
+ | View toggle | Switch between flat list and directory tree view (persisted) |
78
+ | Selection mode | Multi-select files to stage or stash only chosen files. When the Git view is the active tab, **Quick Commit / Quick Push** and **AI commit message** automatically scope their action to the current selection (button label switches to *Commit Selected* / *Push Selected*). |
79
+ | Per-file actions | Stage, unstage, or revert individual files |
80
+ | Stage | Stage all or selected files (respects locked files) |
81
+ | Commit | Structured form (type / scope / description / body / footer) or free-text |
82
+ | AI commit message | Generate commit message from staged diff using an AI model |
83
+ | Push | Push to remote with live progress modal |
84
+ | Quick commit+push | One-click stage → commit → push |
85
+ | Pull / Fetch | Pull from or fetch the upstream branch |
86
+ | Merge | Merge another branch; detects and surfaces in-progress merge state |
87
+ | Diff viewer | Monaco-based side-by-side diff for any changed file |
88
+ | Commit log | Browse commit history with author, date, branch tags, and changed files |
89
+ | Remote URL | Display and one-click copy the remote repository URL |
90
+ | Auto-refresh | Silently refreshes status and branch info when the window gains focus, the tab becomes visible, or you switch back to the **Git** view in the Activity Bar |
91
+
92
+ #### Structured Commit Form
93
+
94
+ The commit form supports two modes toggled by a switch:
95
+
96
+ - **Standard mode** — separate fields for type (`feat` / `fix` / `docs` / `style` / `refactor` / `test` / `chore`), scope, short description, body, and footer — produces a Conventional Commits message automatically
97
+ - **Free-text mode** — single text area for any commit message
98
+
99
+ In either mode, click **AI Generate** to fill in the fields automatically based on the staged diff.
100
+
101
+ ---
102
+
103
+ ### Branch Management
104
+
105
+ - View all local and remote branches
106
+ - Create a new branch from any base branch
107
+ - Switch branches
108
+ - Track upstream status (commits ahead / behind)
109
+
110
+ ---
111
+
112
+ ### Stash Management
113
+
114
+ - Save stash with an optional message
115
+ - Optionally include untracked files
116
+ - Optionally exclude locked files from stash
117
+ - Apply, pop, or drop individual stash entries
118
+
119
+ ---
120
+
121
+ ### Tag Management
122
+
123
+ - Create **lightweight** or **annotated** tags
124
+ - Target a specific commit
125
+ - List, push, or delete tags
126
+
127
+ ---
128
+
129
+ ### Commit Message Templates
130
+
131
+ Save reusable templates for:
132
+ - **Type** — `feat`, `fix`, `chore`, …
133
+ - **Scope** — component or module name
134
+ - **Description** — short summary
135
+ - **Full message** — complete commit message
136
+
137
+ ---
138
+
139
+ ### Custom Commands
140
+
141
+ ![Command Orchestration](https://home.flowdash.cn/upload/VditorFiles/2026-1/zen-gitsync_SBAJdlvm.png)
142
+
143
+ Create, manage, and run shell commands from the sidebar:
144
+
145
+ - Define commands with a name, shell command, and working directory
146
+ - Add **parameters** with names, descriptions, and default values (referenced via `{{paramName}}`)
147
+ - Run a command instantly in a new terminal session
148
+ - Save command **templates** for quick reuse
149
+
150
+ ---
151
+
152
+ ### Flow Orchestration (Visual Workflow Designer)
153
+
154
+ Build automated pipelines with a drag-and-drop canvas:
155
+
156
+ | Node type | Purpose |
157
+ |---|---|
158
+ | **Start** | Entry point of the flow (one per flow, not deletable) |
159
+ | **Command** | Execute a saved custom command |
160
+ | **Wait** | Pause execution for 1–3600 seconds |
161
+ | **Version** | Bump `package.json` version (patch / minor / major) or modify a dependency |
162
+
163
+ - Nodes are executed in topological order
164
+ - Flows are saved and editable
165
+ - Each node can be individually enabled or disabled
166
+
167
+ ---
168
+
169
+ ### NPM Scripts Panel
170
+
171
+ - Automatically discovers all `package.json` files in the project tree
172
+ - Lists their `scripts` entries
173
+ - Run any script with one click
174
+ - Configure the scan root and exclusion patterns per package
175
+
176
+ ---
177
+
178
+ ### Built-in Terminal
179
+
180
+ - Open new terminal sessions from within the GUI
181
+ - Commands stream output in real time (Server-Sent Events)
182
+ - Running processes are tracked and can be stopped individually
183
+ - Cross-platform: uses `cmd.exe` on Windows, `sh` on Unix
184
+
185
+ ---
186
+
187
+ ### Project Startup
188
+
189
+ Configure commands or workflows to run automatically when a project is opened:
190
+
191
+ - Toggle auto-run on / off
192
+ - Drag to reorder startup items
193
+ - Mix custom commands and flow workflows in any order
194
+
195
+ ---
196
+
197
+ ### Built-in Code Editor
198
+
199
+ A full IDE-like editor (second icon in the activity bar) for browsing and editing project files without leaving the tool:
200
+
201
+ | Feature | Description |
202
+ |---|---|
203
+ | File tree | Collapsible directory tree with file-type icons |
204
+ | Multi-tab editing | Open multiple files simultaneously; tabs show unsaved (●) indicator |
205
+ | Monaco editor | Syntax highlighting for JS, TS, Vue, Python, Go, JSON, CSS, and more |
206
+ | Markdown preview | Toggle between source and rendered preview for `.md` files |
207
+ | Save | `Ctrl+S` to save; optional auto-save on focus loss |
208
+ | Create | New file or folder inline in the file tree |
209
+ | Rename / Delete | Rename or delete any file or folder directly from the tree |
210
+ | Resizable sidebar | Drag the divider to adjust file tree width |
211
+ | Theme sync | Editor theme follows the global light / dark setting |
212
+
213
+ ---
214
+
215
+ ### Source Map (AI Codebase Visualization)
216
+
217
+ A dedicated view (third icon in the activity bar) that uses an AI model to build a visual dependency graph of your project:
218
+
219
+ | Feature | Description |
220
+ |---|---|
221
+ | File scanner | Recursively scans all source files and builds a file tree |
222
+ | AI analysis | Sends file contents to an OpenAI-compatible model to infer structure |
223
+ | Dependency graph | Interactive node-edge graph (drag, zoom, fit-view, minimap) |
224
+ | Subsystems | Automatically clusters files into color-coded subsystems |
225
+ | Node detail | Click a node to view its source code in a Monaco editor panel |
226
+ | Tech stack | Detects the language and frameworks in use |
227
+ | Entry point | Identifies the main entry file and function |
228
+ | Analysis log | Real-time progress log during scanning and analysis |
229
+ | Resizable panels | File tree, graph, and source panels are all independently resizable |
230
+
231
+ Configure the model endpoint, API key, and model name in **Settings → AI**.
232
+
233
+ ---
234
+
235
+ ### Settings
236
+
237
+ | Setting | Description |
238
+ |---|---|
239
+ | Git user | Set `user.name` and `user.email` |
240
+ | Default commit message | Fallback message when none is provided |
241
+ | Theme | Light / dark (follows system preference by default) |
242
+ | Language | Chinese / English |
243
+ | File locking | Lock files so they are never staged or stashed |
244
+ | NPM paths | Configure where to look for `package.json` files |
245
+
246
+ ---
247
+
248
+ ## Development Notes
249
+
250
+ ### Line endings
251
+
252
+ The repo ships a `.gitattributes` that locks source files to **LF** and Windows scripts (`.bat` / `.cmd` / `.ps1`) to **CRLF**. This takes precedence over `core.autocrlf`, so the working tree is identical on Windows, macOS, and Linux — generated files like `auto-imports.d.ts` and `components.d.ts` will not show up as "modified" just because the dev server rewrote them with different line endings.
253
+
254
+ If you change `.gitattributes` rules, renormalize the index in one shot:
255
+
256
+ ```bash
257
+ git add --renormalize .
258
+ ```
259
+
260
+ ---
261
+
262
+ ## CLI Commands
263
+
264
+ ### Interactive commit:
265
+ ```bash
266
+ $ g
267
+ Enter your commit message: fix login page style
268
+ ```
269
+
270
+ ### Commit directly (skip prompt):
271
+ ```bash
272
+ $ g -y
273
+ ```
274
+
275
+ ### Commit with inline message:
276
+ ```bash
277
+ $ g -m <message>
278
+ $ g -m=<message>
279
+ ```
280
+
281
+ ### Set default commit message:
282
+ ```bash
283
+ $ g --set-default-message="update"
284
+ ```
285
+
286
+ ### Get current config:
287
+ ```bash
288
+ $ g get-config
289
+ ```
290
+
291
+ ### Show help:
292
+ ```shell
293
+ $ g -h
294
+ $ g --help
295
+ ```
296
+
297
+ ### Scheduled auto-commit (default interval: 1 hour):
298
+ ```bash
299
+ $ g -y --interval
300
+ $ g -y --interval=<seconds>
301
+ ```
302
+
303
+ ### Specify working directory:
304
+ ```bash
305
+ $ g --path=<path>
306
+ $ g --cwd=<path>
307
+ ```
308
+
309
+ ### Sync a folder in background (Windows):
310
+ ```shell
311
+ start /min cmd /k "g -y --path=<your-folder> --interval"
312
+ ```
313
+
314
+ ### Scheduled command execution (Windows):
315
+ ```shell
316
+ start /min cmd /k "g --cmd=\"echo hello\" --cmd-interval=5" # every 5 seconds
317
+ start /min cmd /k "g --cmd=\"echo at-time\" --at=23:59" # once at 23:59
318
+ start /min cmd /k "g --cmd=\"echo daily\" --at=23:59 --daily" # daily at 23:59
319
+ ```
320
+
321
+ ### Suppress git diff output:
322
+ ```shell
323
+ $ g --no-diff
324
+ ```
325
+
326
+ ### Print formatted git log:
327
+ ```shell
328
+ $ g log
329
+ $ g log --n=5
330
+ ```
331
+
332
+ ### File locking (only effective within the tool):
333
+ ```shell
334
+ # Lock a file (locked files are excluded from commits and stashes)
335
+ $ g --lock-file=config.json
336
+
337
+ # Unlock a file
338
+ $ g --unlock-file=config.json
339
+
340
+ # List all locked files
341
+ $ g --list-locked
342
+
343
+ # Check if a file is locked
344
+ $ g --check-lock=config.json
345
+ ```
346
+
347
+ ---
348
+
349
+ <a name="zh"></a>
350
+
351
+ # zen-gitsync
352
+
353
+ [English](#zen-gitsync) | [中文](#zh)
354
+
355
+ `zen-gitsync` 是一个 Git 自动化工作平台,支持交互式提交、定时同步、自定义命令编排、文件锁定与可视化 GUI 界面。
356
+
357
+ ## 目录
358
+
359
+ - [安装](#安装)
360
+ - [新特性](#v2xx--新特性)
361
+ - [GUI 界面](#gui-界面)
362
+ - [核心 Git 面板](#核心-git-面板)
363
+ - [分支管理](#分支管理)
364
+ - [Stash 管理](#stash-管理)
365
+ - [Tag 管理](#tag-管理)
366
+ - [提交信息模板](#提交信息模板)
367
+ - [自定义命令](#自定义命令)
368
+ - [可视化流程编排](#可视化流程编排)
369
+ - [NPM 脚本面板](#npm-脚本面板)
370
+ - [内置终端](#内置终端)
371
+ - [项目启动](#项目启动)
372
+ - [内置代码编辑器](#内置代码编辑器)
373
+ - [源码地图](#源码地图ai-代码库可视化)
374
+ - [设置](#设置)
375
+ - [命令行](#命令行)
376
+
377
+ ---
378
+
379
+ ## 安装
380
+
381
+ 通过 npm 全局安装:
382
+
383
+ ```bash
384
+ npm install -g zen-gitsync
385
+ ```
386
+
387
+ ---
388
+
389
+ ## v2.x.x — 新特性
390
+
391
+ - **可视化 GUI** — 完整的 Git 图形操作界面
392
+ - **分支管理** — 创建、切换、追踪本地/远程分支
393
+ - **Stash 管理** — 储藏与恢复变更,支持排除锁定文件
394
+ - **Tag 管理** — 创建轻量/附注标签
395
+ - **合并支持** — 自动检测并引导完成进行中的合并
396
+ - **可视化流程编排** — 拖拽式工作流设计器
397
+ - **NPM 脚本面板** — 发现并运行 `package.json` 中的脚本
398
+ - **内置终端** — 实时流式输出的命令执行终端
399
+ - **自定义命令** — 保存、参数化并复用 Shell 命令
400
+ - **项目启动** — 打开项目时自动运行命令或工作流
401
+ - **内置代码编辑器** — 基于 Monaco 的文件编辑器,支持 Markdown 预览
402
+ - **源码地图** — AI 生成的交互式代码库依赖关系图
403
+ - **AI 生成提交信息** — 基于 staged diff 自动生成提交消息
404
+ - **提交模板** — 保存类型/范围/描述/完整提交信息模板
405
+ - **主题与语言** — 支持明/暗主题,中英文界面切换
406
+
407
+ ---
408
+
409
+ ## GUI 界面
410
+
411
+ ### 启动图形界面:
412
+ ```shell
413
+ $ g ui
414
+ ```
415
+
416
+ ![ui](https://raw.githubusercontent.com/xz333221/zen-gitsync/main/public/images/zen-gitsync-ui-git.png)
417
+
418
+ GUI 以本地 Web 服务器形式运行,自动在浏览器中打开,并附加到当前 Git 仓库。左侧 Activity Bar 可在三个视图之间切换:**Git**、**编辑器**、**源码地图**。
419
+
420
+ ---
421
+
422
+ ### 核心 Git 面板
423
+
424
+ | 功能 | 说明 |
425
+ |---|---|
426
+ | 文件列表 | 按已暂存/未暂存/未追踪/冲突分组显示所有变更文件 |
427
+ | 视图切换 | 平铺列表与目录树形视图切换(持久化保存) |
428
+ | 选择模式 | 多选文件,仅对选中文件执行暂存或储藏。在 Git 视图下,**一键提交 / 一键推送** 与 **AI 生成提交信息** 会自动仅作用于当前勾选的文件(按钮文案切换为「一键提交所选」/「一键推送所选」) |
429
+ | 单文件操作 | 对每个文件独立执行暂存、取消暂存或还原 |
430
+ | 暂存 | 暂存全部或选中文件(自动排除锁定文件) |
431
+ | 提交 | 结构化表单(类型/范围/描述/正文/页脚)或自由文本 |
432
+ | AI 生成提交信息 | 基于 staged diff 自动生成提交消息 |
433
+ | 推送 | 推送到远程,实时显示进度弹窗 |
434
+ | 快速提交+推送 | 一键完成暂存 → 提交 → 推送 |
435
+ | 拉取 / Fetch | 从上游拉取或仅获取远程信息 |
436
+ | 合并 | 合并其他分支,自动检测并引导处理合并中间状态 |
437
+ | Diff 查看器 | 基于 Monaco 编辑器的并排文件差异视图 |
438
+ | 提交日志 | 浏览历史提交(作者、时间、分支标签、变更文件) |
439
+ | 远程地址 | 显示并一键复制远程仓库 URL |
440
+ | 自动刷新 | 窗口获得焦点、标签页重新可见,或从 Activity Bar 切回 **Git** 视图时,自动静默刷新文件状态与分支信息 |
441
+
442
+ #### 结构化提交表单
443
+
444
+ 提交表单支持通过开关切换两种模式:
445
+
446
+ - **标准模式** — 分别填写类型(`feat` / `fix` / `docs` / `style` / `refactor` / `test` / `chore`)、范围、简短描述、正文和页脚,自动组合成符合 Conventional Commits 规范的提交信息
447
+ - **自由模式** — 单一文本框,输入任意提交信息
448
+
449
+ 两种模式下均可点击 **AI 生成** 按钮,根据当前 staged diff 自动填充提交信息。
450
+
451
+ ---
452
+
453
+ ### 分支管理
454
+
455
+ - 查看所有本地和远程分支
456
+ - 从任意基础分支创建新分支
457
+ - 切换分支
458
+ - 追踪上游状态(领先/落后提交数)
459
+
460
+ ---
461
+
462
+ ### Stash 管理
463
+
464
+ - 创建 stash,支持自定义备注
465
+ - 可选是否包含未追踪文件
466
+ - 可选排除已锁定的文件
467
+ - 应用(apply)、弹出(pop)或删除(drop)单条 stash
468
+
469
+ ---
470
+
471
+ ### Tag 管理
472
+
473
+ - 创建**轻量标签**或**附注标签**
474
+ - 可指定特定 commit
475
+ - 列出、推送或删除标签
476
+
477
+ ---
478
+
479
+ ### 提交信息模板
480
+
481
+ 为以下内容保存可复用模板:
482
+ - **类型** — `feat`、`fix`、`chore` 等
483
+ - **范围** — 组件或模块名
484
+ - **描述** — 简短说明
485
+ - **完整信息** — 完整提交消息
486
+
487
+ ---
488
+
489
+ ### 自定义命令
490
+
491
+ ![命令编排](https://home.flowdash.cn/upload/VditorFiles/2026-1/zen-gitsync_SBAJdlvm.png)
492
+
493
+ 在侧边栏创建、管理并运行 Shell 命令:
494
+
495
+ - 定义命令(名称、Shell 命令、工作目录)
496
+ - 添加**参数**(名称、描述、默认值,通过 `{{paramName}}` 引用)
497
+ - 一键在新终端会话中执行命令
498
+ - 保存**命令模板**快速复用
499
+
500
+ ---
501
+
502
+ ### 可视化流程编排
503
+
504
+ 通过拖拽画布构建自动化流程:
505
+
506
+ | 节点类型 | 用途 |
507
+ |---|---|
508
+ | **开始节点** | 流程入口(每个流程唯一,不可删除) |
509
+ | **命令节点** | 执行一个已保存的自定义命令 |
510
+ | **等待节点** | 暂停执行 1–3600 秒 |
511
+ | **版本节点** | 修改 `package.json` 版本号(patch/minor/major)或依赖版本 |
512
+
513
+ - 节点按拓扑顺序执行
514
+ - 流程可保存并二次编辑
515
+ - 每个节点可单独启用/禁用
516
+
517
+ ---
518
+
519
+ ### NPM 脚本面板
520
+
521
+ - 自动扫描项目中所有 `package.json` 文件
522
+ - 列出其中的 `scripts` 条目
523
+ - 一键运行任意脚本
524
+ - 可配置扫描根路径和排除规则
525
+
526
+ ---
527
+
528
+ ### 内置终端
529
+
530
+ - 在 GUI 内直接打开新的终端会话
531
+ - 命令输出实时流式显示(Server-Sent Events)
532
+ - 追踪运行中的进程,随时可以停止
533
+ - 跨平台:Windows 使用 `cmd.exe`,Unix 使用 `sh`
534
+
535
+ ---
536
+
537
+ ### 项目启动
538
+
539
+ 配置在项目打开时自动执行的命令或工作流:
540
+
541
+ - 一键开启/关闭自动运行
542
+ - 拖拽调整启动项顺序
543
+ - 可混合使用自定义命令与流程工作流
544
+
545
+ ---
546
+
547
+ ### 内置代码编辑器
548
+
549
+ Activity Bar 第二个视图,在 GUI 内直接浏览并编辑项目文件:
550
+
551
+ | 功能 | 说明 |
552
+ |---|---|
553
+ | 文件树 | 可折叠的目录树,附带文件类型图标 |
554
+ | 多标签页 | 同时打开多个文件,未保存文件显示 ● 标记 |
555
+ | Monaco 编辑器 | 支持 JS、TS、Vue、Python、Go、JSON、CSS 等语法高亮 |
556
+ | Markdown 预览 | `.md` 文件可切换源码与渲染预览模式 |
557
+ | 保存 | `Ctrl+S` 手动保存;可选失去焦点时自动保存 |
558
+ | 新建 | 在文件树中内联创建文件或文件夹 |
559
+ | 重命名 / 删除 | 在树中直接对文件或文件夹重命名、删除 |
560
+ | 侧边栏调整 | 拖拽分隔条自由调整文件树宽度 |
561
+ | 主题同步 | 编辑器主题跟随全局明/暗设置 |
562
+
563
+ ---
564
+
565
+ ### 源码地图(AI 代码库可视化)
566
+
567
+ Activity Bar 第三个视图,调用 AI 模型将项目代码库生成可交互的依赖关系图:
568
+
569
+ | 功能 | 说明 |
570
+ |---|---|
571
+ | 文件扫描 | 递归扫描所有源码文件并构建文件树 |
572
+ | AI 分析 | 将文件内容发送到 OpenAI 兼容接口,推断项目结构 |
573
+ | 依赖关系图 | 可拖拽、缩放、适配视图的节点边图(带缩略图导航) |
574
+ | 子系统聚类 | 自动将文件聚类为颜色区分的子系统 |
575
+ | 节点详情 | 点击节点在右侧 Monaco 面板中查看对应源码 |
576
+ | 技术栈检测 | 识别项目使用的语言和框架 |
577
+ | 入口点识别 | 标记主入口文件和入口函数 |
578
+ | 分析日志 | 扫描与分析过程实时输出进度日志 |
579
+ | 多面板布局 | 文件树、关系图、源码三个面板均可独立拖拽调整宽度 |
580
+
581
+ 在 **设置 → AI** 中配置模型接口地址、API Key 和模型名称。
582
+
583
+ ---
584
+
585
+ ### 设置
586
+
587
+ | 设置项 | 说明 |
588
+ |---|---|
589
+ | Git 用户信息 | 设置 `user.name` 和 `user.email` |
590
+ | 默认提交信息 | 未填写时的回退提交消息 |
591
+ | 主题 | 明亮/暗黑模式(默认跟随系统) |
592
+ | 语言 | 中文 / English |
593
+ | 文件锁定 | 锁定文件,使其永远不被暂存或储藏 |
594
+ | NPM 路径 | 配置 `package.json` 的扫描位置 |
595
+
596
+ ---
597
+
598
+ ## 开发约定
599
+
600
+ ### 行尾规范
601
+
602
+ 仓库根的 `.gitattributes` 把**所有源代码锁定为 LF**(`.ts` `.js` `.vue` `.json` `.md` 等),**Windows 脚本锁定为 CRLF**(`.bat` / `.cmd` / `.ps1`)。`.gitattributes` 的优先级高于 `core.autocrlf`,所以无论本地 git 怎么配,签出与提交的行尾都一致;dev server 重新生成的 `auto-imports.d.ts`、`components.d.ts` 不会再因为行尾不一致而显示为"内容相同的 modified"。
603
+
604
+ 如果你修改了 `.gitattributes` 的规则,需要一次性重新归一索引:
605
+
606
+ ```bash
607
+ git add --renormalize .
608
+ ```
609
+
610
+ ---
611
+
612
+ ## 命令行
613
+
614
+ #### 交互式提交:
615
+ ```bash
616
+ $ g
617
+ 请输入你的提交信息: 修复了登录页样式问题
618
+ ```
619
+
620
+ #### 直接提交(跳过输入):
621
+ ```bash
622
+ $ g -y
623
+ ```
624
+
625
+ #### 传入 message 直接提交:
626
+ ```bash
627
+ $ g -m <message>
628
+ $ g -m=<message>
629
+ ```
630
+
631
+ #### 设置默认提交信息:
632
+ ```bash
633
+ $ g --set-default-message="提交"
634
+ ```
635
+
636
+ #### 获取当前配置:
637
+ ```bash
638
+ $ g get-config
639
+ ```
640
+
641
+ #### 查看帮助:
642
+ ```shell
643
+ $ g -h
644
+ $ g --help
645
+ ```
646
+
647
+ #### 定时执行自动提交(默认间隔 1 小时):
648
+ ```bash
649
+ $ g -y --interval
650
+ $ g -y --interval=<seconds>
651
+ ```
652
+
653
+ #### 指定目录提交:
654
+ ```bash
655
+ $ g --path=<path>
656
+ $ g --cwd=<path>
657
+ ```
658
+
659
+ #### 后台同步文件夹(Windows):
660
+ ```shell
661
+ start /min cmd /k "g -y --path=你要同步的文件夹 --interval"
662
+ ```
663
+
664
+ #### 定时执行命令(Windows):
665
+ ```shell
666
+ start /min cmd /k "g --cmd=\"echo hello\" --cmd-interval=5" # 每5秒执行一次
667
+ start /min cmd /k "g --cmd=\"echo at-time\" --at=23:59" # 在23:59执行一次
668
+ start /min cmd /k "g --cmd=\"echo daily\" --at=23:59 --daily" # 每天23:59执行一次
669
+ ```
670
+
671
+ #### 不显示 git diff 内容:
672
+ ```shell
673
+ $ g --no-diff
674
+ ```
675
+
676
+ #### 格式化打印 git log:
677
+ ```shell
678
+ $ g log
679
+ $ g log --n=5
680
+ ```
681
+
682
+ #### 文件锁定功能(仅在工具中有效):
683
+ ```shell
684
+ # 锁定文件(锁定后的文件不会被暂存或储藏)
685
+ $ g --lock-file=config.json
686
+
687
+ # 解锁文件
688
+ $ g --unlock-file=config.json
689
+
690
+ # 查看所有锁定的文件
691
+ $ g --list-locked
692
+
693
+ # 检查文件是否被锁定
694
+ $ g --check-lock=config.json
695
+ ```