myclaude-code 8.8.11 → 8.8.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
@@ -1,6 +1,6 @@
1
- # myclaude v8.8.11
1
+ # myclaude v8.8.12
2
2
 
3
- ![myclaude cover](https://unpkg.com/myclaude-code@8.8.11/image.png)
3
+ ![myclaude cover](https://unpkg.com/myclaude-code@8.8.12/image.png)
4
4
 
5
5
  `myclaude` is a fast-start AI coding CLI under the `我的code` brand. It is positioned around direct provider setup instead of Claude Code account login, so users can connect a compatible third-party API endpoint quickly and start working immediately.
6
6
 
@@ -9,7 +9,8 @@
9
9
  - No official Claude Code login flow in the normal getting-started path
10
10
  - Quick provider setup for custom Anthropic-compatible API URLs
11
11
  - Works with third-party API gateways, relay services, and self-hosted compatible endpoints
12
- - Global install with three launch commands: `myclaude`, `mycode`, and `claude`
12
+ - Global install without npm binary collisions
13
+ - Launch with `myclaude` or `mycode`, then let the native installer configure `claude`
13
14
  - Cleaner onboarding focused on fast API URL and API key configuration
14
15
 
15
16
  ## Install
@@ -25,32 +26,37 @@ Install globally from npm:
25
26
  npm install -g myclaude-code
26
27
  ```
27
28
 
28
- Start it with any of these commands:
29
+ This installs the non-conflicting npm commands:
29
30
 
30
31
  ```bash
31
32
  myclaude
32
33
  mycode
33
- claude
34
34
  ```
35
35
 
36
- If another global `claude` binary already exists on your machine, npm may ask you to overwrite it. In that case, either remove the old binary first or reinstall with `--force`.
36
+ Then run the built-in installer once to configure the native launcher, including the `claude` command:
37
+
38
+ ```bash
39
+ myclaude install --force
40
+ ```
37
41
 
38
- If you want `myclaude-code` to replace an existing global `claude` binary during install:
42
+ After that, you can launch with:
39
43
 
40
44
  ```bash
41
- npm install -g myclaude-code --force
45
+ myclaude
46
+ mycode
47
+ claude
42
48
  ```
43
49
 
44
50
  One-line install:
45
51
 
46
52
  ```bash
47
- curl -fsSL https://unpkg.com/myclaude-code@8.8.11/install.sh | bash
53
+ curl -fsSL https://unpkg.com/myclaude-code@8.8.12/install.sh | bash
48
54
  ```
49
55
 
50
56
  Install a specific version:
51
57
 
52
58
  ```bash
53
- curl -fsSL https://unpkg.com/myclaude-code@8.8.11/install.sh | bash -s -- 8.8.11
59
+ curl -fsSL https://unpkg.com/myclaude-code@8.8.12/install.sh | bash -s -- 8.8.12
54
60
  ```
55
61
 
56
62
  ## Quick Start
@@ -72,6 +78,7 @@ Version check:
72
78
  ```bash
73
79
  myclaude --version
74
80
  mycode --version
81
+ # available after running: myclaude install --force
75
82
  claude --version
76
83
  ```
77
84
 
@@ -1011,7 +1011,7 @@ async function askModelChoice(
1011
1011
  { language },
1012
1012
  )
1013
1013
 
1014
- if (choice === null) {
1014
+ if (choice === null || choice === 'abort') {
1015
1015
  return null
1016
1016
  }
1017
1017
 
@@ -3026,6 +3026,17 @@ function formatCurrentConfigurationSummary(language) {
3026
3026
  ]
3027
3027
  }
3028
3028
 
3029
+ async function askQuestion(rl, prompt) {
3030
+ try {
3031
+ return await rl.question(prompt)
3032
+ } catch (error) {
3033
+ if (error instanceof Error && error.name === 'AbortError') {
3034
+ return null
3035
+ }
3036
+ throw error
3037
+ }
3038
+ }
3039
+
3029
3040
  async function askText(
3030
3041
  rl,
3031
3042
  label,
@@ -3035,7 +3046,11 @@ async function askText(
3035
3046
  const messages = getMessages(language)
3036
3047
  while (true) {
3037
3048
  const suffix = initialValue ? ` [${initialValue}]` : ''
3038
- const answer = (await rl.question(`${label}${suffix}: `)).trim()
3049
+ const rawAnswer = await askQuestion(rl, `${label}${suffix}: `)
3050
+ if (rawAnswer === null) {
3051
+ return null
3052
+ }
3053
+ const answer = rawAnswer.trim()
3039
3054
  const value = answer || initialValue
3040
3055
  if (required && !value) {
3041
3056
  printLine(messages.requiredField)
@@ -3069,7 +3084,11 @@ async function askSelect(
3069
3084
  if (allowCancel) {
3070
3085
  printLine(`0. ${messages.cancelOption}`)
3071
3086
  }
3072
- const answer = (await rl.question('Choose: ')).trim()
3087
+ const rawAnswer = await askQuestion(rl, 'Choose: ')
3088
+ if (rawAnswer === null) {
3089
+ return allowCancel ? null : 'abort'
3090
+ }
3091
+ const answer = rawAnswer.trim()
3073
3092
  if (allowCancel && (answer === '0' || answer.toLowerCase() === 'q')) {
3074
3093
  return null
3075
3094
  }
@@ -3093,24 +3112,27 @@ async function chooseLanguage(rl, options = {}) {
3093
3112
  return savedLanguage
3094
3113
  }
3095
3114
 
3096
- const selectedLanguage =
3097
- (await askSelect(
3098
- rl,
3099
- getMessages('en').chooseLanguage,
3100
- [
3101
- {
3102
- label: getMessages('zh').languageChinese,
3103
- description: '使用中文进行配置',
3104
- value: 'zh',
3105
- },
3106
- {
3107
- label: getMessages('en').languageEnglish,
3108
- description: 'Use English for setup',
3109
- value: 'en',
3110
- },
3111
- ],
3112
- { allowCancel: false, language: 'en' },
3113
- )) || 'en'
3115
+ const selectedLanguage = await askSelect(
3116
+ rl,
3117
+ getMessages('en').chooseLanguage,
3118
+ [
3119
+ {
3120
+ label: getMessages('zh').languageChinese,
3121
+ description: '使用中文进行配置',
3122
+ value: 'zh',
3123
+ },
3124
+ {
3125
+ label: getMessages('en').languageEnglish,
3126
+ description: 'Use English for setup',
3127
+ value: 'en',
3128
+ },
3129
+ ],
3130
+ { allowCancel: false, language: 'en' },
3131
+ )
3132
+
3133
+ if (selectedLanguage === 'abort') {
3134
+ return 'en'
3135
+ }
3114
3136
 
3115
3137
  saveLanguage(selectedLanguage)
3116
3138
  return selectedLanguage
@@ -3197,11 +3219,14 @@ async function configureProfile(
3197
3219
  }
3198
3220
  }
3199
3221
 
3200
- draft.name = await askText(rl, messages.providerName, {
3222
+ const name = await askText(rl, messages.providerName, {
3201
3223
  initialValue: draft.name,
3202
3224
  required: true,
3203
3225
  }, language)
3204
- draft.baseUrl = await askText(rl, messages.apiUrl, {
3226
+ if (name === null) return null
3227
+ draft.name = name
3228
+
3229
+ const baseUrl = await askText(rl, messages.apiUrl, {
3205
3230
  initialValue: draft.baseUrl,
3206
3231
  required: true,
3207
3232
  validate(value) {
@@ -3210,10 +3235,15 @@ async function configureProfile(
3210
3235
  : messages.invalidApiUrl
3211
3236
  },
3212
3237
  }, language)
3213
- draft.credential = await askText(rl, getCredentialLabel(draft.authType), {
3238
+ if (baseUrl === null) return null
3239
+ draft.baseUrl = baseUrl
3240
+
3241
+ const credential = await askText(rl, getCredentialLabel(draft.authType), {
3214
3242
  initialValue: draft.credential,
3215
3243
  required: true,
3216
3244
  }, language)
3245
+ if (credential === null) return null
3246
+ draft.credential = credential
3217
3247
  draft.providerId = inferProviderPresetId(draft.baseUrl)
3218
3248
 
3219
3249
  const routingPresetId = await askSelect(
@@ -3473,7 +3503,7 @@ export async function runMyclaudeProviderSetup(options = {}) {
3473
3503
  },
3474
3504
  ], { allowCancel: false, language })
3475
3505
 
3476
- if (selection === 'skip') return false
3506
+ if (selection === 'abort' || selection === 'skip') return false
3477
3507
  if (selection === 'add' && (await handleAdd(rl, language))) return true
3478
3508
  if (selection === 'edit' && (await handleEditOrCopy(rl, 'edit', language))) {
3479
3509
  return true
@@ -3539,6 +3569,10 @@ export async function runMyclaudeStartupChooser(options = {}) {
3539
3569
  { allowCancel: false, language },
3540
3570
  )
3541
3571
 
3572
+ if (selection === 'abort') {
3573
+ return false
3574
+ }
3575
+
3542
3576
  if (selection === 'use-current') {
3543
3577
  const currentProfile = getResolvedCurrentProviderProfile()
3544
3578
  const repairResult = await attemptAutoRepairProviderProfile(currentProfile, {
package/install.sh CHANGED
@@ -43,11 +43,13 @@ main() {
43
43
  fi
44
44
 
45
45
  printf 'Installing %s@%s from npm...\n' "$PACKAGE" "$version"
46
- npm install -g "${PACKAGE}@${version}" --force
46
+ npm install -g "${PACKAGE}@${version}"
47
47
 
48
48
  printf 'Installed %s@%s\n' "$PACKAGE" "$version"
49
- printf 'Available commands: myclaude, mycode, claude\n'
49
+ printf 'Available commands after npm install: myclaude, mycode\n'
50
+ printf 'Running native launcher setup so the claude command is configured without npm bin conflicts...\n'
50
51
 
52
+ myclaude install --force
51
53
  myclaude --version || true
52
54
  }
53
55
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "myclaude-code",
3
- "version": "8.8.11",
3
+ "version": "8.8.12",
4
4
  "description": "myclaude: fast-start AI coding CLI with no Claude Code login and quick third-party API setup",
5
5
  "keywords": [
6
6
  "myclaude",
@@ -16,8 +16,7 @@
16
16
  "type": "module",
17
17
  "bin": {
18
18
  "myclaude": "dist/cli.js",
19
- "mycode": "dist/cli.js",
20
- "claude": "dist/cli.js"
19
+ "mycode": "dist/cli.js"
21
20
  },
22
21
  "files": [
23
22
  "dist",