@carjms/codexswitch 0.6.3 → 0.6.4
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.ko.md +1 -0
- package/README.md +1 -0
- package/package.json +1 -1
- package/src/cli.js +26 -9
package/README.ko.md
CHANGED
|
@@ -219,6 +219,7 @@ cxs list # 계정별 5h/week 사용량 % 확인
|
|
|
219
219
|
| `cxs model [모델명]` | `run`/`exec`에 자동 적용할 기본 모델 설정 (`default`로 초기화) |
|
|
220
220
|
| `cxs threshold [5h%] [주간%]` | 사용량이 이 퍼센트에 도달하면 다음 계정으로 전환 (기본 95, 값 하나면 둘 다) |
|
|
221
221
|
| `cxs reasoning <show\|concise\|hide>` | 실행 중 모델 추론("생각") 출력량 조절 — `hide`는 완전 숨김, `concise`는 한 줄 요약 |
|
|
222
|
+
| `cxs sandbox <read-only\|write\|write+net\|full>` | exec/chat의 파일 접근 권한 — `write`는 작업 폴더 수정, `write+net`은 ssh/curl 등 네트워크까지 허용, `full`은 샌드박스 해제 |
|
|
222
223
|
| `cxs patterns [add/remove]` | 한도 감지에 쓸 커스텀 정규식 패턴 추가/삭제 |
|
|
223
224
|
| `cxs export <파일>` | 전체 계정·설정 백업 (⚠️ 토큰 포함 — 비밀번호처럼 취급) |
|
|
224
225
|
| `cxs restore <파일>` | 백업 파일에서 계정 복원 (다른 PC 이전용) |
|
package/README.md
CHANGED
|
@@ -221,6 +221,7 @@ cxs list # per-account 5h/week usage columns
|
|
|
221
221
|
| `cxs model [name]` | Set the default model injected into `run`/`exec` (`default` to reset) |
|
|
222
222
|
| `cxs threshold [5h%] [wk%]` | Rotate to the next account when usage reaches these percents (default 95; one value sets both) |
|
|
223
223
|
| `cxs reasoning <show\|concise\|hide>` | How much model reasoning ("thinking") to print during runs — `hide` for clean output, `concise` for one-line summaries |
|
|
224
|
+
| `cxs sandbox <read-only\|write\|write+net\|full>` | File access for exec/chat — `write` edits files in cwd, `write+net` also allows ssh/curl/network, `full` disables the sandbox |
|
|
224
225
|
| `cxs patterns [add/remove]` | Custom regex patterns treated as rate-limit errors |
|
|
225
226
|
| `cxs export <file>` | Back up all accounts + settings (⚠️ contains tokens — treat like a password) |
|
|
226
227
|
| `cxs restore <file>` | Restore accounts from a backup (for moving machines) |
|
package/package.json
CHANGED
package/src/cli.js
CHANGED
|
@@ -54,7 +54,8 @@ Settings
|
|
|
54
54
|
reasoning [mode] how much model reasoning to print during runs:
|
|
55
55
|
show (codex default) | concise | hide
|
|
56
56
|
sandbox [mode] file access for exec/chat: read-only (codex default)
|
|
57
|
-
| write (edit files in cwd) |
|
|
57
|
+
| write (edit files in cwd) | write+net (also allow
|
|
58
|
+
ssh/curl/network) | full (no sandbox)
|
|
58
59
|
threshold [5h%] [wk%] rotate early when recorded usage reaches these percents
|
|
59
60
|
of the 5-hour / weekly window (default 95, one value = both)
|
|
60
61
|
cooldown [minutes] show/set rate-limit cooldown (default 60)
|
|
@@ -693,12 +694,27 @@ function injectExecFlags(rest, meta) {
|
|
|
693
694
|
a === '--full-auto' ||
|
|
694
695
|
a === '--dangerously-bypass-approvals-and-sandbox'
|
|
695
696
|
);
|
|
696
|
-
if (meta.sandbox && !hasSandbox)
|
|
697
|
+
if (meta.sandbox && !hasSandbox) {
|
|
698
|
+
if (meta.sandbox === 'workspace-write+net') {
|
|
699
|
+
// workspace-write plus outbound network (ssh, curl, npm install...)
|
|
700
|
+
args.unshift('--sandbox', 'workspace-write', '-c', 'sandbox_workspace_write.network_access=true');
|
|
701
|
+
} else {
|
|
702
|
+
args.unshift('--sandbox', meta.sandbox);
|
|
703
|
+
}
|
|
704
|
+
}
|
|
697
705
|
args.unshift(...reasoningFlags(meta, args));
|
|
698
706
|
return args;
|
|
699
707
|
}
|
|
700
708
|
|
|
701
|
-
const SANDBOX_MODES = {
|
|
709
|
+
const SANDBOX_MODES = {
|
|
710
|
+
'read-only': 'read-only',
|
|
711
|
+
write: 'workspace-write',
|
|
712
|
+
'workspace-write': 'workspace-write',
|
|
713
|
+
'write+net': 'workspace-write+net',
|
|
714
|
+
net: 'workspace-write+net',
|
|
715
|
+
full: 'danger-full-access',
|
|
716
|
+
'danger-full-access': 'danger-full-access',
|
|
717
|
+
};
|
|
702
718
|
|
|
703
719
|
// codex exec defaults to a read-only sandbox; this setting lets it write.
|
|
704
720
|
function cmdSandbox(args) {
|
|
@@ -714,14 +730,15 @@ function cmdSandbox(args) {
|
|
|
714
730
|
return;
|
|
715
731
|
}
|
|
716
732
|
const mode = SANDBOX_MODES[args[0]];
|
|
717
|
-
if (!mode) throw new Error('usage: codexswitch sandbox <read-only|write|full>');
|
|
733
|
+
if (!mode) throw new Error('usage: codexswitch sandbox <read-only|write|write+net|full>');
|
|
718
734
|
meta.sandbox = mode;
|
|
719
735
|
store.saveMeta(meta);
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
736
|
+
const messages = {
|
|
737
|
+
'workspace-write': ui.ok('sandbox set to workspace-write — codex can edit files in the working directory'),
|
|
738
|
+
'workspace-write+net': ui.ok('sandbox set to workspace-write + network — codex can also use ssh/curl/npm'),
|
|
739
|
+
'danger-full-access': ui.warn('sandbox set to danger-full-access — codex can touch anything, use with care'),
|
|
740
|
+
};
|
|
741
|
+
out(messages[mode]);
|
|
725
742
|
}
|
|
726
743
|
|
|
727
744
|
// -c overrides implementing "cxs reasoning hide|concise|show".
|