@iruidong/code 0.1.0 → 0.1.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/QUICKSTART.md CHANGED
@@ -10,18 +10,10 @@ ruidong --version
10
10
  Expected output:
11
11
 
12
12
  ```bash
13
- Ruidong Code v0.1.0
13
+ Ruidong Code v0.1.2
14
14
  ```
15
15
 
16
- ## 2. Prepare your key
17
-
18
- Ruidong Code can store a direct secret in config, but the recommended path is an environment variable:
19
-
20
- ```bash
21
- export RUIDONG_API_KEY="your_api_key"
22
- ```
23
-
24
- ## 3. Initialize provider config
16
+ ## 2. Initialize provider config
25
17
 
26
18
  ### Option A: Wizard
27
19
 
@@ -29,7 +21,7 @@ export RUIDONG_API_KEY="your_api_key"
29
21
  ruidong init
30
22
  ```
31
23
 
32
- Use this if you want Ruidong Code to guide you through endpoint, key env name, and model selection.
24
+ Use this if you want Ruidong Code to guide you through endpoint, API key, and model selection. The wizard saves them directly to `~/.ruidong-code/config.json`.
33
25
 
34
26
  ### Option B: Preset profile
35
27
 
@@ -51,13 +43,15 @@ ruidong init --force --profile crs
51
43
  ruidong init --force \
52
44
  --provider anthropic-compatible \
53
45
  --base-url https://your-gateway.example/v1 \
54
- --key-env RUIDONG_API_KEY \
46
+ --key "your_api_key" \
55
47
  --model qwen
56
48
  ```
57
49
 
58
50
  If you do not know the model ID yet, omit `--model`. After startup you can choose one with `/model`.
59
51
 
60
- ## 4. Verify headless mode
52
+ Advanced users can still use `--key-env`, `--api-key-env`, or `--auth-token-env` to avoid writing a raw key into config.
53
+
54
+ ## 3. Verify headless mode
61
55
 
62
56
  ```bash
63
57
  ruidong -p "你好,请只回复 OK" --bare
@@ -71,7 +65,7 @@ If your gateway requires an explicit model:
71
65
  ruidong -p "你好,请只回复 OK" --bare --model glm
72
66
  ```
73
67
 
74
- ## 5. Start an interactive session
68
+ ## 4. Start an interactive session
75
69
 
76
70
  ```bash
77
71
  cd /path/to/project
@@ -87,7 +81,7 @@ Useful first commands:
87
81
  /plugin
88
82
  ```
89
83
 
90
- ## 6. Project instruction files
84
+ ## 5. Project instruction files
91
85
 
92
86
  Ruidong Code uses:
93
87
 
@@ -96,12 +90,11 @@ Ruidong Code uses:
96
90
 
97
91
  Legacy `CLAUDE.md` names are still supported for compatibility.
98
92
 
99
- ## 7. Common troubleshooting
93
+ ## 6. Common troubleshooting
100
94
 
101
95
  Auth errors:
102
96
 
103
97
  ```bash
104
- echo $RUIDONG_API_KEY
105
98
  cat ~/.ruidong-code/config.json
106
99
  ruidong doctor
107
100
  ```
package/README.md CHANGED
@@ -13,13 +13,7 @@ Node.js `>=18` is required.
13
13
 
14
14
  ## Quick Start
15
15
 
16
- ### 1. Set your API key
17
-
18
- ```bash
19
- export RUIDONG_API_KEY="your_api_key"
20
- ```
21
-
22
- ### 2. Initialize config
16
+ ### 1. Initialize config
23
17
 
24
18
  Interactive wizard:
25
19
 
@@ -27,6 +21,14 @@ Interactive wizard:
27
21
  ruidong init
28
22
  ```
29
23
 
24
+ The wizard now asks for:
25
+
26
+ - API endpoint URL
27
+ - API key
28
+ - Default model
29
+
30
+ and saves them to `~/.ruidong-code/config.json`.
31
+
30
32
  Preset profiles:
31
33
 
32
34
  ```bash
@@ -40,10 +42,12 @@ Custom gateway:
40
42
  ruidong init --force \
41
43
  --provider anthropic-compatible \
42
44
  --base-url https://your-gateway.example/v1 \
43
- --key-env RUIDONG_API_KEY
45
+ --key "your_api_key"
44
46
  ```
45
47
 
46
- ### 3. Start using it
48
+ Advanced users can still use environment variables with `--key-env`, `--api-key-env`, or `--auth-token-env`.
49
+
50
+ ### 2. Start using it
47
51
 
48
52
  Interactive session:
49
53
 
@@ -73,7 +77,7 @@ Common provider fields:
73
77
  "provider": {
74
78
  "id": "anthropic-compatible",
75
79
  "baseUrl": "https://your-gateway.example/v1",
76
- "authToken": "env:RUIDONG_API_KEY",
80
+ "authToken": "your_api_key",
77
81
  "authMode": "auto",
78
82
  "defaultModel": "glm"
79
83
  }
@@ -114,6 +118,7 @@ Inside an interactive session:
114
118
  ## Docs
115
119
 
116
120
  - [Quick Start](./QUICKSTART.md)
121
+ - [同事安装说明](./docs/TEAM_INSTALL_GUIDE_CN.md)
117
122
  - [双平台配置说明](./docs/PLATFORM_SPLIT_CN.md)
118
123
 
119
124
  ## Release Verification
package/dist/cli.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- // ruidong v0.1.0 (built from source)
2
+ // ruidong v0.1.2 (built from source)
3
3
  // Copyright (c) Anthropic PBC. All rights reserved.
4
4
  import { createRequire as __createRequire } from "module";const require=__createRequire(import.meta.url);
5
5
  var __defProp = Object.defineProperty;
@@ -81,7 +81,7 @@ var __callDispose = (stack, error, hasError) => {
81
81
  var PUBLIC_CLI_VERSION, BUILD_TIME, API_COMPAT_VERSION, API_COMPAT_VERSION_BASE;
82
82
  var init_version = __esm({
83
83
  "build-src/src/constants/version.ts"() {
84
- PUBLIC_CLI_VERSION = "0.1.0";
84
+ PUBLIC_CLI_VERSION = "0.1.2";
85
85
  BUILD_TIME = "2026-04-01T06:00:31.912Z";
86
86
  API_COMPAT_VERSION = "2.1.88";
87
87
  API_COMPAT_VERSION_BASE = API_COMPAT_VERSION.match(/^\d+\.\d+\.\d+(?:-[a-z]+)?/)?.[0];
@@ -75104,7 +75104,7 @@ async function setupSdkMcpClients(sdkMcpConfigs, sendMcpMessage) {
75104
75104
  {
75105
75105
  name: "ruidong-code",
75106
75106
  title: "ruidong",
75107
- version: "0.1.0",
75107
+ version: "0.1.2",
75108
75108
  description: "Ruidong Code agentic coding tool",
75109
75109
  websiteUrl: PRODUCT_URL
75110
75110
  },
@@ -75527,7 +75527,7 @@ var init_client3 = __esm({
75527
75527
  {
75528
75528
  name: "ruidong-code",
75529
75529
  title: "ruidong",
75530
- version: "0.1.0",
75530
+ version: "0.1.2",
75531
75531
  description: "Ruidong Code agentic coding tool",
75532
75532
  websiteUrl: PRODUCT_URL
75533
75533
  },
@@ -86817,12 +86817,12 @@ async function installOrUpdateClaudePackage(channel, specificVersion) {
86817
86817
  const versionSpec = specificVersion ? specificVersion : channel === "stable" ? "stable" : "latest";
86818
86818
  const result = await execFileNoThrowWithCwd(
86819
86819
  "npm",
86820
- ["install", `${"@ruidong/code"}@${versionSpec}`],
86820
+ ["install", `${"@iruidong/code"}@${versionSpec}`],
86821
86821
  { cwd: getLocalInstallDir(), maxBuffer: 1e6 }
86822
86822
  );
86823
86823
  if (result.code !== 0) {
86824
86824
  const error = new Error(
86825
- `Failed to install Claude CLI package: ${result.stderr}`
86825
+ `Failed to install Ruidong Code package: ${result.stderr}`
86826
86826
  );
86827
86827
  logError(error);
86828
86828
  return result.code === 190 ? "in_progress" : "install_failed";
@@ -87209,7 +87209,7 @@ async function installGlobalPackage(specificVersion) {
87209
87209
  );
87210
87210
  logEvent("tengu_auto_updater_lock_contention", {
87211
87211
  pid: process.pid,
87212
- currentVersion: "0.1.0"
87212
+ currentVersion: "0.1.2"
87213
87213
  });
87214
87214
  return "in_progress";
87215
87215
  }
@@ -87218,7 +87218,7 @@ async function installGlobalPackage(specificVersion) {
87218
87218
  if (!env.isRunningWithBun() && env.isNpmFromWindowsPath()) {
87219
87219
  logError(new Error("Windows NPM detected in WSL environment"));
87220
87220
  logEvent("tengu_auto_updater_windows_npm_in_wsl", {
87221
- currentVersion: "0.1.0"
87221
+ currentVersion: "0.1.2"
87222
87222
  });
87223
87223
  console.error(`
87224
87224
  Error: Windows NPM detected in WSL
@@ -87299,7 +87299,7 @@ var init_autoUpdater = __esm({
87299
87299
  init_slowOperations();
87300
87300
  GCS_BUCKET_URL = "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases";
87301
87301
  CLI_COMMAND = "ruidong";
87302
- PACKAGE_NAME = "@ruidong/code";
87302
+ PACKAGE_NAME = "@iruidong/code";
87303
87303
  AutoUpdaterError = class extends ClaudeError {
87304
87304
  };
87305
87305
  LOCK_TIMEOUT_MS = 5 * 60 * 1e3;
@@ -87885,7 +87885,7 @@ function detectLinuxGlobPatternWarnings() {
87885
87885
  }
87886
87886
  async function getDoctorDiagnostic() {
87887
87887
  const installationType = await getCurrentInstallationType();
87888
- const version2 = typeof MACRO !== "undefined" && "0.1.0" ? "0.1.0" : "unknown";
87888
+ const version2 = typeof MACRO !== "undefined" && "0.1.2" ? "0.1.2" : "unknown";
87889
87889
  const installationPath = await getInstallationPath();
87890
87890
  const invokedBinary = getInvokedBinary();
87891
87891
  const multipleInstallations = await detectMultipleInstallations();
@@ -87978,7 +87978,7 @@ var init_doctorDiagnostic = __esm({
87978
87978
  init_slowOperations();
87979
87979
  init_which();
87980
87980
  CLI_COMMAND2 = "ruidong";
87981
- PACKAGE_NAME2 = "@ruidong/code";
87981
+ PACKAGE_NAME2 = "@iruidong/code";
87982
87982
  }
87983
87983
  });
87984
87984
 
@@ -88380,7 +88380,7 @@ var init_download = __esm({
88380
88380
  init_installer();
88381
88381
  GCS_BUCKET_URL2 = "https://storage.googleapis.com/claude-code-dist-86c565f3-f756-42ad-8dfa-d59b1c096819/claude-code-releases";
88382
88382
  ARTIFACTORY_REGISTRY_URL = "https://artifactory.infra.ant.dev/artifactory/api/npm/npm-all/";
88383
- PACKAGE_NAME3 = "@ruidong/code";
88383
+ PACKAGE_NAME3 = "@iruidong/code";
88384
88384
  DEFAULT_STALL_TIMEOUT_MS = 6e4;
88385
88385
  MAX_DOWNLOAD_RETRIES = 3;
88386
88386
  StallTimeoutError = class extends Error {
@@ -88965,7 +88965,7 @@ async function updateLatest(channelOrVersion, forceReinstall = false) {
88965
88965
  version2 = maxVersion;
88966
88966
  }
88967
88967
  }
88968
- if (!forceReinstall && version2 === "0.1.0" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
88968
+ if (!forceReinstall && version2 === "0.1.2" && await versionIsAvailable(version2) && await isPossibleClaudeBinary(executablePath)) {
88969
88969
  logForDebugging(`Found ${version2} at ${executablePath}, skipping install`);
88970
88970
  logEvent("tengu_native_update_complete", {
88971
88971
  latency_ms: Date.now() - startTime,
@@ -89836,7 +89836,7 @@ var init_installer = __esm({
89836
89836
  init_download();
89837
89837
  init_pidLock();
89838
89838
  VERSION_RETENTION_COUNT = 2;
89839
- PACKAGE_NAME4 = "@ruidong/code";
89839
+ PACKAGE_NAME4 = "@iruidong/code";
89840
89840
  LOCK_STALE_MS = 7 * 24 * 60 * 60 * 1e3;
89841
89841
  inFlightInstall = null;
89842
89842
  }
@@ -187817,7 +187817,7 @@ ${sanitizedDescription}
187817
187817
  **Environment Info**
187818
187818
  - Platform: ${env.platform}
187819
187819
  - Terminal: ${env.terminal}
187820
- - Version: ${"0.1.0"}
187820
+ - Version: ${"0.1.2"}
187821
187821
  - Feedback ID: ${feedbackId}
187822
187822
 
187823
187823
  **Errors**
@@ -254125,7 +254125,7 @@ function generateHtmlReport(data, insights) {
254125
254125
  </html>`;
254126
254126
  }
254127
254127
  function buildExportData(data, insights, facets, remoteStats) {
254128
- const version2 = typeof MACRO !== "undefined" ? "0.1.0" : "unknown";
254128
+ const version2 = typeof MACRO !== "undefined" ? "0.1.2" : "unknown";
254129
254129
  const remote_hosts_collected = remoteStats?.hosts.filter((h) => h.sessionCount > 0).map((h) => h.name);
254130
254130
  const facets_summary = {
254131
254131
  total: facets.size,
@@ -257889,7 +257889,7 @@ var init_sessionStorage = __esm({
257889
257889
  init_settings2();
257890
257890
  init_slowOperations();
257891
257891
  init_uuid();
257892
- VERSION2 = typeof MACRO !== "undefined" ? "0.1.0" : "unknown";
257892
+ VERSION2 = typeof MACRO !== "undefined" ? "0.1.2" : "unknown";
257893
257893
  MAX_TOMBSTONE_REWRITE_BYTES = 50 * 1024 * 1024;
257894
257894
  SKIP_FIRST_PROMPT_PATTERN = /^(?:\s*<[a-z][\w-]*[\s>]|\[Request interrupted by user[^\]]*\])/;
257895
257895
  EPHEMERAL_PROGRESS_TYPES = /* @__PURE__ */ new Set([
@@ -285261,7 +285261,7 @@ function AutoUpdater({
285261
285261
  /* @__PURE__ */ jsx401(ThemedText, { bold: true, children: "ruidong doctor" }),
285262
285262
  " or",
285263
285263
  " ",
285264
- /* @__PURE__ */ jsx401(ThemedText, { bold: true, children: hasLocalInstall ? "cd ~/.ruidong-code/local && npm update @ruidong/code" : "npm i -g @ruidong/code" })
285264
+ /* @__PURE__ */ jsx401(ThemedText, { bold: true, children: hasLocalInstall ? "cd ~/.ruidong-code/local && npm update @iruidong/code" : "npm i -g @iruidong/code" })
285265
285265
  ] })
285266
285266
  ] });
285267
285267
  }
@@ -335687,9 +335687,6 @@ function resolveSecretSettingValue(secretSetting) {
335687
335687
  function isInteractiveTerminal() {
335688
335688
  return process.stdin.isTTY === true && process.stdout.isTTY === true;
335689
335689
  }
335690
- function isValidEnvVarName(value) {
335691
- return /^[A-Za-z_][A-Za-z0-9_]*$/.test(value);
335692
- }
335693
335690
  async function promptLine(rl, prompt, defaultValue) {
335694
335691
  const suffix = defaultValue ? ` [${defaultValue}]` : "";
335695
335692
  const answer = (await rl.question(`${prompt}${suffix}: `)).trim();
@@ -335727,15 +335724,16 @@ async function promptEndpoint(rl, initialValue) {
335727
335724
  process.stdout.write("Please enter a valid http:// or https:// URL.\n");
335728
335725
  }
335729
335726
  }
335730
- async function promptEnvVarName(rl, label, defaultValue) {
335727
+ async function promptSecretValue(rl, label, existingValue) {
335728
+ if (existingValue && existingValue.trim()) {
335729
+ return existingValue.trim();
335730
+ }
335731
335731
  while (true) {
335732
- const envName = await promptLine(rl, label, defaultValue);
335733
- if (isValidEnvVarName(envName)) {
335734
- return envName;
335732
+ const value = (await rl.question(`${label}: `)).trim();
335733
+ if (value) {
335734
+ return value;
335735
335735
  }
335736
- process.stdout.write(
335737
- "Environment variable names must use letters, numbers, and underscores, and cannot start with a number.\n"
335738
- );
335736
+ process.stdout.write("Please enter a non-empty API key.\n");
335739
335737
  }
335740
335738
  }
335741
335739
  async function maybeConfirmOverwriteExistingConfig() {
@@ -335763,43 +335761,43 @@ async function runInitWizard(options) {
335763
335761
  try {
335764
335762
  const mode = await promptWizardMode(rl);
335765
335763
  if (mode === "crs") {
335766
- const apiKeyEnv = await promptEnvVarName(
335764
+ const apiKey = await promptSecretValue(
335767
335765
  rl,
335768
- "Environment variable name for your platform key",
335769
- options.apiKeyEnv ?? options.keyEnv ?? "RUIDONG_API_KEY"
335766
+ "API key (will be saved to ~/.ruidong-code/config.json)",
335767
+ options.apiKey ?? options.key
335770
335768
  );
335771
335769
  return {
335772
335770
  ...options,
335773
335771
  profile: "crs",
335774
- apiKeyEnv
335772
+ apiKey
335775
335773
  };
335776
335774
  }
335777
335775
  if (mode === "iruidong") {
335778
- const authTokenEnv = await promptEnvVarName(
335776
+ const authToken = await promptSecretValue(
335779
335777
  rl,
335780
- "Environment variable name for your platform key",
335781
- options.authTokenEnv ?? options.keyEnv ?? "RUIDONG_API_KEY"
335778
+ "API key (will be saved to ~/.ruidong-code/config.json)",
335779
+ options.authToken ?? options.key
335782
335780
  );
335783
335781
  return {
335784
335782
  ...options,
335785
335783
  profile: "iruidong",
335786
- authTokenEnv
335784
+ authToken
335787
335785
  };
335788
335786
  }
335789
335787
  const baseUrl = await promptEndpoint(rl, options.baseUrl ?? options.endpoint);
335790
- const keyEnv = await promptEnvVarName(
335788
+ const key = await promptSecretValue(
335791
335789
  rl,
335792
- "Environment variable name for your platform key",
335793
- options.keyEnv ?? options.authTokenEnv ?? options.apiKeyEnv ?? "RUIDONG_API_KEY"
335790
+ "API key (will be saved to ~/.ruidong-code/config.json)",
335791
+ options.key ?? options.authToken ?? options.apiKey
335794
335792
  );
335795
335793
  process.stdout.write(
335796
- "\nDefault model is optional. If your key is already available in this shell,\nRuidong Code will try to discover models from the gateway next.\n\n"
335794
+ "\nDefault model is optional. Ruidong Code will now try to discover models from the gateway.\n\n"
335797
335795
  );
335798
335796
  return {
335799
335797
  ...options,
335800
335798
  provider: options.provider ?? "anthropic-compatible",
335801
335799
  baseUrl,
335802
- keyEnv
335800
+ key
335803
335801
  };
335804
335802
  } finally {
335805
335803
  rl.close();
@@ -335951,8 +335949,8 @@ ${resolvedOptionsWithModel.profile ? `Profile: ${resolvedOptionsWithModel.profil
335951
335949
  Auth mode: ${config2.provider?.authMode ?? "auto"}
335952
335950
  Default model: ${config2.provider?.defaultModel ?? "not set (choose later with /model)"}
335953
335951
  Official marketplace: ${config2.marketplace?.official?.name ?? "ruidong-marketplace-seed"}
335954
- ${config2.provider?.authToken ? `Auth token setting: ${config2.provider.authToken}
335955
- ` : `API key setting: ${config2.provider?.apiKey ?? "env:RUIDONG_API_KEY"}
335952
+ ${config2.provider?.authToken ? `Credential storage: ${config2.provider.authToken.startsWith("env:") ? `env var ${config2.provider.authToken.slice(4)}` : "saved directly in config.json"}
335953
+ ` : `Credential storage: ${config2.provider?.apiKey?.startsWith("env:") ? `env var ${config2.provider.apiKey.slice(4)}` : "saved directly in config.json"}
335956
335954
  `}`
335957
335955
  );
335958
335956
  if (migrationResult.migrated) {
@@ -337349,7 +337347,7 @@ var init_update = __esm({
337349
337347
  init_settings2();
337350
337348
  PRODUCT_NAME = "Ruidong Code";
337351
337349
  CLI_COMMAND3 = "ruidong";
337352
- PACKAGE_NAME5 = "@ruidong/code";
337350
+ PACKAGE_NAME5 = "@iruidong/code";
337353
337351
  LOCAL_INSTALL_DIR = "~/.ruidong-code/local";
337354
337352
  }
337355
337353
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@iruidong/code",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "description": "Ruidong Code CLI for anthropic-compatible coding workflows",
5
5
  "type": "module",
6
6
  "private": false,