@halilertekin/claude-code-router-config 1.3.7 → 1.3.9

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/NPM_README.md CHANGED
@@ -12,6 +12,20 @@ npm install -g @halilertekin/claude-code-router-config
12
12
  ccr-setup
13
13
  ```
14
14
 
15
+ ### Non-interactive install (CI)
16
+
17
+ If you run in CI or without a TTY, the installer skips existing config files by default.
18
+
19
+ ```bash
20
+ # Skip prompts (CI-friendly)
21
+ CCR_CONFIG_NO_PROMPT=1 ccr-setup
22
+
23
+ # Force overwrite existing config files
24
+ CCR_CONFIG_OVERWRITE=1 ccr-setup
25
+ # or
26
+ ccr-setup --overwrite
27
+ ```
28
+
15
29
  ### One-shot GLM setup (Claude login + GLM API)
16
30
 
17
31
  ```bash
package/README.md CHANGED
@@ -1,13 +1,14 @@
1
1
  # Claude Code Router Config - Advanced Multi-Provider Setup
2
2
 
3
- 🚀 **v1.3.7** - Now with z.ai (GLM 4.7) support, advanced CLI tools, analytics, smart routing, and configuration templates!
3
+ 🚀 **v1.3.9** - Now with z.ai (GLM 4.7) support, advanced CLI tools, analytics, smart routing, and configuration templates!
4
4
 
5
5
  Use Claude Code as a single interface to access multiple AI providers with intelligent routing for optimal performance, cost, and quality.
6
6
 
7
- ## ✨ New in v1.3.7
7
+ ## ✨ New in v1.3.9
8
8
  - **z.ai Support**: Native integration for GLM-4.7 via z.ai (PPInfra).
9
9
  - **Lightweight Mode**: New `ccc` function for zero-dependency routing.
10
10
  - **Direct GLM Alias**: Type `glm` to launch Claude Code with GLM-4.7 immediately.
11
+ - **Non-interactive install**: CI-friendly installer flags and env controls.
11
12
 
12
13
  ## 🚀 Setup on Another Machine (Fastest Way)
13
14
 
@@ -76,6 +77,21 @@ pnpm add -g @halilertekin/claude-code-router-config
76
77
  # System is ready! Run: ccr --help
77
78
  ```
78
79
 
80
+ Then run the installer to copy config files:
81
+
82
+ ```bash
83
+ ccr-setup
84
+ ```
85
+
86
+ Non-interactive usage (CI):
87
+
88
+ ```bash
89
+ CCR_CONFIG_NO_PROMPT=1 ccr-setup
90
+ CCR_CONFIG_OVERWRITE=1 ccr-setup
91
+ # or
92
+ ccr-setup --overwrite
93
+ ```
94
+
79
95
  ### Option 2: Manual Setup
80
96
 
81
97
  #### 1. Install Dependencies
@@ -179,4 +195,4 @@ MIT © [Halil Ertekin](https://github.com/halilertekin)
179
195
 
180
196
  ## 🌟 Show Your Support
181
197
 
182
- If you find this useful, please give it a ⭐ on [GitHub](https://github.com/halilertekin/CC-RouterMultiProvider)!
198
+ If you find this useful, please give it a ⭐ on [GitHub](https://github.com/halilertekin/CC-RouterMultiProvider)!
package/install.js CHANGED
@@ -17,6 +17,18 @@ const { execSync } = require('child_process');
17
17
 
18
18
  const configDir = path.join(process.env.HOME || process.env.USERPROFILE, '.claude-code-router');
19
19
  const packageDir = __dirname;
20
+ const argv = new Set(process.argv.slice(2));
21
+ const envIsTrue = (value) => /^(1|true|yes|y)$/i.test(value || '');
22
+ const forceOverwrite =
23
+ argv.has('--overwrite') ||
24
+ argv.has('--force') ||
25
+ envIsTrue(process.env.CCR_CONFIG_OVERWRITE);
26
+ const nonInteractive =
27
+ argv.has('--no-prompt') ||
28
+ argv.has('--non-interactive') ||
29
+ envIsTrue(process.env.CCR_CONFIG_NO_PROMPT) ||
30
+ envIsTrue(process.env.CI);
31
+ const canPrompt = Boolean(process.stdin.isTTY) && !nonInteractive;
20
32
 
21
33
  async function checkRequirements() {
22
34
  console.log(chalk.blue('📋 Checking requirements...'));
@@ -76,18 +88,29 @@ async function setupConfig() {
76
88
  const dest = path.join(configDir, file);
77
89
 
78
90
  if (await fs.pathExists(dest)) {
79
- const { overwrite } = await inquirer.prompt([
80
- {
81
- type: 'confirm',
82
- name: 'overwrite',
83
- message: `File ${file} exists. Overwrite?`,
84
- default: false
85
- }
86
- ]);
87
-
88
- if (!overwrite) {
89
- console.log(chalk.yellow(`⚠️ Skipping ${file}`));
91
+ if (forceOverwrite) {
92
+ console.log(chalk.yellow(`⚠️ Overwriting ${file} (forced)`));
93
+ } else if (!canPrompt) {
94
+ console.log(
95
+ chalk.yellow(
96
+ `⚠️ Skipping ${file} (non-interactive). Set CCR_CONFIG_OVERWRITE=1 to overwrite.`
97
+ )
98
+ );
90
99
  continue;
100
+ } else {
101
+ const { overwrite } = await inquirer.prompt([
102
+ {
103
+ type: 'confirm',
104
+ name: 'overwrite',
105
+ message: `File ${file} exists. Overwrite?`,
106
+ default: false
107
+ }
108
+ ]);
109
+
110
+ if (!overwrite) {
111
+ console.log(chalk.yellow(`⚠️ Skipping ${file}`));
112
+ continue;
113
+ }
91
114
  }
92
115
  }
93
116
 
@@ -157,4 +180,4 @@ if (require.main === module) {
157
180
  main().catch(console.error);
158
181
  }
159
182
 
160
- module.exports = { checkRequirements, installRouter, setupConfig };
183
+ module.exports = { checkRequirements, installRouter, setupConfig };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@halilertekin/claude-code-router-config",
3
- "version": "1.3.7",
3
+ "version": "1.3.9",
4
4
  "description": "Multi-provider configuration for Claude Code Router with intent-based routing, advanced CLI tools, analytics, and smart routing. Setup OpenAI, Anthropic, Gemini, Qwen, GLM, OpenRouter, and GitHub Copilot with intelligent routing.",
5
5
  "main": "install.js",
6
6
  "bin": {
@@ -74,7 +74,7 @@
74
74
  "license": "MIT",
75
75
  "repository": {
76
76
  "type": "git",
77
- "url": "https://github.com/halilertekin/CC-RouterMultiProvider.git"
77
+ "url": "git+https://github.com/halilertekin/CC-RouterMultiProvider.git"
78
78
  },
79
79
  "bugs": {
80
80
  "url": "https://github.com/halilertekin/CC-RouterMultiProvider/issues"