zcf 2.12.11 → 2.12.12

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
@@ -8,7 +8,7 @@
8
8
  [![JSDocs][jsdocs-src]][jsdocs-href]
9
9
  [![Ask DeepWiki][deepwiki-src]][deepwiki-href]
10
10
 
11
- [中文](README_zh-CN.md) | **English** | [Changelog](CHANGELOG.md)
11
+ [中文](README_zh-CN.md) | **English** | [日本語](README_ja-JP.md) | [Changelog](CHANGELOG.md)
12
12
 
13
13
  > Zero-config, one-click setup for Claude Code with bilingual support, intelligent agent system and personalized AI assistant
14
14
 
@@ -288,7 +288,7 @@ After configuration:
288
288
 
289
289
  - Auto-detects Claude Code installation status
290
290
  - Uses npm for automatic installation (ensures compatibility)
291
- - Cross-platform support (Windows/macOS/Linux/Termux)
291
+ - Cross-platform support (Windows/macOS/Linux/WSL/Termux)
292
292
  - Automatic MCP service configuration
293
293
  - Smart configuration merging and partial modification support (v2.0 new)
294
294
  - Enhanced command detection mechanism (v2.1 new)
@@ -647,6 +647,17 @@ ZCF fully supports Windows platform:
647
647
 
648
648
  If you encounter MCP connection issues on Windows, running `npx zcf` will automatically fix the configuration format.
649
649
 
650
+ #### WSL Support (v2.12.12+ new)
651
+
652
+ ZCF now provides comprehensive support for Windows Subsystem for Linux (WSL):
653
+
654
+ - **Smart Detection**: Multi-layered WSL environment detection using environment variables, system files, and mount points
655
+ - **Distribution Recognition**: Automatically identifies WSL distribution (Ubuntu, Debian, etc.) for optimized configuration
656
+ - **Seamless Installation**: Native Linux-style installation experience within WSL environment
657
+ - **Path Management**: Intelligent handling of WSL-specific configuration paths and file locations
658
+
659
+ If running in WSL, ZCF will automatically detect the environment and display appropriate installation messages.
660
+
650
661
  #### Termux Support (v2.1 new)
651
662
 
652
663
  ZCF now supports running in Android Termux environment:
@@ -15,7 +15,7 @@ import { rm, mkdir, copyFile as copyFile$1 } from 'node:fs/promises';
15
15
  import i18next from 'i18next';
16
16
  import Backend from 'i18next-fs-backend';
17
17
 
18
- const version = "2.12.11";
18
+ const version = "2.12.12";
19
19
  const homepage = "https://github.com/UfoMiao/zcf";
20
20
 
21
21
  const i18n = i18next.createInstance();
@@ -717,6 +717,57 @@ function getTermuxPrefix() {
717
717
  function isWindows() {
718
718
  return getPlatform() === "windows";
719
719
  }
720
+ function isWSL() {
721
+ if (process.env.WSL_DISTRO_NAME) {
722
+ return true;
723
+ }
724
+ if (existsSync("/proc/version")) {
725
+ try {
726
+ const version = readFileSync("/proc/version", "utf8");
727
+ if (version.includes("Microsoft") || version.includes("WSL")) {
728
+ return true;
729
+ }
730
+ } catch {
731
+ }
732
+ }
733
+ if (existsSync("/mnt/c")) {
734
+ return true;
735
+ }
736
+ return false;
737
+ }
738
+ function getWSLDistro() {
739
+ if (process.env.WSL_DISTRO_NAME) {
740
+ return process.env.WSL_DISTRO_NAME;
741
+ }
742
+ if (existsSync("/etc/os-release")) {
743
+ try {
744
+ const osRelease = readFileSync("/etc/os-release", "utf8");
745
+ const nameMatch = osRelease.match(/^PRETTY_NAME="(.+)"$/m);
746
+ if (nameMatch) {
747
+ return nameMatch[1];
748
+ }
749
+ } catch {
750
+ }
751
+ }
752
+ return null;
753
+ }
754
+ function getWSLInfo() {
755
+ if (!isWSL()) {
756
+ return null;
757
+ }
758
+ let version = null;
759
+ if (existsSync("/proc/version")) {
760
+ try {
761
+ version = readFileSync("/proc/version", "utf8").trim();
762
+ } catch {
763
+ }
764
+ }
765
+ return {
766
+ isWSL: true,
767
+ distro: getWSLDistro(),
768
+ version
769
+ };
770
+ }
720
771
  function getMcpCommand() {
721
772
  if (isWindows()) {
722
773
  return ["cmd", "/c", "npx"];
@@ -2513,6 +2564,15 @@ async function installClaudeCode() {
2513
2564
  console.log(ansis.gray(`Node.js: ${termuxPrefix}/bin/node`));
2514
2565
  console.log(ansis.gray(`npm: ${termuxPrefix}/bin/npm`));
2515
2566
  }
2567
+ if (isWSL()) {
2568
+ const wslInfo = getWSLInfo();
2569
+ if (wslInfo?.distro) {
2570
+ console.log(ansis.yellow(`\u2139 ${i18n.t("installation:wslDetected", { distro: wslInfo.distro })}`));
2571
+ } else {
2572
+ console.log(ansis.yellow(`\u2139 ${i18n.t("installation:wslDetectedGeneric")}`));
2573
+ }
2574
+ console.log(ansis.gray(i18n.t("installation:wslPathInfo", { path: `${homedir()}/.claude/` })));
2575
+ }
2516
2576
  console.log(i18n.t("installation:installing"));
2517
2577
  try {
2518
2578
  await exec("npm", ["install", "-g", "@anthropic-ai/claude-code"]);
@@ -2521,6 +2581,10 @@ async function installClaudeCode() {
2521
2581
  console.log(ansis.gray(`
2522
2582
  Claude Code installed to: ${getTermuxPrefix()}/bin/claude`));
2523
2583
  }
2584
+ if (isWSL()) {
2585
+ console.log(ansis.gray(`
2586
+ ${i18n.t("installation:wslInstallSuccess")}`));
2587
+ }
2524
2588
  } catch (error) {
2525
2589
  console.error(`\u2716 ${i18n.t("installation:installFailed")}`);
2526
2590
  if (isTermux()) {
@@ -24,5 +24,9 @@
24
24
  "onlyLocalInstallationDetected": "Only local installation detected",
25
25
  "notInstalled": "not installed",
26
26
  "installingGlobalClaudeCode": "Installing global Claude Code",
27
- "globalInstallationCompleted": "Global installation completed"
27
+ "globalInstallationCompleted": "Global installation completed",
28
+ "wslDetected": "WSL environment detected ({distro})",
29
+ "wslDetectedGeneric": "WSL environment detected",
30
+ "wslPathInfo": "Configuration path: {path}",
31
+ "wslInstallSuccess": "Claude Code successfully installed in WSL environment"
28
32
  }
@@ -24,5 +24,9 @@
24
24
  "onlyLocalInstallationDetected": "检测到仅有本地安装",
25
25
  "notInstalled": "未安装",
26
26
  "installingGlobalClaudeCode": "正在安装全局 Claude Code",
27
- "globalInstallationCompleted": "全局安装完成"
27
+ "globalInstallationCompleted": "全局安装完成",
28
+ "wslDetected": "检测到 WSL 环境 ({distro})",
29
+ "wslDetectedGeneric": "检测到 WSL 环境",
30
+ "wslPathInfo": "配置文件位置:{path}",
31
+ "wslInstallSuccess": "Claude Code 已成功安装在 WSL 环境中"
28
32
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "zcf",
3
3
  "type": "module",
4
- "version": "2.12.11",
4
+ "version": "2.12.12",
5
5
  "description": "Zero-Config Claude-Code Flow - One-click configuration tool for Claude Code",
6
6
  "author": {
7
7
  "name": "Miao Da",