cc-viewer 1.4.6 → 1.4.7
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/cli.js +7 -5
- package/dist/assets/index-BtBbkSY4.js +617 -0
- package/dist/assets/index-tbq5NdU4.css +32 -0
- package/dist/index.html +2 -2
- package/package.json +1 -1
- package/pty-manager.js +2 -2
- package/dist/assets/index-BBYFFVRD.js +0 -617
- package/dist/assets/index-BmzbjHDz.css +0 -32
package/cli.js
CHANGED
|
@@ -232,7 +232,7 @@ async function runProxyCommand(args) {
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
async function runCliMode() {
|
|
235
|
+
async function runCliMode(extraClaudeArgs = []) {
|
|
236
236
|
const nativePath = resolveNativePath();
|
|
237
237
|
if (!nativePath) {
|
|
238
238
|
console.error(t('cli.cMode.notFound'));
|
|
@@ -263,7 +263,7 @@ async function runCliMode() {
|
|
|
263
263
|
|
|
264
264
|
// 3. 启动 PTY 中的 claude
|
|
265
265
|
const { spawnClaude, killPty } = await import('./pty-manager.js');
|
|
266
|
-
await spawnClaude(proxyPort, process.cwd());
|
|
266
|
+
await spawnClaude(proxyPort, process.cwd(), extraClaudeArgs);
|
|
267
267
|
|
|
268
268
|
// 4. 自动打开浏览器
|
|
269
269
|
const url = `http://127.0.0.1:${port}`;
|
|
@@ -291,7 +291,8 @@ const args = process.argv.slice(2);
|
|
|
291
291
|
const isUninstall = args.includes('--uninstall');
|
|
292
292
|
const isHelp = args.includes('--help') || args.includes('-h') || args[0] === 'help';
|
|
293
293
|
const isVersion = args.includes('--v') || args.includes('--version') || args.includes('-v');
|
|
294
|
-
const isCliMode = args.includes('--c');
|
|
294
|
+
const isCliMode = args.includes('--c') || args.includes('-c');
|
|
295
|
+
const isDangerousMode = args.includes('-d') || args.includes('--d');
|
|
295
296
|
|
|
296
297
|
if (isHelp) {
|
|
297
298
|
console.log(t('cli.help'));
|
|
@@ -308,8 +309,9 @@ if (isVersion) {
|
|
|
308
309
|
process.exit(0);
|
|
309
310
|
}
|
|
310
311
|
|
|
311
|
-
if (isCliMode) {
|
|
312
|
-
|
|
312
|
+
if (isCliMode || isDangerousMode) {
|
|
313
|
+
const extraArgs = isDangerousMode ? ['--dangerously-skip-permissions'] : [];
|
|
314
|
+
runCliMode(extraArgs).catch(err => {
|
|
313
315
|
console.error('CLI mode error:', err);
|
|
314
316
|
process.exit(1);
|
|
315
317
|
});
|