@liuzijian625/code-cli 1.0.0 → 1.0.2
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/lib/config.js +5 -1
- package/package.json +10 -4
package/lib/config.js
CHANGED
|
@@ -51,9 +51,11 @@ async function applyCodex(preset) {
|
|
|
51
51
|
// Claude Code 配置
|
|
52
52
|
async function applyClaude(preset) {
|
|
53
53
|
if (isWindows) {
|
|
54
|
-
// Windows:
|
|
54
|
+
// Windows: 设置用户和系统环境变量(系统变量需要管理员权限)
|
|
55
55
|
await execAsync(`powershell -Command "[System.Environment]::SetEnvironmentVariable('ANTHROPIC_BASE_URL', '${preset.url}', [System.EnvironmentVariableTarget]::User)"`);
|
|
56
56
|
await execAsync(`powershell -Command "[System.Environment]::SetEnvironmentVariable('ANTHROPIC_AUTH_TOKEN', '${preset.key}', [System.EnvironmentVariableTarget]::User)"`);
|
|
57
|
+
await execAsync(`powershell -Command "Start-Process powershell -Verb RunAs -ArgumentList '-Command', '[System.Environment]::SetEnvironmentVariable(''ANTHROPIC_BASE_URL'', ''${preset.url}'', [System.EnvironmentVariableTarget]::Machine)'"`);
|
|
58
|
+
await execAsync(`powershell -Command "Start-Process powershell -Verb RunAs -ArgumentList '-Command', '[System.Environment]::SetEnvironmentVariable(''ANTHROPIC_AUTH_TOKEN'', ''${preset.key}'', [System.EnvironmentVariableTarget]::Machine)'"`);
|
|
57
59
|
} else {
|
|
58
60
|
// Linux/macOS: 修改 settings.json
|
|
59
61
|
const claudeDir = path.join(os.homedir(), '.claude');
|
|
@@ -126,6 +128,8 @@ async function clearClaude() {
|
|
|
126
128
|
if (isWindows) {
|
|
127
129
|
await execAsync(`powershell -Command "[System.Environment]::SetEnvironmentVariable('ANTHROPIC_BASE_URL', $null, [System.EnvironmentVariableTarget]::User)"`);
|
|
128
130
|
await execAsync(`powershell -Command "[System.Environment]::SetEnvironmentVariable('ANTHROPIC_AUTH_TOKEN', $null, [System.EnvironmentVariableTarget]::User)"`);
|
|
131
|
+
await execAsync(`powershell -Command "Start-Process powershell -Verb RunAs -ArgumentList '-Command', '[System.Environment]::SetEnvironmentVariable(''ANTHROPIC_BASE_URL'', $null, [System.EnvironmentVariableTarget]::Machine)'"`);
|
|
132
|
+
await execAsync(`powershell -Command "Start-Process powershell -Verb RunAs -ArgumentList '-Command', '[System.Environment]::SetEnvironmentVariable(''ANTHROPIC_AUTH_TOKEN'', $null, [System.EnvironmentVariableTarget]::Machine)'"`);
|
|
129
133
|
} else {
|
|
130
134
|
const claudeDir = path.join(os.homedir(), '.claude');
|
|
131
135
|
const settingsFile = path.join(claudeDir, 'settings.json');
|
package/package.json
CHANGED
|
@@ -1,15 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@liuzijian625/code-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "AI CLI 配置管理工具 - 管理 Codex、Claude Code、Gemini CLI 的配置",
|
|
5
|
-
"main": "
|
|
5
|
+
"main": "bin/cli.js",
|
|
6
6
|
"bin": {
|
|
7
|
-
"code-cli": "
|
|
7
|
+
"code-cli": "bin/cli.js"
|
|
8
8
|
},
|
|
9
9
|
"scripts": {
|
|
10
10
|
"test": "echo \"Error: no test specified\" && exit 1"
|
|
11
11
|
},
|
|
12
|
-
"keywords": [
|
|
12
|
+
"keywords": [
|
|
13
|
+
"cli",
|
|
14
|
+
"codex",
|
|
15
|
+
"claude",
|
|
16
|
+
"gemini",
|
|
17
|
+
"config"
|
|
18
|
+
],
|
|
13
19
|
"author": "",
|
|
14
20
|
"license": "ISC",
|
|
15
21
|
"type": "module",
|