ai-cc-router 0.3.0 → 0.3.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/dist/cli/cmd-start.js +13 -2
- package/package.json +1 -1
package/dist/cli/cmd-start.js
CHANGED
|
@@ -116,10 +116,19 @@ async function askRunPreferences() {
|
|
|
116
116
|
message: "Will this machine serve other devices on the network? (server mode)",
|
|
117
117
|
default: false,
|
|
118
118
|
});
|
|
119
|
+
// For local (non-server) mode, ask about auto-configuring Claude Code
|
|
120
|
+
let configureClaudeCode = true;
|
|
121
|
+
if (!serverMode) {
|
|
122
|
+
configureClaudeCode = await confirm({
|
|
123
|
+
message: "Configure Claude Code to use the proxy automatically? (recommended)",
|
|
124
|
+
default: true,
|
|
125
|
+
});
|
|
126
|
+
}
|
|
119
127
|
const prefs = {
|
|
120
128
|
mode: autoStart ? "service" : mode,
|
|
121
129
|
serverMode,
|
|
122
130
|
port: PROXY_PORT,
|
|
131
|
+
configureClaudeCode,
|
|
123
132
|
};
|
|
124
133
|
console.log(chalk.green(`\n ✓ Preferences saved. Next time 'cc-router start' will use these automatically.`));
|
|
125
134
|
console.log(chalk.gray(` Change anytime with: cc-router start --reconfigure\n`));
|
|
@@ -154,13 +163,15 @@ async function maybeSetupPassword(cfg) {
|
|
|
154
163
|
}
|
|
155
164
|
}
|
|
156
165
|
async function ensureClaudeCodeConfigured(prefs, cfg) {
|
|
166
|
+
// Skip if user opted out (server mode always skips — clients configure themselves)
|
|
167
|
+
if (prefs.configureClaudeCode === false || prefs.serverMode)
|
|
168
|
+
return;
|
|
157
169
|
try {
|
|
158
170
|
const { readClaudeProxySettings } = await import("../utils/claude-config.js");
|
|
159
171
|
const current = readClaudeProxySettings();
|
|
160
172
|
if (current.baseUrl)
|
|
161
173
|
return; // already configured
|
|
162
|
-
|
|
163
|
-
writeClaudeSettings(prefs.port, `http://${host === "0.0.0.0" ? "localhost" : host}:${prefs.port}`);
|
|
174
|
+
writeClaudeSettings(prefs.port, `http://localhost:${prefs.port}`);
|
|
164
175
|
console.log(chalk.green(" ✓ Claude Code configured to use the proxy"));
|
|
165
176
|
}
|
|
166
177
|
catch (err) {
|