@zrhsh/wukong-cli 0.3.0 → 0.4.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 CHANGED
@@ -1,104 +1,104 @@
1
1
  # Wukong CLI
2
2
 
3
- TypeScript CLI tool for Oceanet/NRP system with OAuth Device PKCE Flow authentication and automatic token refresh.
3
+ 用于 Oceanet/NRP 系统的 TypeScript CLI 工具,支持 OAuth Device PKCE Flow 认证和自动 token 刷新。
4
4
 
5
- ## Features
5
+ ## 功能特性
6
6
 
7
- - 🔐 **Secure Authentication** - OAuth Device PKCE Flow without password input
8
- - 🔄 **Auto Token Refresh** - Automatic token refresh before expiration
9
- - 🌍 **Multi-Environment** - Support for dev, beta, uat, and prod environments
10
- - 🐛 **Debug Mode** - Show HTTP requests and responses with `--debug` flag
11
- - 💾 **Secure Storage** - Platform native credential managers with file fallback
12
- - 🛠️ **HTTP Client** - Built-in HTTP client with automatic authentication
13
- - ⚙️ **Smart Configuration** - Built-in defaults with fallback to user configuration
14
- - 🔍 **Structured Errors** - Clear error messages with actionable fix suggestions
7
+ - 🔐 **安全认证** - OAuth Device PKCE Flow,无需输入密码
8
+ - 🔄 **自动刷新** - Token 过期前自动刷新
9
+ - 🌍 **多环境支持** - 支持 devbetauat prod 环境
10
+ - 🐛 **调试模式** - 使用 `--debug` 标志显示 HTTP 请求和响应
11
+ - 💾 **安全存储** - 使用平台原生凭据管理器,支持文件回退
12
+ - 🛠️ **HTTP 客户端** - 内置 HTTP 客户端,自动处理认证
13
+ - ⚙️ **智能配置** - 内置默认配置,支持用户自定义
14
+ - 🔍 **结构化错误** - 清晰的错误消息和可操作的修复建议
15
15
 
16
- ## Quick Start
16
+ ## 快速开始
17
17
 
18
18
  ```bash
19
- # Install
19
+ # 安装
20
20
  npm install -g @zrhsh/wukong-cli
21
21
 
22
- # Initialize configuration
22
+ # 初始化配置
23
23
  wukong-cli init
24
24
 
25
- # Login
25
+ # 登录
26
26
  wukong-cli auth login
27
27
 
28
- # Check status
28
+ # 查看状态
29
29
  wukong-cli auth status
30
30
 
31
- # Make API request
31
+ # 发送 API 请求
32
32
  wukong-cli http get "/oceanet-auth/web/userInfo"
33
33
  ```
34
34
 
35
- ## Development
35
+ ## 开发
36
36
 
37
37
  ```bash
38
- # Clone repository
38
+ # 克隆仓库
39
39
  git clone <repository-url>
40
40
  cd wukong-ts-cli
41
41
 
42
- # Install dependencies (自动构建项目)
42
+ # 安装依赖(自动构建项目)
43
43
  npm install
44
44
 
45
- # Development mode (直接运行 TypeScript)
45
+ # 开发模式(直接运行 TypeScript
46
46
  npm run dev <args>
47
47
 
48
- # Build for production
48
+ # 生产环境构建
49
49
  npm run build
50
50
 
51
- # Link globally for testing
51
+ # 全局链接用于测试
52
52
  npm run link
53
53
 
54
- # Run tests
54
+ # 运行测试
55
55
  npm test
56
56
 
57
- # Verify before publishing
57
+ # 发布前验证
58
58
  npm run verify
59
59
  ```
60
60
 
61
61
  **注意**:项目配置了自动构建脚本(`prepare` 和 `prepack`),在 `npm install` 和 `npm publish` 时会自动构建。如果遇到 `MODULE_NOT_FOUND` 错误,请运行 `npm run build` 手动构建。
62
62
 
63
- ## Deprecation Notices
63
+ ## 弃用通知
64
64
 
65
- ⚠️ **Device Flow API**: 某些内部 API 已标记为弃用,将在 v1.0.0 中移除。这不会影响终端用户的使用。详见 [弃用文档](./docs/deprecation/)。
65
+ ⚠️ **Device Flow API**:某些内部 API 已标记为弃用,将在 v1.0.0 中移除。这不会影响终端用户的使用。详见 [弃用文档](./docs/deprecation/)。
66
66
 
67
- ## Commands
67
+ ## 命令
68
68
 
69
- ### Configuration Commands
69
+ ### 配置命令
70
70
 
71
71
  ```bash
72
- wukong-cli init # Initialize configuration file
72
+ wukong-cli init # 初始化配置文件
73
73
  ```
74
74
 
75
- ### Authentication Commands
75
+ ### 认证命令
76
76
 
77
77
  ```bash
78
- wukong-cli auth login # OAuth Device PKCE Flow login
79
- wukong-cli auth status # Show authentication status
80
- wukong-cli auth refresh # Refresh access token
81
- wukong-cli auth logout # Logout and clear tokens
78
+ wukong-cli auth login # OAuth Device PKCE Flow 登录
79
+ wukong-cli auth status # 显示认证状态
80
+ wukong-cli auth refresh # 刷新访问令牌
81
+ wukong-cli auth logout # 登出并清除令牌
82
82
  ```
83
83
 
84
- ### HTTP Commands
84
+ ### HTTP 命令
85
85
 
86
86
  ```bash
87
- wukong-cli http get "/endpoint" # GET request
88
- wukong-cli http post "/endpoint" -d '{"key":"value"}' # POST request
89
- wukong-cli http put "/endpoint" -d '{"key":"value"}' # PUT request
90
- wukong-cli http delete "/endpoint" # DELETE request
87
+ wukong-cli http get "/endpoint" # GET 请求
88
+ wukong-cli http post "/endpoint" -d '{"key":"value"}' # POST 请求
89
+ wukong-cli http put "/endpoint" -d '{"key":"value"}' # PUT 请求
90
+ wukong-cli http delete "/endpoint" # DELETE 请求
91
91
  ```
92
92
 
93
- ### Global Options
93
+ ### 全局选项
94
94
 
95
95
  ```bash
96
- --debug # Enable debug mode (show HTTP requests)
97
- -V, --version # Show version number
98
- -h, --help # Show help information
96
+ --debug # 启用调试模式(显示 HTTP 请求)
97
+ -V, --version # 显示版本号
98
+ -h, --help # 显示帮助信息
99
99
  ```
100
100
 
101
- ## Environment Switching
101
+ ## 环境切换
102
102
 
103
103
  ```bash
104
104
  # PowerShell
@@ -114,28 +114,28 @@ set WUKONG_CLI_ENV=beta
114
114
  wukong-cli auth login
115
115
  ```
116
116
 
117
- ## Configuration
117
+ ## 配置
118
118
 
119
- Wukong CLI uses intelligent configuration with built-in defaults:
119
+ Wukong CLI 使用智能配置,内置默认值:
120
120
 
121
- - **No Configuration Required**: CLI works out of the box with built-in environment defaults
122
- - **Custom Configuration**: Optional `wukong-cli.json` for custom endpoints
123
- - **Smart Fallback**: Uses built-in defaults when environments are not configured
124
- - **Clear Errors**: Structured error messages guide you to fix configuration issues
121
+ - **无需配置**:CLI 开箱即用,使用内置的环境默认配置
122
+ - **自定义配置**:可选的 `wukong-cli.json` 用于自定义端点
123
+ - **智能回退**:环境未配置时使用内置默认值
124
+ - **清晰错误**:结构化错误消息指导您修复配置问题
125
125
 
126
- ### Configuration File Location
126
+ ### 配置文件位置
127
127
 
128
128
  ```bash
129
- ~/wukong-cli.json # User home directory
129
+ ~/wukong-cli.json # 用户主目录
130
130
  ```
131
131
 
132
- ### Initialize Configuration
132
+ ### 初始化配置
133
133
 
134
134
  ```bash
135
- wukong-cli init # Creates or resets configuration file
135
+ wukong-cli init # 创建或重置配置文件
136
136
  ```
137
137
 
138
- ### Example Configuration
138
+ ### 配置示例
139
139
 
140
140
  ```json
141
141
  {
@@ -155,9 +155,9 @@ wukong-cli init # Creates or resets configuration file
155
155
  }
156
156
  ```
157
157
 
158
- ### Configuration Errors
158
+ ### 配置错误
159
159
 
160
- If your configuration is incomplete, you'll see structured error messages:
160
+ 如果配置不完整,您会看到结构化错误消息:
161
161
 
162
162
  ```
163
163
  [ERROR] Configuration Error
@@ -169,113 +169,63 @@ Missing fields: apiBaseUrl, clientId
169
169
  Edit your wukong-cli.json or run 'wukong-cli init' to reset
170
170
  ```
171
171
 
172
- ## Documentation
172
+ ## 文档
173
173
 
174
- ### Getting Started
175
- - 📖 [Installation Guide](docs/getting-started/installation.md) - Detailed installation steps
176
- - 📖 [Quick Start](docs/getting-started/quick-start.md) - 5-minute quick start guide
177
- - 📖 [Configuration](docs/getting-started/configuration.md) - Environment configuration
174
+ ### 入门指南
175
+ - 📖 [快速开始](docs/getting-started/quick-start.md) - 5分钟快速上手
176
+ - 📖 [完整安装配置指南](docs/getting-started/complete-guide.md) - 详细安装和配置步骤
178
177
 
179
- ### User Guide
180
- - 📖 [Command Reference](docs/user-guide/commands.md) - Complete command reference
181
- - 📖 [Authentication](docs/user-guide/authentication.md) - OAuth Device PKCE Flow details
182
- - 📖 [Environments](docs/user-guide/environments.md) - Multi-environment configuration
183
- - 📖 [Troubleshooting](docs/user-guide/troubleshooting.md) - Common issues and solutions
178
+ ### 用户指南
179
+ - 📖 [命令参考](docs/user-guide/commands.md) - 完整命令参考
180
+ - 📖 [认证详解](docs/user-guide/authentication.md) - OAuth Device PKCE Flow 详情
181
+ - 📖 [环境配置](docs/user-guide/environments.md) - 多环境配置
182
+ - 📖 [故障排查](docs/user-guide/troubleshooting.md) - 常见问题和解决方案
184
183
 
185
- ### Development
186
- - 📖 [Development Setup](docs/development/setup.md) - Development environment setup
187
- - 📖 [Coding Standards](docs/development/coding-standards.md) - Coding standards and best practices
188
- - 📖 [Testing Guide](docs/development/testing.md) - Testing strategies
189
- - 📖 [Contributing](docs/development/contributing.md) - Contribution guide
184
+ ### 开发指南
185
+ - 📖 [开发环境设置](docs/development/setup.md) - 开发环境配置
186
+ - 📖 [编码规范](docs/development/coding-standards.md) - 编码规范和最佳实践
187
+ - 📖 [测试指南](docs/development/testing.md) - 测试策略
188
+ - 📖 [贡献指南](docs/development/contributing.md) - 贡献指南
190
189
 
191
- ### Architecture
192
- - 📖 [Architecture Overview](docs/architecture/README.md) - System architecture documentation
193
- - 📖 [Design Patterns](docs/architecture/solid-improvements.md) - SOLID principles application
194
- - 📖 [HTTP Client](docs/architecture/http-client.md) - HTTP client architecture
190
+ ### 架构设计
191
+ - 📖 [架构概览](docs/architecture/README.md) - 系统架构文档
192
+ - 📖 [SOLID 改进](docs/architecture/solid-improvements.md) - SOLID 原则应用
193
+ - 📖 [配置系统架构](docs/architecture/configuration.md) - 配置系统设计
194
+ - 📖 [HTTP 客户端](docs/architecture/http-client.md) - HTTP 客户端架构
195
195
 
196
- ### Publishing
197
- - 📖 [Publishing Guide](docs/publishing/README.md) - Version management and publishing
196
+ ### 发布管理
197
+ - 📖 [发布指南](docs/publishing/README.md) - 版本管理和发布流程
198
+ - 📖 [发布说明](docs/publishing/release-notes.md) - 版本更新记录
198
199
 
199
- ## Project Information
200
+ ## 项目信息
200
201
 
201
- - **Version**: 0.1.12
202
- - **Package**: @zrhsh/wukong-cli
203
- - **Organization**: @zrhsh
204
- - **License**: MIT
202
+ - **版本**: 0.3.0
203
+ - **包名**: @zrhsh/wukong-cli
204
+ - **组织**: @zrhsh
205
+ - **许可证**: MIT
205
206
  - **Node.js**: v18+
206
207
  - **TypeScript**: 5.x+
207
208
 
208
- ## Installation
209
+ ## 贡献
209
210
 
210
- ```bash
211
- # Global installation from npm
212
- npm install -g @zzhsh/wukong-cli
213
-
214
- # Development installation from source
215
- git clone <repository-url>
216
- cd wukong-ts-cli
217
- npm install
218
- npm run build
219
- npm run link
220
- ```
221
-
222
- ## Development
223
-
224
- ```bash
225
- # Clone repository
226
- git clone <repository-url>
227
- cd wukong-ts-cli
228
-
229
- # Install dependencies
230
- npm install
231
-
232
- # Development mode
233
- npm run dev auth login
234
-
235
- # Build
236
- npm run build
237
-
238
- # Test
239
- npm run link
240
- wukong-cli --version
241
-
242
- # Unit tests
243
- npm test
244
-
245
- # E2E tests - Automated (无需用户交互,CI/CD 推荐)
246
- npm run test:e2e:automated # 默认环境自动化测试
247
- npm run test:e2e:automated:dev # 开发环境自动化测试
248
- npm run test:e2e:automated:beta # 测试环境自动化测试
249
- npm run test:e2e:automated:prod # 生产环境自动化测试
250
-
251
- # E2E tests - Interactive (需要用户OAuth授权)
252
- npm run test:e2e:interactive # 默认环境交互式测试
253
- npm run test:e2e:interactive:dev # 开发环境交互式测试
254
- npm run test:e2e:interactive:beta # 测试环境交互式测试
255
- npm run test:e2e:interactive:prod # 生产环境交互式测试
256
- npm run test:e2e:interactive:run # 带用户引导的交互式测试
257
- ```
258
-
259
- ## Contributing
260
-
261
- Contributions are welcome! Please see:
262
- - 📖 [Contributing Guide](docs/development/contributing.md)
263
- - 📖 [Coding Standards](docs/development/coding-standards.md)
211
+ 欢迎贡献!请参阅:
212
+ - 📖 [贡献指南](docs/development/contributing.md)
213
+ - 📖 [编码规范](docs/development/coding-standards.md)
264
214
 
265
- ## License
215
+ ## 许可证
266
216
 
267
- MIT License - see [LICENSE](LICENSE) file for details
217
+ MIT License - 详见 [LICENSE](LICENSE) 文件
268
218
 
269
- ## Support
219
+ ## 支持
270
220
 
271
- - **Issues**: (GitHub Issues URL)
272
- - **Documentation**: (in docs/ directory)
273
- - **Debug Mode**: Use `--debug` flag for detailed logs
221
+ - **问题反馈**: (GitHub Issues URL)
222
+ - **文档**: (docs/ 目录)
223
+ - **调试模式**: 使用 `--debug` 标志查看详细日志
274
224
 
275
- ## Version History
225
+ ## 版本历史
276
226
 
277
- See [Release Notes](docs/publishing/release-notes.md) for version history and changes.
227
+ 详见 [发布说明](docs/publishing/release-notes.md)
278
228
 
279
229
  ---
280
230
 
281
- **Current Version**: 0.1.12 | **Package**: @zrhsh/wukong-cli | **Organization**: @zrhsh
231
+ **当前版本**: 0.3.0 | **包名**: @zrhsh/wukong-cli | **组织**: @zrhsh
package/dist/cli.js CHANGED
@@ -398,7 +398,12 @@ import { join, dirname } from "path";
398
398
  import { homedir } from "os";
399
399
  import { fileURLToPath as fileURLToPath2 } from "url";
400
400
  function getUserConfigPath() {
401
- return join(homedir(), "wukong-cli.json");
401
+ return CONFIG_FILE_PATH;
402
+ }
403
+ function ensureConfigDir() {
404
+ if (!existsSync(CONFIG_DIR)) {
405
+ mkdirSync(CONFIG_DIR, { recursive: true });
406
+ }
402
407
  }
403
408
  function createDefaultConfig() {
404
409
  const configPath = getUserConfigPath();
@@ -413,10 +418,7 @@ function createDefaultConfig() {
413
418
  }
414
419
  const templateContent = readFileSync(templatePath, "utf-8");
415
420
  const defaultConfig = JSON.parse(templateContent);
416
- const dir = dirname(configPath);
417
- if (!existsSync(dir)) {
418
- mkdirSync(dir, { recursive: true });
419
- }
421
+ ensureConfigDir();
420
422
  writeFileSync(configPath, JSON.stringify(defaultConfig, null, 2), "utf-8");
421
423
  } catch (error) {
422
424
  }
@@ -515,12 +517,15 @@ function getDefaultEnvironment() {
515
517
  }
516
518
  return DEFAULT_ENVIRONMENT;
517
519
  }
520
+ var CONFIG_DIR, CONFIG_FILE_PATH;
518
521
  var init_config_loader = __esm({
519
522
  "src/config/config-loader.ts"() {
520
523
  "use strict";
521
524
  init_esm_shims();
522
525
  init_environments();
523
526
  init_config_file_error();
527
+ CONFIG_DIR = join(homedir(), ".wukong-cli");
528
+ CONFIG_FILE_PATH = join(CONFIG_DIR, "wukong-cli.json");
524
529
  }
525
530
  });
526
531
 
@@ -1619,7 +1624,7 @@ var AuthenticatingHttpClient = class {
1619
1624
  const config2 = getOceanetConfig();
1620
1625
  const baseUrl2 = options.baseUrl || config2.API_BASE_URL;
1621
1626
  const retryUrl = endpoint.startsWith("http") ? endpoint : `${baseUrl2}${endpoint}`;
1622
- const retryResponse = await fetch(
1627
+ const retryResponse = await retoken.fetch(
1623
1628
  retryUrl,
1624
1629
  {
1625
1630
  method: options.method || "GET",
@@ -2022,6 +2027,16 @@ function buildUrl2(url, baseUrl) {
2022
2027
  const base = baseUrl || config.API_BASE_URL;
2023
2028
  return `${base}${cleanUrl}`;
2024
2029
  }
2030
+ function parseParams(params) {
2031
+ if (!params || Object.keys(params).length === 0) {
2032
+ return "";
2033
+ }
2034
+ const searchParams = new URLSearchParams();
2035
+ for (const [key, value] of Object.entries(params)) {
2036
+ searchParams.append(key, value);
2037
+ }
2038
+ return `?${searchParams.toString()}`;
2039
+ }
2025
2040
  async function executeRequest(method, url, options) {
2026
2041
  const spinner = ora4("Sending request...").start();
2027
2042
  try {
@@ -2033,32 +2048,37 @@ async function executeRequest(method, url, options) {
2033
2048
  }
2034
2049
  const fullUrl = buildUrl2(url, options.baseUrl);
2035
2050
  const customHeaders = parseHeaders(options.headers);
2036
- const headers = {
2037
- "Content-Type": "application/json",
2038
- "Authorization": `Bearer ${accessToken}`,
2039
- ...customHeaders
2040
- };
2041
- let body;
2042
- if (options.data) {
2043
- body = options.data;
2044
- if (!customHeaders["Content-Type"]) {
2045
- headers["Content-Type"] = "application/json";
2046
- }
2047
- }
2051
+ const client = getClient();
2052
+ const requestData = options.data ? JSON.parse(options.data) : void 0;
2053
+ debugRequest(method, fullUrl, { ...customHeaders, "Authorization": "Bearer ***" }, requestData);
2048
2054
  spinner.text = `${method} ${chalk5.cyan(fullUrl)}`;
2049
- debugRequest(method, fullUrl, headers, options.data ? JSON.parse(options.data) : void 0);
2050
2055
  const startTime = Date.now();
2051
- const response = await fetch(fullUrl, {
2052
- method,
2053
- headers,
2054
- body: method !== "GET" && method !== "DELETE" ? body : void 0
2055
- });
2056
+ let data;
2057
+ switch (method.toUpperCase()) {
2058
+ case "GET":
2059
+ const getUrl = fullUrl + parseParams(options.params);
2060
+ data = await client.get(getUrl);
2061
+ break;
2062
+ case "POST":
2063
+ data = await client.post(fullUrl, requestData, customHeaders);
2064
+ break;
2065
+ case "PUT":
2066
+ data = await client.put(fullUrl, requestData, customHeaders);
2067
+ break;
2068
+ case "DELETE":
2069
+ data = await client.delete(fullUrl);
2070
+ break;
2071
+ case "PATCH":
2072
+ data = await client.patch(fullUrl, requestData, customHeaders);
2073
+ break;
2074
+ default:
2075
+ throw new Error(`Unsupported method: ${method}`);
2076
+ }
2056
2077
  const duration = Date.now() - startTime;
2057
- const data = await response.json();
2058
- debugResponse(response.status, response.statusText, data, duration);
2078
+ debugResponse(200, "OK", data, duration);
2059
2079
  spinner.succeed("Response received");
2060
2080
  console.log("");
2061
- console.log(chalk5.dim("Status:"), response.status, response.statusText);
2081
+ console.log(chalk5.dim("Status:"), "200 OK");
2062
2082
  console.log("");
2063
2083
  console.log(chalk5.dim("Response:"));
2064
2084
  console.log(JSON.stringify(data, null, 2));
@@ -2096,11 +2116,13 @@ httpCommand.command("delete <url>").description("Send DELETE request").option("-
2096
2116
  // src/commands/init.ts
2097
2117
  init_esm_shims();
2098
2118
  import { Command as Command3 } from "commander";
2099
- import { writeFileSync as writeFileSync3, existsSync as existsSync3, readFileSync as readFileSync3 } from "fs";
2119
+ import { writeFileSync as writeFileSync3, existsSync as existsSync3, readFileSync as readFileSync3, mkdirSync as mkdirSync3 } from "fs";
2100
2120
  import { join as join3, dirname as dirname3 } from "path";
2101
2121
  import { homedir as homedir3 } from "os";
2102
2122
  import { fileURLToPath as fileURLToPath3 } from "url";
2103
2123
  import chalk6 from "chalk";
2124
+ var CONFIG_DIR2 = join3(homedir3(), ".wukong-cli");
2125
+ var CONFIG_FILE_PATH2 = join3(CONFIG_DIR2, "wukong-cli.json");
2104
2126
  function getProjectRoot2() {
2105
2127
  let currentDir = dirname3(fileURLToPath3(import.meta.url));
2106
2128
  while (currentDir !== dirname3(currentDir)) {
@@ -2111,8 +2133,12 @@ function getProjectRoot2() {
2111
2133
  }
2112
2134
  return process.cwd();
2113
2135
  }
2136
+ function ensureConfigDir2() {
2137
+ if (!existsSync3(CONFIG_DIR2)) {
2138
+ mkdirSync3(CONFIG_DIR2, { recursive: true });
2139
+ }
2140
+ }
2114
2141
  async function executeInit() {
2115
- const configPath = join3(homedir3(), "wukong-cli.json");
2116
2142
  const templatePath = join3(getProjectRoot2(), "wukong-cli.json.template");
2117
2143
  if (!existsSync3(templatePath)) {
2118
2144
  console.error(chalk6.red("\u274C Template configuration file not found"));
@@ -2120,14 +2146,15 @@ async function executeInit() {
2120
2146
  process.exit(1);
2121
2147
  }
2122
2148
  try {
2149
+ ensureConfigDir2();
2123
2150
  const templateContent = readFileSync3(templatePath, "utf-8");
2124
- const configExists = existsSync3(configPath);
2151
+ const configExists = existsSync3(CONFIG_FILE_PATH2);
2125
2152
  if (configExists) {
2126
2153
  console.log(chalk6.yellow("\u26A0\uFE0F Existing configuration file will be overwritten"));
2127
2154
  }
2128
- writeFileSync3(configPath, templateContent, "utf-8");
2155
+ writeFileSync3(CONFIG_FILE_PATH2, templateContent, "utf-8");
2129
2156
  console.log(chalk6.green("\u2705 Configuration file created successfully"));
2130
- console.log(chalk6.gray(`Location: ${configPath}`));
2157
+ console.log(chalk6.gray(`Location: ${CONFIG_FILE_PATH2}`));
2131
2158
  if (configExists) {
2132
2159
  console.log(chalk6.yellow("Previous configuration has been overwritten"));
2133
2160
  }
@@ -2144,13 +2171,13 @@ async function executeInit() {
2144
2171
  process.exit(1);
2145
2172
  }
2146
2173
  }
2147
- var initCommand = new Command3("init").description("Initialize configuration file (creates or overwrites ~/wukong-cli.json)").action(async () => {
2174
+ var initCommand = new Command3("init").description("Initialize configuration file (creates or overwrites ~/.wukong-cli/wukong-cli.json)").action(async () => {
2148
2175
  await executeInit();
2149
2176
  });
2150
2177
 
2151
2178
  // src/cli.ts
2152
2179
  var program = new Command4();
2153
- program.name("wukong-cli").description("Wukong CLI - TypeScript implementation").version("0.3.0").option("--debug", "Enable debug mode (show HTTP requests)").hook("preAction", (thisCommand) => {
2180
+ program.name("wukong-cli").description("Wukong CLI - TypeScript implementation").version("0.4.1").option("-d, --debug", "Enable debug mode (show HTTP requests)").hook("preAction", (thisCommand) => {
2154
2181
  const options = thisCommand.opts();
2155
2182
  if (options.debug === true) {
2156
2183
  setDebugMode(true, true);