clawt 3.9.13 → 3.10.1
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.
- package/README.md +80 -1
- package/README.zh-CN.md +81 -0
- package/dist/index.js +1935 -592
- package/dist/postinstall.js +1626 -283
- package/docs/config-file.md +2 -0
- package/docs/config.md +2 -1
- package/docs/init.md +3 -2
- package/docs/project-config.md +10 -1
- package/docs/spec.md +69 -2
- package/package.json +1 -1
- package/src/commands/alias.ts +5 -4
- package/src/commands/completion.ts +2 -1
- package/src/commands/config.ts +25 -7
- package/src/commands/cover-validate.ts +3 -2
- package/src/commands/create.ts +8 -7
- package/src/commands/home.ts +2 -1
- package/src/commands/init.ts +13 -6
- package/src/commands/list.ts +6 -4
- package/src/commands/merge.ts +8 -7
- package/src/commands/projects.ts +5 -3
- package/src/commands/remove.ts +7 -6
- package/src/commands/reset.ts +3 -2
- package/src/commands/resume.ts +10 -7
- package/src/commands/run.ts +8 -7
- package/src/commands/status.ts +16 -11
- package/src/commands/sync.ts +4 -3
- package/src/commands/tasks.ts +8 -6
- package/src/commands/validate.ts +7 -6
- package/src/constants/ai-prompts.ts +11 -11
- package/src/constants/config.ts +30 -0
- package/src/constants/index.ts +3 -2
- package/src/constants/messages/alias.ts +44 -14
- package/src/constants/messages/cli-descriptions.ts +91 -0
- package/src/constants/messages/common.ts +221 -36
- package/src/constants/messages/completion.ts +43 -14
- package/src/constants/messages/config.ts +61 -18
- package/src/constants/messages/cover-validate.ts +43 -14
- package/src/constants/messages/create.ts +16 -5
- package/src/constants/messages/home.ts +19 -6
- package/src/constants/messages/index.ts +2 -0
- package/src/constants/messages/init.ts +45 -14
- package/src/constants/messages/interactive-panel.ts +183 -29
- package/src/constants/messages/merge.ts +140 -38
- package/src/constants/messages/post-create.ts +59 -19
- package/src/constants/messages/projects.ts +51 -14
- package/src/constants/messages/remove.ts +50 -15
- package/src/constants/messages/reset.ts +14 -4
- package/src/constants/messages/resume.ts +116 -19
- package/src/constants/messages/run.ts +165 -35
- package/src/constants/messages/status.ts +84 -23
- package/src/constants/messages/sync.ts +54 -17
- package/src/constants/messages/tasks.ts +21 -7
- package/src/constants/messages/update.ts +35 -11
- package/src/constants/messages/validate.ts +218 -57
- package/src/constants/progress.ts +17 -6
- package/src/constants/project-config.ts +17 -0
- package/src/constants/prompt.ts +18 -2
- package/src/constants/tasks-template.ts +56 -2
- package/src/hooks/post-create.ts +5 -2
- package/src/index.ts +6 -5
- package/src/types/config.ts +2 -0
- package/src/utils/alias.ts +2 -1
- package/src/utils/claude.ts +10 -9
- package/src/utils/config-strategy.ts +3 -3
- package/src/utils/dry-run.ts +2 -2
- package/src/utils/formatter.ts +18 -11
- package/src/utils/i18n.ts +63 -0
- package/src/utils/index.ts +2 -0
- package/src/utils/interactive-panel-render.ts +6 -3
- package/src/utils/progress-render.ts +11 -9
- package/src/utils/prompt.ts +2 -1
- package/src/utils/task-executor.ts +10 -7
- package/src/utils/task-file.ts +2 -1
- package/src/utils/terminal.ts +9 -9
- package/src/utils/ui-prompts.ts +4 -3
- package/src/utils/update-checker.ts +1 -1
- package/src/utils/validate-branch.ts +16 -9
- package/src/utils/validate-core.ts +2 -1
- package/src/utils/validate-runner.ts +2 -2
- package/src/utils/worktree-matcher.ts +9 -7
- package/tests/unit/commands/alias.test.ts +4 -0
- package/tests/unit/commands/completion.test.ts +14 -0
- package/tests/unit/commands/config.test.ts +61 -28
- package/tests/unit/commands/cover-validate.test.ts +13 -2
- package/tests/unit/commands/init.test.ts +6 -2
- package/tests/unit/commands/merge.test.ts +14 -0
- package/tests/unit/commands/run.test.ts +17 -0
- package/tests/unit/commands/tasks.test.ts +39 -9
- package/tests/unit/constants/config.test.ts +16 -1
- package/tests/unit/constants/messages-post-create.test.ts +93 -1
- package/tests/unit/constants/messages.test.ts +85 -1
- package/tests/unit/hooks/post-create.test.ts +32 -0
- package/tests/unit/utils/alias.test.ts +14 -0
- package/tests/unit/utils/claude.test.ts +24 -4
- package/tests/unit/utils/config-strategy.test.ts +21 -0
- package/tests/unit/utils/conflict-resolver.test.ts +24 -4
- package/tests/unit/utils/formatter.test.ts +21 -0
- package/tests/unit/utils/i18n.test.ts +91 -0
- package/tests/unit/utils/progress.test.ts +39 -18
- package/tests/unit/utils/prompt.test.ts +25 -2
- package/tests/unit/utils/task-file.test.ts +73 -10
- package/tests/unit/utils/terminal-cmux.test.ts +19 -4
- package/tests/unit/utils/update-checker.test.ts +2 -0
- package/tests/unit/utils/validate-branch.test.ts +26 -1
- package/tests/unit/utils/validation.test.ts +2 -2
- package/tests/unit/utils/worktree-matcher.test.ts +2 -0
package/src/commands/reset.ts
CHANGED
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
printSuccess,
|
|
13
13
|
printInfo,
|
|
14
14
|
} from '../utils/index.js';
|
|
15
|
+
import { getCurrentLanguage } from '../utils/i18n.js';
|
|
15
16
|
|
|
16
17
|
/**
|
|
17
18
|
* 注册 reset 命令:重置主 worktree 工作区和暂存区
|
|
@@ -20,7 +21,7 @@ import {
|
|
|
20
21
|
export function registerResetCommand(program: Command): void {
|
|
21
22
|
program
|
|
22
23
|
.command('reset')
|
|
23
|
-
.description('重置主 worktree 工作区和暂存区(保留 validate 快照)')
|
|
24
|
+
.description(getCurrentLanguage() === 'en' ? 'Reset main worktree working directory and staging area (preserves validate snapshots)' : '重置主 worktree 工作区和暂存区(保留 validate 快照)')
|
|
24
25
|
.action(async () => {
|
|
25
26
|
await handleReset();
|
|
26
27
|
});
|
|
@@ -40,7 +41,7 @@ async function handleReset(): Promise<void> {
|
|
|
40
41
|
if (getConfigValue('confirmDestructiveOps')) {
|
|
41
42
|
const confirmed = await confirmDestructiveAction(
|
|
42
43
|
'git reset --hard + git clean -fd',
|
|
43
|
-
'丢弃所有未提交的更改',
|
|
44
|
+
getCurrentLanguage() === 'en' ? 'Discard all uncommitted changes' : '丢弃所有未提交的更改',
|
|
44
45
|
);
|
|
45
46
|
if (!confirmed) {
|
|
46
47
|
printInfo(MESSAGES.DESTRUCTIVE_OP_CANCELLED);
|
package/src/commands/resume.ts
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
executeBatchTasks,
|
|
24
24
|
} from '../utils/index.js';
|
|
25
25
|
import type { WorktreeMultiResolveMessages } from '../utils/index.js';
|
|
26
|
+
import { getCurrentLanguage } from '../utils/i18n.js';
|
|
26
27
|
|
|
27
28
|
/** resume 命令的多选分支解析消息配置 */
|
|
28
29
|
const RESUME_RESOLVE_MESSAGES: WorktreeMultiResolveMessages = {
|
|
@@ -39,11 +40,11 @@ const RESUME_RESOLVE_MESSAGES: WorktreeMultiResolveMessages = {
|
|
|
39
40
|
export function registerResumeCommand(program: Command): void {
|
|
40
41
|
program
|
|
41
42
|
.command('resume')
|
|
42
|
-
.description('在已有 worktree 中恢复 Claude Code 会话(支持多选批量恢复)')
|
|
43
|
-
.option('-b, --branch <branchName>', '要恢复的分支名(支持模糊匹配,不传则列出所有分支)')
|
|
44
|
-
.option('--prompt <content>', '非交互式追问(需配合 -b 指定分支)')
|
|
45
|
-
.option('-f, --file <path>', '从任务文件批量追问(通过 branch 名匹配已有 worktree)')
|
|
46
|
-
.option('-c, --concurrency <n>', '批量追问最大并发数,0 表示不限制')
|
|
43
|
+
.description(getCurrentLanguage() === 'en' ? 'Resume Claude Code sessions in existing worktrees (supports multi-select batch resume)' : '在已有 worktree 中恢复 Claude Code 会话(支持多选批量恢复)')
|
|
44
|
+
.option('-b, --branch <branchName>', getCurrentLanguage() === 'en' ? 'Branch name to resume (supports fuzzy match, lists all branches if not provided)' : '要恢复的分支名(支持模糊匹配,不传则列出所有分支)')
|
|
45
|
+
.option('--prompt <content>', getCurrentLanguage() === 'en' ? 'Non-interactive follow-up prompt (requires -b to specify branch)' : '非交互式追问(需配合 -b 指定分支)')
|
|
46
|
+
.option('-f, --file <path>', getCurrentLanguage() === 'en' ? 'Batch follow-up from task file (matches existing worktrees by branch name)' : '从任务文件批量追问(通过 branch 名匹配已有 worktree)')
|
|
47
|
+
.option('-c, --concurrency <n>', getCurrentLanguage() === 'en' ? 'Max concurrency for batch follow-ups, 0 means unlimited' : '批量追问最大并发数,0 表示不限制')
|
|
47
48
|
.action(async (options: ResumeOptions) => {
|
|
48
49
|
await handleResume(options);
|
|
49
50
|
});
|
|
@@ -179,9 +180,11 @@ async function handleNonInteractiveBatchResume(filePath: string, options: Resume
|
|
|
179
180
|
* @param {Map<string, boolean>} sessionMap - worktree 路径 → 是否存在历史会话的映射
|
|
180
181
|
*/
|
|
181
182
|
function printBatchResumePreview(worktrees: WorktreeInfo[], sessionMap: Map<string, boolean>): void {
|
|
182
|
-
printInfo('即将恢复的分支:');
|
|
183
|
+
printInfo(getCurrentLanguage() === 'en' ? 'Branches to resume:' : '即将恢复的分支:');
|
|
183
184
|
for (const wt of worktrees) {
|
|
184
|
-
const modeLabel = sessionMap.get(wt.path)
|
|
185
|
+
const modeLabel = sessionMap.get(wt.path)
|
|
186
|
+
? (getCurrentLanguage() === 'en' ? 'continue' : '继续上次对话')
|
|
187
|
+
: (getCurrentLanguage() === 'en' ? 'new session' : '新对话');
|
|
185
188
|
printInfo(` - ${wt.branch} (${modeLabel})`);
|
|
186
189
|
}
|
|
187
190
|
printInfo('');
|
package/src/commands/run.ts
CHANGED
|
@@ -22,6 +22,7 @@ import {
|
|
|
22
22
|
printDryRunPreview,
|
|
23
23
|
runPostCreateHooks,
|
|
24
24
|
} from '../utils/index.js';
|
|
25
|
+
import { getCurrentLanguage } from '../utils/i18n.js';
|
|
25
26
|
|
|
26
27
|
/**
|
|
27
28
|
* 注册 run 命令:批量创建 worktree + 启动 Claude Code 执行任务(支持任务文件)
|
|
@@ -30,13 +31,13 @@ import {
|
|
|
30
31
|
export function registerRunCommand(program: Command): void {
|
|
31
32
|
program
|
|
32
33
|
.command('run')
|
|
33
|
-
.description('批量创建 worktree + 启动 Claude Code 执行任务(支持任务文件)')
|
|
34
|
-
.option('-b, --branch <branchName>', '分支名')
|
|
35
|
-
.option('--tasks <task...>', '任务列表(可多次指定),不传则在 worktree 中打开 Claude Code 交互式界面')
|
|
36
|
-
.option('-c, --concurrency <n>', '最大并发数,0 表示不限制')
|
|
37
|
-
.option('-f, --file <path>', '从任务文件读取任务列表(与 --tasks 互斥)')
|
|
38
|
-
.option('--dry-run', '预览模式,仅展示任务计划不实际执行')
|
|
39
|
-
.option('--post-create', '执行 postCreate hook(默认开启,--no-post-create 跳过)', true)
|
|
34
|
+
.description(getCurrentLanguage() === 'en' ? 'Batch create worktrees + launch Claude Code to execute tasks (supports task files)' : '批量创建 worktree + 启动 Claude Code 执行任务(支持任务文件)')
|
|
35
|
+
.option('-b, --branch <branchName>', getCurrentLanguage() === 'en' ? 'Branch name' : '分支名')
|
|
36
|
+
.option('--tasks <task...>', getCurrentLanguage() === 'en' ? 'Task list (can be specified multiple times); opens Claude Code interactive UI in worktree if omitted' : '任务列表(可多次指定),不传则在 worktree 中打开 Claude Code 交互式界面')
|
|
37
|
+
.option('-c, --concurrency <n>', getCurrentLanguage() === 'en' ? 'Max concurrency, 0 means unlimited' : '最大并发数,0 表示不限制')
|
|
38
|
+
.option('-f, --file <path>', getCurrentLanguage() === 'en' ? 'Read task list from file (mutually exclusive with --tasks)' : '从任务文件读取任务列表(与 --tasks 互斥)')
|
|
39
|
+
.option('--dry-run', getCurrentLanguage() === 'en' ? 'Preview mode, show task plan without executing' : '预览模式,仅展示任务计划不实际执行')
|
|
40
|
+
.option('--post-create', getCurrentLanguage() === 'en' ? 'Execute postCreate hook (enabled by default, use --no-post-create to skip)' : '执行 postCreate hook(默认开启,--no-post-create 跳过)', true)
|
|
40
41
|
.action(async (options: RunOptions) => {
|
|
41
42
|
await handleRun(options);
|
|
42
43
|
});
|
package/src/commands/status.ts
CHANGED
|
@@ -24,6 +24,7 @@ import {
|
|
|
24
24
|
loadProjectConfig,
|
|
25
25
|
checkBranchExists,
|
|
26
26
|
} from '../utils/index.js';
|
|
27
|
+
import { getCurrentLanguage } from '../utils/i18n.js';
|
|
27
28
|
|
|
28
29
|
/**
|
|
29
30
|
* 注册 status 命令:显示项目全局状态总览
|
|
@@ -32,9 +33,9 @@ import {
|
|
|
32
33
|
export function registerStatusCommand(program: Command): void {
|
|
33
34
|
program
|
|
34
35
|
.command('status')
|
|
35
|
-
.description('显示项目全局状态总览(支持 --json 格式输出)')
|
|
36
|
-
.option('--json', '以 JSON 格式输出')
|
|
37
|
-
.option('-i, --interactive', '交互式面板模式')
|
|
36
|
+
.description(getCurrentLanguage() === 'en' ? 'Show project global status overview (supports --json output)' : '显示项目全局状态总览(支持 --json 格式输出)')
|
|
37
|
+
.option('--json', getCurrentLanguage() === 'en' ? 'Output in JSON format' : '以 JSON 格式输出')
|
|
38
|
+
.option('-i, --interactive', getCurrentLanguage() === 'en' ? 'Interactive panel mode' : '交互式面板模式')
|
|
38
39
|
.action(async (options: StatusOptions) => {
|
|
39
40
|
await handleStatus(options);
|
|
40
41
|
});
|
|
@@ -291,12 +292,13 @@ function printStatusAsText(result: StatusResult): void {
|
|
|
291
292
|
* @param {MainWorktreeStatus} main - 主 worktree 状态
|
|
292
293
|
*/
|
|
293
294
|
function printMainSection(main: MainWorktreeStatus): void {
|
|
295
|
+
const lang = getCurrentLanguage();
|
|
294
296
|
printInfo(` ${chalk.bold('◆')} ${chalk.bold(MESSAGES.STATUS_MAIN_SECTION)}`);
|
|
295
|
-
printInfo(`
|
|
297
|
+
printInfo(` ${lang === 'en' ? 'Branch' : '分支'}: ${chalk.bold(main.branch)}`);
|
|
296
298
|
if (main.isClean) {
|
|
297
|
-
printInfo(`
|
|
299
|
+
printInfo(` ${lang === 'en' ? 'Status' : '状态'}: ${chalk.green(lang === 'en' ? '✓ Clean' : '✓ 干净')}`);
|
|
298
300
|
} else {
|
|
299
|
-
printInfo(`
|
|
301
|
+
printInfo(` ${lang === 'en' ? 'Status' : '状态'}: ${chalk.yellow(lang === 'en' ? '✗ Uncommitted changes' : '✗ 有未提交修改')}`);
|
|
300
302
|
}
|
|
301
303
|
|
|
302
304
|
// 配置分支信息展示
|
|
@@ -319,7 +321,8 @@ function printMainSection(main: MainWorktreeStatus): void {
|
|
|
319
321
|
* @param {number} total - worktree 总数
|
|
320
322
|
*/
|
|
321
323
|
function printWorktreesSection(worktrees: WorktreeDetailedStatus[], total: number): void {
|
|
322
|
-
|
|
324
|
+
const lang = getCurrentLanguage();
|
|
325
|
+
printInfo(` ${chalk.bold('◆')} ${chalk.bold(MESSAGES.STATUS_WORKTREES_SECTION)} (${total} ${lang === 'en' ? 'items' : '个'})`);
|
|
323
326
|
printInfo('');
|
|
324
327
|
|
|
325
328
|
if (worktrees.length === 0) {
|
|
@@ -337,6 +340,7 @@ function printWorktreesSection(worktrees: WorktreeDetailedStatus[], total: numbe
|
|
|
337
340
|
* @param {WorktreeDetailedStatus} wt - worktree 详细状态
|
|
338
341
|
*/
|
|
339
342
|
function printWorktreeItem(wt: WorktreeDetailedStatus): void {
|
|
343
|
+
const lang = getCurrentLanguage();
|
|
340
344
|
// 分支名 + 变更状态标签
|
|
341
345
|
const statusLabel = formatChangeStatusLabel(wt.changeStatus);
|
|
342
346
|
printInfo(` ${chalk.bold('●')} ${chalk.bold(wt.branch)} [${statusLabel}]`);
|
|
@@ -348,14 +352,14 @@ function printWorktreeItem(wt: WorktreeDetailedStatus): void {
|
|
|
348
352
|
|
|
349
353
|
// 本地提交数
|
|
350
354
|
if (wt.commitsAhead > 0) {
|
|
351
|
-
printInfo(` ${chalk.yellow(`${wt.commitsAhead} 个本地提交`)}`);
|
|
355
|
+
printInfo(` ${chalk.yellow(lang === 'en' ? `${wt.commitsAhead} local commit(s)` : `${wt.commitsAhead} 个本地提交`)}`);
|
|
352
356
|
}
|
|
353
357
|
|
|
354
358
|
// 与主分支的同步状态
|
|
355
359
|
if (wt.commitsBehind > 0) {
|
|
356
|
-
printInfo(` ${chalk.yellow(`落后主分支 ${wt.commitsBehind} 个提交`)}`);
|
|
360
|
+
printInfo(` ${chalk.yellow(lang === 'en' ? `Behind main by ${wt.commitsBehind} commit(s)` : `落后主分支 ${wt.commitsBehind} 个提交`)}`);
|
|
357
361
|
} else {
|
|
358
|
-
printInfo(` ${chalk.green('与主分支同步')}`);
|
|
362
|
+
printInfo(` ${chalk.green(lang === 'en' ? 'In sync with main' : '与主分支同步')}`);
|
|
359
363
|
}
|
|
360
364
|
|
|
361
365
|
// 分支创建时间
|
|
@@ -402,7 +406,8 @@ function formatChangeStatusLabel(status: WorktreeDetailedStatus['changeStatus'])
|
|
|
402
406
|
* @param {SnapshotSummary} snapshots - 快照摘要信息
|
|
403
407
|
*/
|
|
404
408
|
function printSnapshotsSection(snapshots: SnapshotSummary): void {
|
|
405
|
-
|
|
409
|
+
const lang = getCurrentLanguage();
|
|
410
|
+
printInfo(` ${chalk.bold('◆')} ${chalk.bold(MESSAGES.STATUS_SNAPSHOTS_SECTION)} (${snapshots.total} ${lang === 'en' ? 'items' : '个'})`);
|
|
406
411
|
if (snapshots.orphaned > 0) {
|
|
407
412
|
printInfo(` ${chalk.yellow(MESSAGES.STATUS_SNAPSHOT_ORPHANED(snapshots.orphaned))}`);
|
|
408
413
|
}
|
package/src/commands/sync.ts
CHANGED
|
@@ -23,6 +23,7 @@ import {
|
|
|
23
23
|
buildAutoSaveCommitMessage,
|
|
24
24
|
} from '../utils/index.js';
|
|
25
25
|
import type { WorktreeResolveMessages } from '../utils/index.js';
|
|
26
|
+
import { getCurrentLanguage } from '../utils/i18n.js';
|
|
26
27
|
|
|
27
28
|
/**
|
|
28
29
|
* 注册 sync 命令:将主分支最新代码同步到目标 worktree(含验证分支重建)
|
|
@@ -31,8 +32,8 @@ import type { WorktreeResolveMessages } from '../utils/index.js';
|
|
|
31
32
|
export function registerSyncCommand(program: Command): void {
|
|
32
33
|
program
|
|
33
34
|
.command('sync')
|
|
34
|
-
.description('将主分支最新代码同步到目标 worktree')
|
|
35
|
-
.option('-b, --branch <branchName>', '要同步的分支名(支持模糊匹配,不传则列出所有分支)')
|
|
35
|
+
.description(getCurrentLanguage() === 'en' ? 'Sync the latest code from the main branch to the target worktree' : '将主分支最新代码同步到目标 worktree')
|
|
36
|
+
.option('-b, --branch <branchName>', getCurrentLanguage() === 'en' ? 'Branch name to sync (supports fuzzy match, lists all branches if not provided)' : '要同步的分支名(支持模糊匹配,不传则列出所有分支)')
|
|
36
37
|
.action(async (options: SyncOptions) => {
|
|
37
38
|
await handleSync(options);
|
|
38
39
|
});
|
|
@@ -75,7 +76,7 @@ function mergeMainBranch(worktreePath: string, mainBranch: string): boolean {
|
|
|
75
76
|
return true;
|
|
76
77
|
}
|
|
77
78
|
// 非冲突错误则向上抛出
|
|
78
|
-
throw new ClawtError(`合并 ${mainBranch} 失败`);
|
|
79
|
+
throw new ClawtError(getCurrentLanguage() === 'en' ? `Merge of ${mainBranch} failed` : `合并 ${mainBranch} 失败`);
|
|
79
80
|
}
|
|
80
81
|
}
|
|
81
82
|
|
package/src/commands/tasks.ts
CHANGED
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
import { resolve, dirname, join } from 'node:path';
|
|
2
2
|
import { existsSync, writeFileSync } from 'node:fs';
|
|
3
3
|
import type { Command } from 'commander';
|
|
4
|
-
import { MESSAGES, TASK_TEMPLATE_OUTPUT_DIR, TASK_TEMPLATE_FILENAME_PREFIX
|
|
4
|
+
import { MESSAGES, TASK_TEMPLATE_OUTPUT_DIR, TASK_TEMPLATE_FILENAME_PREFIX } from '../constants/index.js';
|
|
5
|
+
import { getTaskTemplateContent } from '../constants/tasks-template.js';
|
|
5
6
|
import { ClawtError } from '../errors/index.js';
|
|
6
7
|
import { logger } from '../logger/index.js';
|
|
7
8
|
import { printSuccess, printHint, ensureDir, generateTaskFilename } from '../utils/index.js';
|
|
9
|
+
import { getCurrentLanguage } from '../utils/i18n.js';
|
|
8
10
|
|
|
9
11
|
/**
|
|
10
12
|
* 注册 tasks 命令组及其子命令
|
|
@@ -13,12 +15,12 @@ import { printSuccess, printHint, ensureDir, generateTaskFilename } from '../uti
|
|
|
13
15
|
export function registerTasksCommand(program: Command): void {
|
|
14
16
|
const taskCmd = program
|
|
15
17
|
.command('tasks')
|
|
16
|
-
.description('任务文件管理');
|
|
18
|
+
.description(getCurrentLanguage() === 'en' ? 'Task file management' : '任务文件管理');
|
|
17
19
|
|
|
18
20
|
taskCmd
|
|
19
21
|
.command('init')
|
|
20
|
-
.description('生成任务模板文件')
|
|
21
|
-
.argument('[path]', '输出文件路径')
|
|
22
|
+
.description(getCurrentLanguage() === 'en' ? 'Generate task template file' : '生成任务模板文件')
|
|
23
|
+
.argument('[path]', getCurrentLanguage() === 'en' ? 'Output file path' : '输出文件路径')
|
|
22
24
|
.action(async (path?: string) => {
|
|
23
25
|
// 未指定路径时,默认输出到 .clawt/tasks/ 目录下
|
|
24
26
|
const filePath = path ?? join(TASK_TEMPLATE_OUTPUT_DIR, generateTaskFilename(TASK_TEMPLATE_FILENAME_PREFIX));
|
|
@@ -43,8 +45,8 @@ async function handleTasksInit(filePath: string): Promise<void> {
|
|
|
43
45
|
// 确保父目录存在
|
|
44
46
|
ensureDir(dirname(absolutePath));
|
|
45
47
|
|
|
46
|
-
//
|
|
47
|
-
writeFileSync(absolutePath,
|
|
48
|
+
// 写入模板内容(根据语言动态生成)
|
|
49
|
+
writeFileSync(absolutePath, getTaskTemplateContent(), 'utf-8');
|
|
48
50
|
|
|
49
51
|
printSuccess(MESSAGES.TASK_INIT_SUCCESS(filePath));
|
|
50
52
|
printHint(MESSAGES.TASK_INIT_HINT(filePath));
|
package/src/commands/validate.ts
CHANGED
|
@@ -37,6 +37,7 @@ import {
|
|
|
37
37
|
removeExternalSymlinks,
|
|
38
38
|
} from '../utils/index.js';
|
|
39
39
|
import type { WorktreeResolveMessages } from '../utils/index.js';
|
|
40
|
+
import { getCurrentLanguage } from '../utils/i18n.js';
|
|
40
41
|
|
|
41
42
|
/** validate 命令的分支解析消息配置 */
|
|
42
43
|
const VALIDATE_RESOLVE_MESSAGES: WorktreeResolveMessages = {
|
|
@@ -53,10 +54,10 @@ const VALIDATE_RESOLVE_MESSAGES: WorktreeResolveMessages = {
|
|
|
53
54
|
export function registerValidateCommand(program: Command): void {
|
|
54
55
|
program
|
|
55
56
|
.command('validate')
|
|
56
|
-
.description('在主 worktree 验证某个 worktree 分支的变更(通过验证分支)')
|
|
57
|
-
.option('-b, --branch <branchName>', '要验证的分支名(支持模糊匹配,不传则列出所有分支)')
|
|
58
|
-
.option('--clean', '清理 validate 状态(重置主 worktree 并删除快照)')
|
|
59
|
-
.option('-r, --run <command>', 'validate 成功后在主 worktree 中执行的命令')
|
|
57
|
+
.description(getCurrentLanguage() === 'en' ? 'Validate a worktree branch\'s changes in the main worktree (via validation branch)' : '在主 worktree 验证某个 worktree 分支的变更(通过验证分支)')
|
|
58
|
+
.option('-b, --branch <branchName>', getCurrentLanguage() === 'en' ? 'Branch name to validate (supports fuzzy match, lists all branches if not provided)' : '要验证的分支名(支持模糊匹配,不传则列出所有分支)')
|
|
59
|
+
.option('--clean', getCurrentLanguage() === 'en' ? 'Clean validate state (reset main worktree and delete snapshot)' : '清理 validate 状态(重置主 worktree 并删除快照)')
|
|
60
|
+
.option('-r, --run <command>', getCurrentLanguage() === 'en' ? 'Command to execute in the main worktree after successful validation' : 'validate 成功后在主 worktree 中执行的命令')
|
|
60
61
|
.action(async (options: ValidateOptions) => {
|
|
61
62
|
await handleValidate(options);
|
|
62
63
|
});
|
|
@@ -114,7 +115,7 @@ async function handleValidateClean(options: ValidateOptions): Promise<void> {
|
|
|
114
115
|
if (getConfigValue('confirmDestructiveOps')) {
|
|
115
116
|
const confirmed = await confirmDestructiveAction(
|
|
116
117
|
'git reset --hard + git clean -fd',
|
|
117
|
-
`重置主 worktree 并删除分支 ${branchName} 的 validate 快照`,
|
|
118
|
+
getCurrentLanguage() === 'en' ? `Reset main worktree and delete validate snapshot for branch ${branchName}` : `重置主 worktree 并删除分支 ${branchName} 的 validate 快照`,
|
|
118
119
|
);
|
|
119
120
|
if (!confirmed) {
|
|
120
121
|
printInfo(MESSAGES.DESTRUCTIVE_OP_CANCELLED);
|
|
@@ -212,7 +213,7 @@ async function handleIncrementalValidate(targetWorktreePath: string, mainWorktre
|
|
|
212
213
|
try {
|
|
213
214
|
gitReadTree(oldStagedTreeHash, mainWorktreePath);
|
|
214
215
|
} catch (error) {
|
|
215
|
-
logger.warn(`恢复暂存区失败: ${error}`);
|
|
216
|
+
logger.warn(getCurrentLanguage() === 'en' ? `Failed to restore staging area: ${error}` : `恢复暂存区失败: ${error}`);
|
|
216
217
|
}
|
|
217
218
|
}
|
|
218
219
|
printInfo(MESSAGES.INCREMENTAL_VALIDATE_NO_CHANGES(branchName));
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
/** Claude Code 冲突解决指令性 prompt */
|
|
2
|
-
export const CONFLICT_RESOLVE_PROMPT =
|
|
1
|
+
/** Claude Code 冲突解决指令性 prompt(始终英文,不跟随语言切换) */
|
|
2
|
+
export const CONFLICT_RESOLVE_PROMPT = `You are a Git merge conflict resolution expert. The repository is currently in a merge conflict state.
|
|
3
3
|
|
|
4
|
-
##
|
|
4
|
+
## Task
|
|
5
5
|
|
|
6
|
-
1.
|
|
7
|
-
2.
|
|
8
|
-
3.
|
|
9
|
-
4.
|
|
10
|
-
5.
|
|
11
|
-
6.
|
|
12
|
-
7.
|
|
6
|
+
1. Use git status and git diff to examine the list of conflicted files and their contents
|
|
7
|
+
2. Use git log to analyze the change intent of each branch
|
|
8
|
+
3. Directly edit each conflicted file, removing all conflict markers (<<<<<<<, =======, >>>>>>>)
|
|
9
|
+
4. Preserve meaningful changes from both sides, merging code logic appropriately
|
|
10
|
+
5. If both branches modified the same section with different intents, prioritize code correctness and completeness
|
|
11
|
+
6. After resolving conflicts, ensure code syntax is correct and logic is complete
|
|
12
|
+
7. Do not add any comments explaining your modifications, only modify file contents
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
Please begin.`;
|
package/src/constants/config.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import type { ClawtConfig, ConfigDefinitions } from '../types/index.js';
|
|
2
2
|
import { VALID_TERMINAL_APPS } from './terminal.js';
|
|
3
|
+
import { getCurrentLanguage } from '../utils/i18n.js';
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* 通过 clawt 启动的 Claude Code 非交互式会话(claude -p)的 entrypoint 标识
|
|
@@ -12,6 +13,11 @@ export const CLAUDE_CODE_ENTRYPOINT_VALUE = 'cli';
|
|
|
12
13
|
* 新增配置项时只需在此处维护,DEFAULT_CONFIG 和 CONFIG_DESCRIPTIONS 会自动同步
|
|
13
14
|
*/
|
|
14
15
|
export const CONFIG_DEFINITIONS: ConfigDefinitions = {
|
|
16
|
+
language: {
|
|
17
|
+
defaultValue: 'en',
|
|
18
|
+
description: '界面语言:en(英文)、zh-CN(中文)',
|
|
19
|
+
allowedValues: ['en', 'zh-CN'] as const,
|
|
20
|
+
},
|
|
15
21
|
autoDeleteBranch: {
|
|
16
22
|
defaultValue: false,
|
|
17
23
|
description: '移除 worktree 时是否自动删除对应本地分支',
|
|
@@ -89,3 +95,27 @@ export const DEFAULT_CONFIG: ClawtConfig = deriveDefaultConfig(CONFIG_DEFINITION
|
|
|
89
95
|
|
|
90
96
|
/** 配置项描述映射 */
|
|
91
97
|
export const CONFIG_DESCRIPTIONS: Record<keyof ClawtConfig, string> = deriveConfigDescriptions(CONFIG_DEFINITIONS);
|
|
98
|
+
|
|
99
|
+
/** 配置项英文描述映射 */
|
|
100
|
+
const CONFIG_DESCRIPTIONS_EN: Record<keyof ClawtConfig, string> = {
|
|
101
|
+
language: 'Interface language: en (English), zh-CN (Chinese)',
|
|
102
|
+
autoDeleteBranch: 'Whether to auto-delete the local branch when removing a worktree',
|
|
103
|
+
claudeCodeCommand: 'Claude Code CLI launch command',
|
|
104
|
+
autoPullPush: 'Whether to auto-run git pull and git push after merge',
|
|
105
|
+
confirmDestructiveOps: 'Whether to prompt for confirmation before destructive operations (reset, validate --clean)',
|
|
106
|
+
maxConcurrency: 'Default max concurrency for run command, 0 means unlimited',
|
|
107
|
+
terminalApp: 'Terminal app for batch resume: auto (auto-detect), iterm2, terminal, cmux (macOS)',
|
|
108
|
+
resumeInPlace: 'Whether to resume in current terminal (single select), false opens in new tab via terminalApp',
|
|
109
|
+
aliases: 'Command alias mapping',
|
|
110
|
+
autoUpdate: 'Whether to enable auto-update checks (every 24 hours via npm registry)',
|
|
111
|
+
conflictResolveMode: 'Merge conflict resolution mode: ask (prompt for AI), auto (auto AI resolve), manual (manual resolve)',
|
|
112
|
+
conflictResolveTimeoutMs: 'Claude Code conflict resolution timeout (ms), default 900000 (15 min)',
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
/**
|
|
116
|
+
* 获取国际化配置项描述映射
|
|
117
|
+
* @returns {Record<keyof ClawtConfig, string>} 当前语言的配置项描述映射
|
|
118
|
+
*/
|
|
119
|
+
export function getI18nConfigDescriptions(): Record<keyof ClawtConfig, string> {
|
|
120
|
+
return getCurrentLanguage() === 'en' ? CONFIG_DESCRIPTIONS_EN : CONFIG_DESCRIPTIONS;
|
|
121
|
+
}
|
package/src/constants/index.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { CONFIG_ALIAS_DISABLED_HINT } from './messages/index.js';
|
|
|
5
5
|
export { UPDATE_MESSAGES, UPDATE_COMMANDS } from './messages/update.js';
|
|
6
6
|
export { EXIT_CODES } from './exitCodes.js';
|
|
7
7
|
export { ENABLE_BRACKETED_PASTE, DISABLE_BRACKETED_PASTE, PASTE_THRESHOLD_MS, VALID_TERMINAL_APPS, ITERM2_APP_PATH } from './terminal.js';
|
|
8
|
-
export { DEFAULT_CONFIG, CONFIG_DESCRIPTIONS, CONFIG_DEFINITIONS, CLAUDE_CODE_ENTRYPOINT_VALUE } from './config.js';
|
|
9
|
-
export { PROJECT_CONFIG_DEFINITIONS, PROJECT_DEFAULT_CONFIG, PROJECT_CONFIG_DESCRIPTIONS } from './project-config.js';
|
|
8
|
+
export { DEFAULT_CONFIG, CONFIG_DESCRIPTIONS, CONFIG_DEFINITIONS, CLAUDE_CODE_ENTRYPOINT_VALUE, getI18nConfigDescriptions } from './config.js';
|
|
9
|
+
export { PROJECT_CONFIG_DEFINITIONS, PROJECT_DEFAULT_CONFIG, PROJECT_CONFIG_DESCRIPTIONS, getI18nProjectConfigDescriptions } from './project-config.js';
|
|
10
10
|
export { AUTO_SAVE_COMMIT_MESSAGE_PREFIX } from './git.js';
|
|
11
11
|
export { DEBUG_LOG_PREFIX, DEBUG_TIMESTAMP_FORMAT } from './logger.js';
|
|
12
12
|
export { UPDATE_CHECK_INTERVAL_MS, NPM_REGISTRY_URL, NPM_REGISTRY_TIMEOUT_MS, PACKAGE_NAME } from './update.js';
|
|
@@ -17,6 +17,7 @@ export {
|
|
|
17
17
|
CURSOR_SHOW,
|
|
18
18
|
TASK_STATUS_ICONS,
|
|
19
19
|
TASK_STATUS_LABELS,
|
|
20
|
+
getTaskStatusLabels,
|
|
20
21
|
ACTIVITY_TEXT_MAX_LENGTH,
|
|
21
22
|
TEXT_ACTIVITY_PREFIX,
|
|
22
23
|
RESULT_PREVIEW_MAX_LENGTH,
|
|
@@ -1,22 +1,52 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { createMessages } from '../../utils/i18n.js';
|
|
2
|
+
|
|
3
|
+
/** alias 命令专属提示消息(双语映射) */
|
|
4
|
+
const ALIAS_MESSAGES_I18N = {
|
|
3
5
|
/** 别名列表为空 */
|
|
4
|
-
ALIAS_LIST_EMPTY:
|
|
6
|
+
ALIAS_LIST_EMPTY: {
|
|
7
|
+
en: '(No aliases)',
|
|
8
|
+
'zh-CN': '(无别名)',
|
|
9
|
+
},
|
|
5
10
|
/** 别名设置成功 */
|
|
6
|
-
ALIAS_SET_SUCCESS:
|
|
7
|
-
|
|
11
|
+
ALIAS_SET_SUCCESS: {
|
|
12
|
+
en: (alias: string, command: string) =>
|
|
13
|
+
`✓ Alias set: ${alias} → ${command}`,
|
|
14
|
+
'zh-CN': (alias: string, command: string) =>
|
|
15
|
+
`✓ 已设置别名: ${alias} → ${command}`,
|
|
16
|
+
},
|
|
8
17
|
/** 别名移除成功 */
|
|
9
|
-
ALIAS_REMOVE_SUCCESS:
|
|
10
|
-
|
|
18
|
+
ALIAS_REMOVE_SUCCESS: {
|
|
19
|
+
en: (alias: string) =>
|
|
20
|
+
`✓ Alias removed: ${alias}`,
|
|
21
|
+
'zh-CN': (alias: string) =>
|
|
22
|
+
`✓ 已移除别名: ${alias}`,
|
|
23
|
+
},
|
|
11
24
|
/** 别名不存在 */
|
|
12
|
-
ALIAS_NOT_FOUND:
|
|
13
|
-
|
|
25
|
+
ALIAS_NOT_FOUND: {
|
|
26
|
+
en: (alias: string) =>
|
|
27
|
+
`Alias "${alias}" does not exist`,
|
|
28
|
+
'zh-CN': (alias: string) =>
|
|
29
|
+
`别名 "${alias}" 不存在`,
|
|
30
|
+
},
|
|
14
31
|
/** 别名与内置命令冲突 */
|
|
15
|
-
ALIAS_CONFLICTS_BUILTIN:
|
|
16
|
-
|
|
32
|
+
ALIAS_CONFLICTS_BUILTIN: {
|
|
33
|
+
en: (alias: string) =>
|
|
34
|
+
`Alias "${alias}" conflicts with a built-in command. Overriding built-in commands is not allowed`,
|
|
35
|
+
'zh-CN': (alias: string) =>
|
|
36
|
+
`别名 "${alias}" 与内置命令冲突,不允许覆盖内置命令`,
|
|
37
|
+
},
|
|
17
38
|
/** 目标命令不存在 */
|
|
18
|
-
ALIAS_TARGET_NOT_FOUND:
|
|
19
|
-
|
|
39
|
+
ALIAS_TARGET_NOT_FOUND: {
|
|
40
|
+
en: (command: string) =>
|
|
41
|
+
`Target command "${command}" does not exist. Please specify a registered built-in command name`,
|
|
42
|
+
'zh-CN': (command: string) =>
|
|
43
|
+
`目标命令 "${command}" 不存在,请指定已注册的内置命令名`,
|
|
44
|
+
},
|
|
20
45
|
/** 别名列表标题 */
|
|
21
|
-
ALIAS_LIST_TITLE:
|
|
46
|
+
ALIAS_LIST_TITLE: {
|
|
47
|
+
en: 'Current aliases:',
|
|
48
|
+
'zh-CN': '当前别名列表:',
|
|
49
|
+
},
|
|
22
50
|
} as const;
|
|
51
|
+
|
|
52
|
+
export const ALIAS_MESSAGES = createMessages(ALIAS_MESSAGES_I18N);
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import { createMessages } from '../../utils/i18n.js';
|
|
2
|
+
|
|
3
|
+
/** Commander description/option 文本(双语映射) */
|
|
4
|
+
const CLI_DESCRIPTIONS_I18N = {
|
|
5
|
+
// 主程序
|
|
6
|
+
PROGRAM_DESC: {
|
|
7
|
+
en: 'Run multiple Claude Code Agent tasks in parallel based on Git Worktree',
|
|
8
|
+
'zh-CN': '本地并行执行多个Claude Code Agent任务,融合 Git Worktree 与 Claude Code CLI 的命令行工具',
|
|
9
|
+
},
|
|
10
|
+
OPTION_DEBUG: {
|
|
11
|
+
en: 'Output debug information to terminal',
|
|
12
|
+
'zh-CN': '输出详细调试信息到终端',
|
|
13
|
+
},
|
|
14
|
+
OPTION_YES: {
|
|
15
|
+
en: 'Skip all interactive confirmations, suitable for scripts/CI',
|
|
16
|
+
'zh-CN': '跳过所有交互式确认,适用于脚本/CI 环境',
|
|
17
|
+
},
|
|
18
|
+
// config 命令
|
|
19
|
+
CONFIG_DESC: { en: 'Interactively view and modify global configuration', 'zh-CN': '交互式查看和修改全局配置' },
|
|
20
|
+
CONFIG_RESET_DESC: { en: 'Reset configuration to defaults', 'zh-CN': '将配置恢复为默认值' },
|
|
21
|
+
CONFIG_SET_DESC: { en: 'Set a configuration item (interactive without args)', 'zh-CN': '修改配置项(无参数进入交互式配置)' },
|
|
22
|
+
CONFIG_GET_DESC: { en: 'Get a configuration item value', 'zh-CN': '获取单个配置项的值' },
|
|
23
|
+
// init 命令
|
|
24
|
+
INIT_DESC: { en: 'Initialize project-level configuration, set main work branch', 'zh-CN': '初始化项目级配置,设置主工作分支' },
|
|
25
|
+
INIT_OPTION_BRANCH: { en: 'Specify main work branch name (defaults to current branch)', 'zh-CN': '指定主工作分支名(默认使用当前分支)' },
|
|
26
|
+
INIT_SHOW_DESC: { en: 'Interactively view and modify project configuration (supports --json)', 'zh-CN': '交互式查看和修改项目配置(支持 --json 格式输出)' },
|
|
27
|
+
INIT_OPTION_JSON: { en: 'Output in JSON format', 'zh-CN': '以 JSON 格式输出' },
|
|
28
|
+
// create 命令
|
|
29
|
+
CREATE_DESC: { en: 'Batch create worktrees and branches (with validate branches)', 'zh-CN': '批量创建 worktree 及对应分支(含验证分支)' },
|
|
30
|
+
CREATE_OPTION_NUMBER: { en: 'Number of worktrees to create', 'zh-CN': '创建数量' },
|
|
31
|
+
CREATE_OPTION_POST_CREATE: { en: 'Run postCreate hook (default on, --no-post-create to skip)', 'zh-CN': '执行 postCreate hook(默认开启,--no-post-create 跳过)' },
|
|
32
|
+
// run 命令
|
|
33
|
+
RUN_DESC: { en: 'Batch create worktrees + run Claude Code tasks (supports task files)', 'zh-CN': '批量创建 worktree + 启动 Claude Code 执行任务(支持任务文件)' },
|
|
34
|
+
RUN_OPTION_BRANCH: { en: 'Branch name', 'zh-CN': '分支名' },
|
|
35
|
+
RUN_OPTION_TASKS: { en: 'Task list (can be specified multiple times)', 'zh-CN': '任务列表(可多次指定),不传则在 worktree 中打开 Claude Code 交互式界面' },
|
|
36
|
+
RUN_OPTION_CONCURRENCY: { en: 'Max concurrency, 0 means unlimited', 'zh-CN': '最大并发数,0 表示不限制' },
|
|
37
|
+
RUN_OPTION_FILE: { en: 'Read task list from file (mutually exclusive with --tasks)', 'zh-CN': '从任务文件读取任务列表(与 --tasks 互斥)' },
|
|
38
|
+
RUN_OPTION_DRY_RUN: { en: 'Preview mode, show task plan without executing', 'zh-CN': '预览模式,仅展示任务计划不实际执行' },
|
|
39
|
+
RUN_OPTION_POST_CREATE: { en: 'Run postCreate hook (default on, --no-post-create to skip)', 'zh-CN': '执行 postCreate hook(默认开启,--no-post-create 跳过)' },
|
|
40
|
+
// validate 命令
|
|
41
|
+
VALIDATE_DESC: { en: 'Validate a worktree branch changes in the main worktree', 'zh-CN': '在主 worktree 验证某个 worktree 分支的变更(通过验证分支)' },
|
|
42
|
+
VALIDATE_OPTION_BRANCH: { en: 'Branch name to validate (supports fuzzy match)', 'zh-CN': '要验证的分支名(支持模糊匹配,不传则列出所有分支)' },
|
|
43
|
+
VALIDATE_OPTION_CLEAN: { en: 'Clean up validate state (reset main worktree and delete snapshots)', 'zh-CN': '清理 validate 状态(重置主 worktree 并删除快照)' },
|
|
44
|
+
VALIDATE_OPTION_RUN: { en: 'Command to run in main worktree after successful validation', 'zh-CN': 'validate 成功后在主 worktree 中执行的命令' },
|
|
45
|
+
// merge 命令
|
|
46
|
+
MERGE_DESC: { en: 'Merge a validated worktree branch into the main worktree', 'zh-CN': '合并某个已验证的 worktree 分支到主 worktree' },
|
|
47
|
+
MERGE_OPTION_BRANCH: { en: 'Branch to merge (supports fuzzy match)', 'zh-CN': '要合并的分支名(支持模糊匹配,不传则列出所有分支供选择)' },
|
|
48
|
+
MERGE_OPTION_MESSAGE: { en: 'Commit message (required if target worktree has modifications)', 'zh-CN': '提交信息(目标 worktree 工作区有修改时必填)' },
|
|
49
|
+
MERGE_OPTION_AUTO: { en: 'Auto-resolve conflicts with AI without asking', 'zh-CN': '遇到冲突直接调用 AI 解决,不再询问' },
|
|
50
|
+
// remove 命令
|
|
51
|
+
REMOVE_DESC: { en: 'Remove worktree (supports fuzzy match/multi-select/all)', 'zh-CN': '移除 worktree(支持模糊匹配/多选/全部)' },
|
|
52
|
+
REMOVE_OPTION_ALL: { en: 'Remove all worktrees for the current project', 'zh-CN': '移除当前项目下所有 worktree' },
|
|
53
|
+
REMOVE_OPTION_BRANCH: { en: 'Branch name (supports fuzzy match)', 'zh-CN': '指定分支名(支持模糊匹配,不传则列出所有分支)' },
|
|
54
|
+
// resume 命令
|
|
55
|
+
RESUME_DESC: { en: 'Resume a Claude Code session in an existing worktree', 'zh-CN': '在已有 worktree 中恢复 Claude Code 会话(支持多选批量恢复)' },
|
|
56
|
+
RESUME_OPTION_BRANCH: { en: 'Branch to resume (supports fuzzy match)', 'zh-CN': '要恢复的分支名(支持模糊匹配,不传则列出所有分支)' },
|
|
57
|
+
RESUME_OPTION_PROMPT: { en: 'Non-interactive follow-up (requires -b)', 'zh-CN': '非交互式追问(需配合 -b 指定分支)' },
|
|
58
|
+
RESUME_OPTION_FILE: { en: 'Batch follow-up from task file (matches by branch name)', 'zh-CN': '从任务文件批量追问(通过 branch 名匹配已有 worktree)' },
|
|
59
|
+
RESUME_OPTION_CONCURRENCY: { en: 'Max concurrency for batch follow-up, 0 means unlimited', 'zh-CN': '批量追问最大并发数,0 表示不限制' },
|
|
60
|
+
// sync 命令
|
|
61
|
+
SYNC_DESC: { en: 'Sync main branch code to target worktree', 'zh-CN': '将主分支最新代码同步到目标 worktree' },
|
|
62
|
+
SYNC_OPTION_BRANCH: { en: 'Branch to sync (supports fuzzy match)', 'zh-CN': '要同步的分支名(支持模糊匹配,不传则列出所有分支)' },
|
|
63
|
+
// status 命令
|
|
64
|
+
STATUS_DESC: { en: 'Show project status overview (supports --json)', 'zh-CN': '显示项目全局状态总览(支持 --json 格式输出)' },
|
|
65
|
+
STATUS_OPTION_JSON: { en: 'Output in JSON format', 'zh-CN': '以 JSON 格式输出' },
|
|
66
|
+
STATUS_OPTION_INTERACTIVE: { en: 'Interactive panel mode', 'zh-CN': '交互式面板模式' },
|
|
67
|
+
// list 命令
|
|
68
|
+
LIST_DESC: { en: 'List all worktrees (supports --json)', 'zh-CN': '列出当前项目所有 worktree(支持 --json 格式输出)' },
|
|
69
|
+
LIST_OPTION_JSON: { en: 'Output in JSON format', 'zh-CN': '以 JSON 格式输出' },
|
|
70
|
+
// reset 命令
|
|
71
|
+
RESET_DESC: { en: 'Reset main worktree working directory and staging area', 'zh-CN': '重置主 worktree 工作区和暂存区(保留 validate 快照)' },
|
|
72
|
+
// home 命令
|
|
73
|
+
HOME_DESC: { en: 'Switch back to the main work branch', 'zh-CN': '切换回主工作分支' },
|
|
74
|
+
// projects 命令
|
|
75
|
+
PROJECTS_DESC: { en: 'Show worktree overview across projects', 'zh-CN': '展示所有项目的 worktree 概览,或查看指定项目的 worktree 详情' },
|
|
76
|
+
PROJECTS_OPTION_JSON: { en: 'Output in JSON format', 'zh-CN': '以 JSON 格式输出' },
|
|
77
|
+
// alias 命令
|
|
78
|
+
ALIAS_DESC: { en: 'Manage command aliases (list / set / remove)', 'zh-CN': '管理命令别名(列出 / 设置 / 移除)' },
|
|
79
|
+
ALIAS_LIST_DESC: { en: 'List all aliases', 'zh-CN': '列出所有别名' },
|
|
80
|
+
ALIAS_SET_DESC: { en: 'Set a command alias', 'zh-CN': '设置命令别名' },
|
|
81
|
+
ALIAS_REMOVE_DESC: { en: 'Remove a command alias', 'zh-CN': '移除命令别名' },
|
|
82
|
+
// completion 命令
|
|
83
|
+
COMPLETION_DESC: { en: 'Internal dynamic completion method (not public)', 'zh-CN': '内部使用的动态补全方法,不对外公开' },
|
|
84
|
+
// tasks 命令
|
|
85
|
+
TASKS_DESC: { en: 'Task file management', 'zh-CN': '任务文件管理' },
|
|
86
|
+
TASKS_INIT_DESC: { en: 'Generate task template file', 'zh-CN': '生成任务模板文件' },
|
|
87
|
+
// cover 命令
|
|
88
|
+
COVER_DESC: { en: 'Cover validate branch changes back to target worktree', 'zh-CN': '将验证分支上的修改覆盖回目标 worktree(自动推导目标分支)' },
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
export const CLI_DESCRIPTIONS = createMessages(CLI_DESCRIPTIONS_I18N);
|