ccg-workflow 1.7.10 → 1.7.11
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
CHANGED
|
@@ -307,7 +307,9 @@ Windows:
|
|
|
307
307
|
<details>
|
|
308
308
|
<summary><strong>Q6: 如何卸载?</strong></summary>
|
|
309
309
|
|
|
310
|
-
|
|
310
|
+
**⚠️ 重要:根据安装方式选择卸载方法**
|
|
311
|
+
|
|
312
|
+
#### 方式 1:npx 安装用户(推荐)
|
|
311
313
|
|
|
312
314
|
```bash
|
|
313
315
|
npx ccg-workflow
|
|
@@ -321,26 +323,44 @@ npx ccg-workflow
|
|
|
321
323
|
- `~/.claude/bin/codeagent-wrapper*` - 二进制文件
|
|
322
324
|
- `~/.claude/.ccg/` - 配置目录(可选保留)
|
|
323
325
|
|
|
324
|
-
|
|
326
|
+
#### 方式 2:npm 全局安装用户
|
|
327
|
+
|
|
328
|
+
**如果你曾经运行过 `npm install -g ccg-workflow`,需要两步卸载:**
|
|
325
329
|
|
|
326
330
|
```bash
|
|
327
|
-
#
|
|
331
|
+
# 第 1 步:卸载工作流文件
|
|
332
|
+
npx ccg-workflow
|
|
333
|
+
# 选择 "卸载工作流"
|
|
334
|
+
|
|
335
|
+
# 第 2 步:卸载 npm 全局包(必须执行,否则 ccg 命令仍可用)
|
|
336
|
+
npm uninstall -g ccg-workflow
|
|
337
|
+
```
|
|
338
|
+
|
|
339
|
+
**v1.7.11 新增**:系统会自动检测全局安装并提示第 2 步操作。
|
|
340
|
+
|
|
341
|
+
#### 方式 3:手动清理
|
|
342
|
+
|
|
343
|
+
```bash
|
|
344
|
+
# 删除所有工作流文件
|
|
328
345
|
rm -rf ~/.claude/commands/ccg
|
|
329
346
|
rm -rf ~/.claude/agents/ccg
|
|
330
347
|
rm -rf ~/.claude/skills/multi-model-collaboration
|
|
331
348
|
rm -rf ~/.claude/bin/codeagent-wrapper*
|
|
332
349
|
rm -rf ~/.claude/.ccg
|
|
333
350
|
|
|
351
|
+
# 如果是全局安装,还需执行
|
|
352
|
+
npm uninstall -g ccg-workflow
|
|
353
|
+
|
|
334
354
|
# 清理 MCP 配置(如果安装了 ace-tool)
|
|
335
355
|
# 手动编辑 ~/.claude.json 删除 ace-tool 相关配置
|
|
336
356
|
```
|
|
337
357
|
|
|
338
358
|
**⚠️ 注意:npx 缓存问题**
|
|
339
359
|
|
|
340
|
-
|
|
360
|
+
如果卸载后重新安装仍使用旧版本,清理 npx 缓存:
|
|
341
361
|
|
|
342
362
|
```bash
|
|
343
|
-
# 清理 npx
|
|
363
|
+
# 清理 npx 缓存
|
|
344
364
|
npx clear-npx-cache
|
|
345
365
|
# 或
|
|
346
366
|
rm -rf ~/.npm/_npx
|
package/dist/cli.mjs
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import cac from 'cac';
|
|
3
3
|
import ansis from 'ansis';
|
|
4
|
-
import { y as diagnoseMcpConfig, z as isWindows, A as readClaudeCodeConfig, B as fixWindowsMcpConfig, C as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, D as configMcp, E as version, a as i18n } from './shared/ccg-workflow.
|
|
4
|
+
import { y as diagnoseMcpConfig, z as isWindows, A as readClaudeCodeConfig, B as fixWindowsMcpConfig, C as writeClaudeCodeConfig, r as readCcgConfig, b as initI18n, s as showMainMenu, i as init, D as configMcp, E as version, a as i18n } from './shared/ccg-workflow.DR-W9Rb6.mjs';
|
|
5
5
|
import 'inquirer';
|
|
6
|
+
import 'node:child_process';
|
|
7
|
+
import 'node:util';
|
|
6
8
|
import 'node:os';
|
|
7
9
|
import 'pathe';
|
|
8
10
|
import 'fs-extra';
|
|
@@ -10,8 +12,6 @@ import 'node:url';
|
|
|
10
12
|
import 'i18next';
|
|
11
13
|
import 'ora';
|
|
12
14
|
import 'smol-toml';
|
|
13
|
-
import 'node:child_process';
|
|
14
|
-
import 'node:util';
|
|
15
15
|
|
|
16
16
|
async function diagnoseMcp() {
|
|
17
17
|
console.log();
|
package/dist/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
export { c as changeLanguage, v as checkForUpdates, x as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, q as getCurrentVersion, t as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, k as installWorkflows, o as migrateToV1_4_0, p as needsMigration, r as readCcgConfig, s as showMainMenu, n as uninstallAceTool, m as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.
|
|
1
|
+
export { c as changeLanguage, v as checkForUpdates, x as compareVersions, d as createDefaultConfig, e as createDefaultRouting, g as getCcgDir, f as getConfigPath, q as getCurrentVersion, t as getLatestVersion, j as getWorkflowById, h as getWorkflowConfigs, a as i18n, i as init, b as initI18n, l as installAceTool, k as installWorkflows, o as migrateToV1_4_0, p as needsMigration, r as readCcgConfig, s as showMainMenu, n as uninstallAceTool, m as uninstallWorkflows, u as update, w as writeCcgConfig } from './shared/ccg-workflow.DR-W9Rb6.mjs';
|
|
2
2
|
import 'ansis';
|
|
3
3
|
import 'inquirer';
|
|
4
|
+
import 'node:child_process';
|
|
5
|
+
import 'node:util';
|
|
4
6
|
import 'node:os';
|
|
5
7
|
import 'pathe';
|
|
6
8
|
import 'fs-extra';
|
|
@@ -8,5 +10,3 @@ import 'node:url';
|
|
|
8
10
|
import 'i18next';
|
|
9
11
|
import 'ora';
|
|
10
12
|
import 'smol-toml';
|
|
11
|
-
import 'node:child_process';
|
|
12
|
-
import 'node:util';
|
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import ansis from 'ansis';
|
|
2
2
|
import inquirer from 'inquirer';
|
|
3
|
+
import { exec } from 'node:child_process';
|
|
4
|
+
import { promisify } from 'node:util';
|
|
3
5
|
import { homedir } from 'node:os';
|
|
4
6
|
import { join, dirname } from 'pathe';
|
|
5
7
|
import fs from 'fs-extra';
|
|
@@ -7,10 +9,8 @@ import { fileURLToPath } from 'node:url';
|
|
|
7
9
|
import i18next from 'i18next';
|
|
8
10
|
import ora from 'ora';
|
|
9
11
|
import { parse, stringify } from 'smol-toml';
|
|
10
|
-
import { exec } from 'node:child_process';
|
|
11
|
-
import { promisify } from 'node:util';
|
|
12
12
|
|
|
13
|
-
const version = "1.7.
|
|
13
|
+
const version = "1.7.11";
|
|
14
14
|
|
|
15
15
|
function isWindows() {
|
|
16
16
|
return process.platform === "win32";
|
|
@@ -1605,7 +1605,7 @@ ${exportCommand}
|
|
|
1605
1605
|
}
|
|
1606
1606
|
}
|
|
1607
1607
|
|
|
1608
|
-
const execAsync$
|
|
1608
|
+
const execAsync$2 = promisify(exec);
|
|
1609
1609
|
const __filename$1 = fileURLToPath(import.meta.url);
|
|
1610
1610
|
const __dirname$1 = dirname(__filename$1);
|
|
1611
1611
|
function findPackageRoot(startDir) {
|
|
@@ -1630,7 +1630,7 @@ async function getCurrentVersion() {
|
|
|
1630
1630
|
}
|
|
1631
1631
|
async function getLatestVersion(packageName = "ccg-workflow") {
|
|
1632
1632
|
try {
|
|
1633
|
-
const { stdout } = await execAsync$
|
|
1633
|
+
const { stdout } = await execAsync$2(`npm view ${packageName} version`);
|
|
1634
1634
|
return stdout.trim();
|
|
1635
1635
|
} catch {
|
|
1636
1636
|
return null;
|
|
@@ -1667,7 +1667,7 @@ async function checkForUpdates() {
|
|
|
1667
1667
|
};
|
|
1668
1668
|
}
|
|
1669
1669
|
|
|
1670
|
-
const execAsync = promisify(exec);
|
|
1670
|
+
const execAsync$1 = promisify(exec);
|
|
1671
1671
|
async function update() {
|
|
1672
1672
|
console.log();
|
|
1673
1673
|
console.log(ansis.cyan.bold("\u{1F504} \u68C0\u67E5\u66F4\u65B0..."));
|
|
@@ -1700,16 +1700,55 @@ async function update() {
|
|
|
1700
1700
|
console.log(ansis.red(`\u274C \u66F4\u65B0\u5931\u8D25: ${error}`));
|
|
1701
1701
|
}
|
|
1702
1702
|
}
|
|
1703
|
+
async function checkIfGlobalInstall$1() {
|
|
1704
|
+
try {
|
|
1705
|
+
const { stdout } = await execAsync$1("npm list -g ccg-workflow --depth=0", { timeout: 5e3 });
|
|
1706
|
+
return stdout.includes("ccg-workflow@");
|
|
1707
|
+
} catch {
|
|
1708
|
+
return false;
|
|
1709
|
+
}
|
|
1710
|
+
}
|
|
1703
1711
|
async function performUpdate(fromVersion, toVersion, isNewVersion) {
|
|
1704
1712
|
console.log();
|
|
1705
1713
|
console.log(ansis.yellow.bold("\u2699\uFE0F \u5F00\u59CB\u66F4\u65B0..."));
|
|
1706
1714
|
console.log();
|
|
1715
|
+
const isGlobalInstall = await checkIfGlobalInstall$1();
|
|
1716
|
+
if (isGlobalInstall) {
|
|
1717
|
+
console.log(ansis.yellow("\u26A0\uFE0F \u68C0\u6D4B\u5230\u4F60\u662F\u901A\u8FC7 npm \u5168\u5C40\u5B89\u88C5\u7684"));
|
|
1718
|
+
console.log();
|
|
1719
|
+
console.log("\u63A8\u8350\u7684\u66F4\u65B0\u65B9\u5F0F\uFF1A");
|
|
1720
|
+
console.log();
|
|
1721
|
+
console.log(ansis.cyan(" npm install -g ccg-workflow@latest"));
|
|
1722
|
+
console.log();
|
|
1723
|
+
console.log(ansis.gray("\u8FD9\u5C06\u540C\u65F6\u66F4\u65B0\u547D\u4EE4\u548C\u5DE5\u4F5C\u6D41\u6587\u4EF6"));
|
|
1724
|
+
console.log();
|
|
1725
|
+
const { useNpmUpdate } = await inquirer.prompt([{
|
|
1726
|
+
type: "confirm",
|
|
1727
|
+
name: "useNpmUpdate",
|
|
1728
|
+
message: "\u6539\u7528 npm \u66F4\u65B0\uFF08\u63A8\u8350\uFF09\uFF1F",
|
|
1729
|
+
default: true
|
|
1730
|
+
}]);
|
|
1731
|
+
if (useNpmUpdate) {
|
|
1732
|
+
console.log();
|
|
1733
|
+
console.log(ansis.cyan("\u8BF7\u5728\u65B0\u7684\u7EC8\u7AEF\u7A97\u53E3\u4E2D\u8FD0\u884C\uFF1A"));
|
|
1734
|
+
console.log();
|
|
1735
|
+
console.log(ansis.cyan.bold(" npm install -g ccg-workflow@latest"));
|
|
1736
|
+
console.log();
|
|
1737
|
+
console.log(ansis.gray("(\u8FD0\u884C\u5B8C\u6210\u540E\uFF0C\u5F53\u524D\u7248\u672C\u5C06\u81EA\u52A8\u66F4\u65B0)"));
|
|
1738
|
+
console.log();
|
|
1739
|
+
return;
|
|
1740
|
+
}
|
|
1741
|
+
console.log();
|
|
1742
|
+
console.log(ansis.yellow("\u26A0\uFE0F \u7EE7\u7EED\u4F7F\u7528\u5185\u7F6E\u66F4\u65B0\uFF08\u4EC5\u66F4\u65B0\u5DE5\u4F5C\u6D41\u6587\u4EF6\uFF09"));
|
|
1743
|
+
console.log(ansis.gray("\u6CE8\u610F\uFF1A\u8FD9\u4E0D\u4F1A\u66F4\u65B0 ccg \u547D\u4EE4\u672C\u8EAB"));
|
|
1744
|
+
console.log();
|
|
1745
|
+
}
|
|
1707
1746
|
let spinner = ora("\u6B63\u5728\u4E0B\u8F7D\u6700\u65B0\u7248\u672C...").start();
|
|
1708
1747
|
try {
|
|
1709
1748
|
if (process.platform === "win32") {
|
|
1710
1749
|
spinner.text = "\u6B63\u5728\u6E05\u7406 npx \u7F13\u5B58...";
|
|
1711
1750
|
try {
|
|
1712
|
-
await execAsync("npx clear-npx-cache", { timeout: 1e4 });
|
|
1751
|
+
await execAsync$1("npx clear-npx-cache", { timeout: 1e4 });
|
|
1713
1752
|
} catch {
|
|
1714
1753
|
const npxCachePath = join(homedir(), ".npm", "_npx");
|
|
1715
1754
|
try {
|
|
@@ -1720,7 +1759,7 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
|
|
|
1720
1759
|
}
|
|
1721
1760
|
}
|
|
1722
1761
|
spinner.text = "\u6B63\u5728\u4E0B\u8F7D\u6700\u65B0\u7248\u672C...";
|
|
1723
|
-
await execAsync(`npx --yes ccg-workflow@latest --version`, { timeout: 6e4 });
|
|
1762
|
+
await execAsync$1(`npx --yes ccg-workflow@latest --version`, { timeout: 6e4 });
|
|
1724
1763
|
spinner.succeed("\u6700\u65B0\u7248\u672C\u4E0B\u8F7D\u5B8C\u6210");
|
|
1725
1764
|
} catch (error) {
|
|
1726
1765
|
spinner.fail("\u4E0B\u8F7D\u6700\u65B0\u7248\u672C\u5931\u8D25");
|
|
@@ -1802,6 +1841,7 @@ async function performUpdate(fromVersion, toVersion, isNewVersion) {
|
|
|
1802
1841
|
console.log();
|
|
1803
1842
|
}
|
|
1804
1843
|
|
|
1844
|
+
const execAsync = promisify(exec);
|
|
1805
1845
|
async function showMainMenu() {
|
|
1806
1846
|
console.log();
|
|
1807
1847
|
console.log(ansis.cyan.bold(` CCG - Claude + Codex + Gemini`));
|
|
@@ -1857,12 +1897,29 @@ function showHelp() {
|
|
|
1857
1897
|
console.log(ansis.gray(i18n.t("menu:help.hint")));
|
|
1858
1898
|
console.log();
|
|
1859
1899
|
}
|
|
1900
|
+
async function checkIfGlobalInstall() {
|
|
1901
|
+
try {
|
|
1902
|
+
const { stdout } = await execAsync("npm list -g ccg-workflow --depth=0", { timeout: 5e3 });
|
|
1903
|
+
return stdout.includes("ccg-workflow@");
|
|
1904
|
+
} catch {
|
|
1905
|
+
return false;
|
|
1906
|
+
}
|
|
1907
|
+
}
|
|
1860
1908
|
async function uninstall() {
|
|
1861
1909
|
console.log();
|
|
1910
|
+
const isGlobalInstall = await checkIfGlobalInstall();
|
|
1911
|
+
if (isGlobalInstall) {
|
|
1912
|
+
console.log(ansis.yellow("\u26A0\uFE0F \u68C0\u6D4B\u5230\u4F60\u662F\u901A\u8FC7 npm \u5168\u5C40\u5B89\u88C5\u7684"));
|
|
1913
|
+
console.log();
|
|
1914
|
+
console.log("\u5B8C\u6574\u5378\u8F7D\u9700\u8981\u4E24\u6B65\uFF1A");
|
|
1915
|
+
console.log(` ${ansis.cyan("1. \u79FB\u9664\u5DE5\u4F5C\u6D41\u6587\u4EF6")} (\u5373\u5C06\u6267\u884C)`);
|
|
1916
|
+
console.log(` ${ansis.cyan("2. \u5378\u8F7D npm \u5168\u5C40\u5305")} (\u9700\u8981\u624B\u52A8\u6267\u884C)`);
|
|
1917
|
+
console.log();
|
|
1918
|
+
}
|
|
1862
1919
|
const { confirm } = await inquirer.prompt([{
|
|
1863
1920
|
type: "confirm",
|
|
1864
1921
|
name: "confirm",
|
|
1865
|
-
message: i18n.t("menu:uninstall.confirm"),
|
|
1922
|
+
message: isGlobalInstall ? "\u7EE7\u7EED\u5378\u8F7D\u5DE5\u4F5C\u6D41\u6587\u4EF6\uFF1F" : i18n.t("menu:uninstall.confirm"),
|
|
1866
1923
|
default: false
|
|
1867
1924
|
}]);
|
|
1868
1925
|
if (!confirm) {
|
|
@@ -1880,7 +1937,7 @@ async function uninstall() {
|
|
|
1880
1937
|
const installDir = join(homedir(), ".claude");
|
|
1881
1938
|
const result = await uninstallWorkflows(installDir);
|
|
1882
1939
|
if (result.success) {
|
|
1883
|
-
console.log(ansis.green(
|
|
1940
|
+
console.log(ansis.green("\u2705 \u5DE5\u4F5C\u6D41\u6587\u4EF6\u5DF2\u79FB\u9664"));
|
|
1884
1941
|
if (result.removedCommands.length > 0) {
|
|
1885
1942
|
console.log();
|
|
1886
1943
|
console.log(ansis.cyan(i18n.t("menu:uninstall.removedCommands")));
|
|
@@ -1905,6 +1962,16 @@ async function uninstall() {
|
|
|
1905
1962
|
console.log(ansis.cyan("\u5DF2\u79FB\u9664\u4E8C\u8FDB\u5236\u6587\u4EF6:"));
|
|
1906
1963
|
console.log(` ${ansis.gray("\u2022")} codeagent-wrapper`);
|
|
1907
1964
|
}
|
|
1965
|
+
if (isGlobalInstall) {
|
|
1966
|
+
console.log();
|
|
1967
|
+
console.log(ansis.yellow.bold("\u{1F538} \u6700\u540E\u4E00\u6B65\uFF1A\u5378\u8F7D npm \u5168\u5C40\u5305"));
|
|
1968
|
+
console.log();
|
|
1969
|
+
console.log("\u8BF7\u5728\u65B0\u7684\u7EC8\u7AEF\u7A97\u53E3\u4E2D\u8FD0\u884C\uFF1A");
|
|
1970
|
+
console.log();
|
|
1971
|
+
console.log(ansis.cyan.bold(" npm uninstall -g ccg-workflow"));
|
|
1972
|
+
console.log();
|
|
1973
|
+
console.log(ansis.gray("(\u5B8C\u6210\u540E ccg \u547D\u4EE4\u5C06\u5F7B\u5E95\u79FB\u9664)"));
|
|
1974
|
+
}
|
|
1908
1975
|
} else {
|
|
1909
1976
|
console.log(ansis.red(i18n.t("menu:uninstall.failed")));
|
|
1910
1977
|
for (const error of result.errors) {
|