ccjk 16.0.6 → 16.0.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.
@@ -183,17 +183,17 @@ class ClaudeCodeConfigManager {
183
183
  * Apply profile settings to Claude Code runtime
184
184
  */
185
185
  static async applyProfileSettings(profile, codeTool) {
186
- const { ensureI18nInitialized, i18n } = await import('./simple-config.mjs').then(function (n) { return n.bq; });
186
+ const { ensureI18nInitialized, i18n } = await import('./simple-config.mjs').then(function (n) { return n.bp; });
187
187
  ensureI18nInitialized();
188
188
  const targetTool = codeTool ?? getActiveCodeTool();
189
189
  const settingsFile = activeSettingsFile(targetTool === "codex" || targetTool === "grok" ? "claude-code" : targetTool);
190
190
  try {
191
191
  if (!profile) {
192
- const { switchToOfficialLogin } = await import('./simple-config.mjs').then(function (n) { return n.bu; });
192
+ const { switchToOfficialLogin } = await import('./simple-config.mjs').then(function (n) { return n.bt; });
193
193
  switchToOfficialLogin(targetTool === "clavue" ? "clavue" : "claude-code");
194
194
  return;
195
195
  }
196
- const { readJsonConfig: readJsonConfig2, writeJsonConfig } = await import('./simple-config.mjs').then(function (n) { return n.bs; });
196
+ const { readJsonConfig: readJsonConfig2, writeJsonConfig } = await import('./simple-config.mjs').then(function (n) { return n.br; });
197
197
  const settings = readJsonConfig2(settingsFile) || {};
198
198
  if (!settings.env)
199
199
  settings.env = {};
@@ -206,7 +206,7 @@ class ClaudeCodeConfigManager {
206
206
  settings.env.ANTHROPIC_AUTH_TOKEN = profile.apiKey;
207
207
  delete settings.env.ANTHROPIC_API_KEY;
208
208
  } else if (profile.authType === "ccr_proxy") {
209
- const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.bv; });
209
+ const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.bu; });
210
210
  const ccrConfig = readCcrConfig();
211
211
  if (!ccrConfig) {
212
212
  throw new Error(i18n.t("ccr:ccrNotConfigured") || "CCR proxy configuration not found");
@@ -243,7 +243,7 @@ class ClaudeCodeConfigManager {
243
243
  const normalizedTool = targetTool === "clavue" ? "clavue" : "claude-code";
244
244
  normalizeClaudeFamilySettings(settings, { codeTool: normalizedTool });
245
245
  writeJsonConfig(settingsFile, settings);
246
- const { setPrimaryApiKey, addCompletedOnboarding } = await import('./simple-config.mjs').then(function (n) { return n.bt; });
246
+ const { setPrimaryApiKey, addCompletedOnboarding } = await import('./simple-config.mjs').then(function (n) { return n.bs; });
247
247
  setPrimaryApiKey(normalizedTool);
248
248
  addCompletedOnboarding(normalizedTool);
249
249
  if (shouldRestartCcr) {
@@ -604,7 +604,7 @@ class ClaudeCodeConfigManager {
604
604
  */
605
605
  static async syncCcrProfile() {
606
606
  try {
607
- const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.bv; });
607
+ const { readCcrConfig } = await import('./simple-config.mjs').then(function (n) { return n.bu; });
608
608
  const ccrConfig = readCcrConfig();
609
609
  if (!ccrConfig) {
610
610
  await this.ensureCcrProfileExists(ccrConfig);
@@ -155,7 +155,7 @@ async function handleAddProvider() {
155
155
  defaultValue: true
156
156
  });
157
157
  if (setAsDefault) {
158
- const { switchToProvider } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
158
+ const { switchToProvider } = await import('./simple-config.mjs').then(function (n) { return n.by; });
159
159
  const switched = await switchToProvider(provider.id);
160
160
  if (switched) {
161
161
  console.log(ansis.green(i18n.t("multi-config:profileSetAsDefault", { name: provider.name })));
@@ -330,7 +330,7 @@ ${i18n.t("codex:copyingProvider", { name: provider.name })}`));
330
330
  defaultValue: false
331
331
  });
332
332
  if (setAsDefault) {
333
- const { switchToProvider } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
333
+ const { switchToProvider } = await import('./simple-config.mjs').then(function (n) { return n.by; });
334
334
  const switched = await switchToProvider(copiedProvider.id);
335
335
  if (switched) {
336
336
  console.log(ansis.green(i18n.t("multi-config:profileSetAsDefault", { name: copiedProvider.name })));
@@ -40,7 +40,7 @@ async function addProviderToExisting(provider, apiKey, allowOverwrite = false) {
40
40
  }
41
41
  backupPath = backup || void 0;
42
42
  }
43
- const { updateCodexApiFields, upsertCodexProvider } = await import('./simple-config.mjs').then(function (n) { return n.by; });
43
+ const { updateCodexApiFields, upsertCodexProvider } = await import('./simple-config.mjs').then(function (n) { return n.bx; });
44
44
  if (!existingConfig) {
45
45
  updateCodexApiFields({
46
46
  model: provider.model,
@@ -100,7 +100,7 @@ async function editExistingProvider(providerId, updates) {
100
100
  ...updates.wireApi && { wireApi: updates.wireApi },
101
101
  ...updates.model && { model: updates.model }
102
102
  };
103
- const { upsertCodexProvider } = await import('./simple-config.mjs').then(function (n) { return n.by; });
103
+ const { upsertCodexProvider } = await import('./simple-config.mjs').then(function (n) { return n.bx; });
104
104
  upsertCodexProvider(providerId, updatedProvider);
105
105
  if (updates.apiKey) {
106
106
  const authEntries = {};
@@ -166,7 +166,7 @@ async function deleteProviders(providerIds) {
166
166
  if (providerIds.includes(existingConfig.modelProvider || "")) {
167
167
  newDefaultProvider = remainingProviders[0].id;
168
168
  }
169
- const { deleteCodexProvider, updateCodexApiFields } = await import('./simple-config.mjs').then(function (n) { return n.by; });
169
+ const { deleteCodexProvider, updateCodexApiFields } = await import('./simple-config.mjs').then(function (n) { return n.bx; });
170
170
  if (newDefaultProvider !== existingConfig.modelProvider) {
171
171
  updateCodexApiFields({
172
172
  modelProvider: newDefaultProvider,
@@ -155,7 +155,7 @@ class CodexUninstaller {
155
155
  warnings: []
156
156
  };
157
157
  try {
158
- const { uninstallCodeTool } = await import('./simple-config.mjs').then(function (n) { return n.bA; });
158
+ const { uninstallCodeTool } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
159
159
  const success = await uninstallCodeTool("codex");
160
160
  if (success) {
161
161
  result.removed.push("@openai/codex");
@@ -1,6 +1,6 @@
1
1
  import ansis from 'ansis';
2
2
  import inquirer from 'inquirer';
3
- import { as as i18n, aq as ensureI18nInitialized, u as SUPPORTED_LANGS, at as addNumbersToChoices, L as LANG_LABELS, aK as updateCcjkConfig, aL as changeLanguage, ar as getActiveCodeTool, aa as openSettingsJson, Z as importRecommendedPermissions, Y as importRecommendedEnv, aM as readCcjkConfig, av as promptBoolean, x as applyAiLanguageDirective, aN as configureOutputStyle, aO as isClaudeFamilyCodeTool, T as getExistingModelConfig, am as updateCustomModel, an as updateDefaultModel, aP as isWindows, ac as readMcpConfig, P as fixWindowsMcpConfig, ap as writeMcpConfig, aQ as selectMcpServices, z as backupMcpConfig, aR as getMcpServices, B as buildMcpServerConfig, a8 as mergeMcpServers, aS as isCcrInstalled, aT as installCcr, aU as setupCcrConfiguration, R as getExistingApiConfig, ab as promptApiConfigurationAction, aV as modifyApiConfigPartially, au as validateApiKey, G as configureApi, aW as formatApiKeyDisplay, ak as switchToOfficialLogin } from './simple-config.mjs';
3
+ import { as as i18n, aq as ensureI18nInitialized, u as SUPPORTED_LANGS, at as addNumbersToChoices, L as LANG_LABELS, aK as updateCcjkConfig, aL as changeLanguage, ar as getActiveCodeTool, aa as openSettingsJson, aM as applyRecommendedPermissionTier, aN as getPermissionTierLabel, Z as importRecommendedPermissions, Y as importRecommendedEnv, aO as readCcjkConfig, av as promptBoolean, x as applyAiLanguageDirective, aP as configureOutputStyle, aQ as isClaudeFamilyCodeTool, T as getExistingModelConfig, am as updateCustomModel, an as updateDefaultModel, aR as isWindows, ac as readMcpConfig, P as fixWindowsMcpConfig, ap as writeMcpConfig, aS as selectMcpServices, z as backupMcpConfig, aT as getMcpServices, B as buildMcpServerConfig, a8 as mergeMcpServers, aU as isCcrInstalled, aV as installCcr, aW as setupCcrConfiguration, R as getExistingApiConfig, ab as promptApiConfigurationAction, aX as modifyApiConfigPartially, au as validateApiKey, G as configureApi, aY as formatApiKeyDisplay, ak as switchToOfficialLogin } from './simple-config.mjs';
4
4
  import { g as getClaudeFamilyRuntimeLabel } from '../shared/ccjk.BSLlI-JL.mjs';
5
5
  import 'node:fs';
6
6
  import 'node:process';
@@ -361,7 +361,7 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existi
361
361
  return;
362
362
  }
363
363
  }
364
- const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.bw; });
364
+ const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.bv; });
365
365
  const aiOutputLang = await selectAiOutputLanguage();
366
366
  applyAiLanguageDirective(aiOutputLang, memoryTool);
367
367
  updateCcjkConfig({ aiOutputLang });
@@ -394,7 +394,7 @@ async function changeScriptLanguageFeature(currentLang) {
394
394
  }
395
395
  async function configureCodexDefaultModelFeature() {
396
396
  ensureI18nInitialized();
397
- const { readCodexConfig } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
397
+ const { readCodexConfig } = await import('./simple-config.mjs').then(function (n) { return n.by; });
398
398
  const existingConfig = readCodexConfig();
399
399
  const currentModel = existingConfig?.model;
400
400
  if (currentModel) {
@@ -499,7 +499,7 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existi
499
499
  return;
500
500
  }
501
501
  }
502
- const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.bw; });
502
+ const { selectAiOutputLanguage } = await import('./simple-config.mjs').then(function (n) { return n.bv; });
503
503
  const aiOutputLang = await selectAiOutputLanguage();
504
504
  await updateCodexLanguageDirective(aiOutputLang);
505
505
  updateCcjkConfig({ aiOutputLang });
@@ -507,15 +507,15 @@ ${ansis.blue(`\u2139 ${i18n.t("configuration:existingLanguageConfig") || "Existi
507
507
  } else if (option === "systemPrompt") {
508
508
  const ccjkConfig = readCcjkConfig();
509
509
  const currentLang = ccjkConfig?.aiOutputLang || "English";
510
- const { runCodexSystemPromptSelection } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
510
+ const { runCodexSystemPromptSelection } = await import('./simple-config.mjs').then(function (n) { return n.by; });
511
511
  await runCodexSystemPromptSelection();
512
512
  await ensureLanguageDirectiveInAgents(currentLang);
513
513
  console.log(ansis.green(`\u2714 ${i18n.t("configuration:systemPromptConfigured")}`));
514
514
  }
515
515
  }
516
516
  async function updateCodexModelProvider(modelProvider) {
517
- const { backupCodexConfig, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
518
- const { updateCodexApiFields } = await import('./simple-config.mjs').then(function (n) { return n.by; });
517
+ const { backupCodexConfig, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.by; });
518
+ const { updateCodexApiFields } = await import('./simple-config.mjs').then(function (n) { return n.bx; });
519
519
  const backupPath = backupCodexConfig();
520
520
  if (backupPath) {
521
521
  console.log(ansis.gray(getBackupMessage(backupPath)));
@@ -523,7 +523,7 @@ async function updateCodexModelProvider(modelProvider) {
523
523
  updateCodexApiFields({ model: modelProvider });
524
524
  }
525
525
  async function ensureLanguageDirectiveInAgents(aiOutputLang) {
526
- const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.br; });
526
+ const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.bq; });
527
527
  const { homedir } = await import('node:os');
528
528
  const { join } = await import('pathe');
529
529
  const CODEX_AGENTS_FILE = join(homedir(), ".codex", "AGENTS.md");
@@ -541,7 +541,7 @@ async function ensureLanguageDirectiveInAgents(aiOutputLang) {
541
541
  const langLabel = languageLabels[aiOutputLang] || aiOutputLang;
542
542
  const hasLanguageDirective = /\*\*Most Important:\s*Always respond in [^*]+\*\*/i.test(content);
543
543
  if (!hasLanguageDirective) {
544
- const { backupCodexAgents, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
544
+ const { backupCodexAgents, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.by; });
545
545
  const backupPath = backupCodexAgents();
546
546
  if (backupPath) {
547
547
  console.log(ansis.gray(getBackupMessage(backupPath)));
@@ -558,8 +558,8 @@ async function ensureLanguageDirectiveInAgents(aiOutputLang) {
558
558
  }
559
559
  }
560
560
  async function updateCodexLanguageDirective(aiOutputLang) {
561
- const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.br; });
562
- const { backupCodexAgents, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.bz; });
561
+ const { readFile, writeFile, exists } = await import('./simple-config.mjs').then(function (n) { return n.bq; });
562
+ const { backupCodexAgents, getBackupMessage } = await import('./simple-config.mjs').then(function (n) { return n.by; });
563
563
  const { homedir } = await import('node:os');
564
564
  const { join } = await import('pathe');
565
565
  const CODEX_AGENTS_FILE = join(homedir(), ".codex", "AGENTS.md");
@@ -604,10 +604,22 @@ async function configureEnvPermissionFeature() {
604
604
  value: "env"
605
605
  },
606
606
  {
607
- name: `${i18n.t("configuration:importRecommendedPermissions") || "Import permissions"} ${ansis.gray(
608
- `- ${i18n.t("configuration:importRecommendedPermissionsDesc") || "Import permission settings"}`
607
+ name: `${i18n.t("configuration:permissionTierSafe") || "Safe permissions"} ${ansis.gray(
608
+ `- ${i18n.t("configuration:permissionTierSafeDesc") || "Read-only tools only"}`
609
609
  )}`,
610
- value: "permissions"
610
+ value: "permission-safe"
611
+ },
612
+ {
613
+ name: `${i18n.t("configuration:permissionTierStandard") || "Standard permissions"} ${ansis.gray(
614
+ `- ${i18n.t("configuration:permissionTierStandardDesc") || "Daily development without noisy prompts"}`
615
+ )}`,
616
+ value: "permission-standard"
617
+ },
618
+ {
619
+ name: `${i18n.t("configuration:permissionTierYolo") || "YOLO permissions"} ${ansis.gray(
620
+ `- ${i18n.t("configuration:permissionTierYoloDesc") || "Bypass prompts for trusted projects"}`
621
+ )}`,
622
+ value: "permission-yolo"
611
623
  },
612
624
  {
613
625
  name: `${i18n.t("configuration:openSettingsJson") || "Open settings"} ${ansis.gray(
@@ -631,6 +643,14 @@ async function configureEnvPermissionFeature() {
631
643
  await importRecommendedPermissions(settingsTool);
632
644
  console.log(ansis.green(`\u2705 ${i18n.t("configuration:permissionsImportSuccess") || "Permissions imported"}`));
633
645
  break;
646
+ case "permission-safe":
647
+ case "permission-standard":
648
+ case "permission-yolo": {
649
+ const tier = choice.replace("permission-", "");
650
+ await applyRecommendedPermissionTier(tier, settingsTool);
651
+ console.log(ansis.green(`\u2705 ${i18n.t("configuration:permissionTierApplied", { tier: getPermissionTierLabel(tier) }) || `Permission tier applied: ${tier}`}`));
652
+ break;
653
+ }
634
654
  case "open":
635
655
  console.log(ansis.cyan(i18n.t("configuration:openingSettingsJson") || "Opening settings.json..."));
636
656
  await openSettingsJson(settingsTool);
@@ -18,7 +18,7 @@ import i18next from 'i18next';
18
18
  import Backend from 'i18next-fs-backend';
19
19
  import { edit, stringify, parse, initSync } from '@rainbowatcher/toml-edit-js';
20
20
 
21
- const version = "16.0.6";
21
+ const version = "16.0.7";
22
22
  const homepage = "https://github.com/miounet11/ccjk#readme";
23
23
 
24
24
  const i18n = i18next.createInstance();
@@ -1853,21 +1853,143 @@ const claudeConfig = {
1853
1853
  writeMcpConfig: writeMcpConfig
1854
1854
  };
1855
1855
 
1856
- const TRUSTED_OPERATOR_ASK_RULES = [
1857
- "Bash(git push:*)",
1858
- "Bash(rm:*)",
1859
- "Bash(rm -rf:*)",
1860
- "Bash(git push --force:*)",
1861
- "Bash(git reset --hard:*)",
1862
- "Bash(npm publish:*)",
1863
- "Bash(npm login:*)",
1864
- "Bash(docker:*)",
1865
- "Bash(kubectl:*)",
1866
- "Bash(terraform apply:*)",
1867
- "Bash(gh release:*)",
1868
- "Bash(git tag:*)",
1869
- "Bash(gh pr merge:*)"
1856
+ const COMMON_DENY_RULES = [
1857
+ "Bash(rm -rf /)",
1858
+ "Bash(rm -rf /*)",
1859
+ "Bash(rm -rf ~)",
1860
+ "Bash(rm -rf ~/*)",
1861
+ "Bash(rm -rf $HOME)",
1862
+ "Bash(rm -rf $HOME/*)",
1863
+ "Bash(rm -rf --no-preserve-root *)",
1864
+ "Bash(git push --force *)",
1865
+ "Bash(git push -f *)",
1866
+ "Bash(git push --force-with-lease *)",
1867
+ "Bash(git push --mirror *)",
1868
+ "Bash(npm publish *)",
1869
+ "Bash(npm publish)",
1870
+ "Bash(pnpm publish *)",
1871
+ "Bash(pnpm publish)",
1872
+ "Bash(yarn publish *)",
1873
+ "Bash(yarn publish)",
1874
+ "Bash(sudo *)",
1875
+ "Bash(su *)",
1876
+ "Bash(su)",
1877
+ "Bash(curl * | sh)",
1878
+ "Bash(curl * | bash)",
1879
+ "Bash(wget * | sh)",
1880
+ "Bash(wget * | bash)"
1870
1881
  ];
1882
+ const CLAUDE_FAMILY_PERMISSION_TIERS = {
1883
+ safe: {
1884
+ id: "safe",
1885
+ name: "Safe",
1886
+ allow: ["Read", "Grep", "Glob", "LS", "WebFetch", "WebSearch"],
1887
+ deny: [...COMMON_DENY_RULES],
1888
+ defaultMode: "default",
1889
+ allowUnsandboxedCommands: false,
1890
+ trustedOperatorMode: false
1891
+ },
1892
+ standard: {
1893
+ id: "standard",
1894
+ name: "Standard",
1895
+ allow: [
1896
+ "Read",
1897
+ "Grep",
1898
+ "Glob",
1899
+ "LS",
1900
+ "WebFetch",
1901
+ "WebSearch",
1902
+ "Edit",
1903
+ "Write",
1904
+ "MultiEdit",
1905
+ "NotebookEdit",
1906
+ "NotebookRead",
1907
+ "TodoWrite",
1908
+ "Task",
1909
+ "TaskCreate",
1910
+ "TaskGet",
1911
+ "TaskList",
1912
+ "TaskOutput",
1913
+ "TaskStop",
1914
+ "TaskUpdate",
1915
+ "Skill",
1916
+ "Bash(git status *)",
1917
+ "Bash(git status)",
1918
+ "Bash(git diff *)",
1919
+ "Bash(git log *)",
1920
+ "Bash(git show *)",
1921
+ "Bash(git add *)",
1922
+ "Bash(git commit *)",
1923
+ "Bash(git fetch *)",
1924
+ "Bash(git pull *)",
1925
+ "Bash(git push *)",
1926
+ "Bash(npm *)",
1927
+ "Bash(pnpm *)",
1928
+ "Bash(yarn *)",
1929
+ "Bash(bun *)",
1930
+ "Bash(npx *)",
1931
+ "Bash(pnpx *)",
1932
+ "Bash(node *)",
1933
+ "Bash(tsx *)",
1934
+ "Bash(python *)",
1935
+ "Bash(python3 *)",
1936
+ "Bash(cargo *)",
1937
+ "Bash(go *)",
1938
+ "Bash(ls *)",
1939
+ "Bash(ls)",
1940
+ "Bash(pwd)",
1941
+ "Bash(rg *)",
1942
+ "Bash(grep *)",
1943
+ "Bash(find *)",
1944
+ "Bash(cat *)",
1945
+ "Bash(head *)",
1946
+ "Bash(tail *)",
1947
+ "Bash(jq *)",
1948
+ "Bash(curl *)",
1949
+ "Bash(open *)",
1950
+ "Bash(code *)",
1951
+ "Bash(clavue *)",
1952
+ "Bash(claude *)",
1953
+ "Bash(codex *)",
1954
+ "Bash(ccjk *)"
1955
+ ],
1956
+ deny: [...COMMON_DENY_RULES],
1957
+ defaultMode: "acceptEdits",
1958
+ allowUnsandboxedCommands: false,
1959
+ trustedOperatorMode: false
1960
+ },
1961
+ yolo: {
1962
+ id: "yolo",
1963
+ name: "YOLO",
1964
+ allow: [
1965
+ "Read",
1966
+ "Grep",
1967
+ "Glob",
1968
+ "LS",
1969
+ "WebFetch",
1970
+ "WebSearch",
1971
+ "Edit",
1972
+ "Write",
1973
+ "MultiEdit",
1974
+ "NotebookEdit",
1975
+ "NotebookRead",
1976
+ "TodoWrite",
1977
+ "Task",
1978
+ "TaskCreate",
1979
+ "TaskGet",
1980
+ "TaskList",
1981
+ "TaskOutput",
1982
+ "TaskStop",
1983
+ "TaskUpdate",
1984
+ "Skill",
1985
+ "Bash"
1986
+ ],
1987
+ deny: [...COMMON_DENY_RULES],
1988
+ defaultMode: "bypassPermissions",
1989
+ allowUnsandboxedCommands: true,
1990
+ trustedOperatorMode: true
1991
+ }
1992
+ };
1871
1993
  function hasOwn(object, key) {
1872
1994
  return Object.prototype.hasOwnProperty.call(object, key);
1873
1995
  }
@@ -1904,17 +2026,38 @@ function normalizeClaudeFamilySettings(settings, options = {}) {
1904
2026
  }
1905
2027
  return settings;
1906
2028
  }
1907
- function applyTrustedOperatorPermissions(settings) {
2029
+ function allTierAllowRules() {
2030
+ const rules = /* @__PURE__ */ new Set();
2031
+ for (const tier of Object.values(CLAUDE_FAMILY_PERMISSION_TIERS)) {
2032
+ for (const rule of tier.allow) {
2033
+ rules.add(rule);
2034
+ }
2035
+ }
2036
+ return rules;
2037
+ }
2038
+ function isLegacyPermissionRule(rule) {
2039
+ return /^Bash\(.+:\*\)$/.test(rule) || /^(Read|Grep|Glob|LS|WebFetch|WebSearch|Edit|Write|NotebookEdit|MultiEdit|NotebookRead|TodoWrite|Task|Skill)\(\*\)$/.test(rule);
2040
+ }
2041
+ function applyClaudeFamilyPermissionTier(settings, tierId, options = {}) {
1908
2042
  if (!settings || typeof settings !== "object" || Array.isArray(settings)) {
1909
2043
  return settings;
1910
2044
  }
2045
+ const tier = CLAUDE_FAMILY_PERMISSION_TIERS[tierId];
1911
2046
  const mutableSettings = settings;
1912
2047
  mutableSettings.permissions = mutableSettings.permissions && typeof mutableSettings.permissions === "object" && !Array.isArray(mutableSettings.permissions) ? mutableSettings.permissions : {};
1913
- mutableSettings.permissions.defaultMode = "bypassPermissions";
1914
- mutableSettings.permissions.trustedOperatorMode = true;
1915
- mutableSettings.permissions.ask = mergeStringArray(mutableSettings.permissions.ask, TRUSTED_OPERATOR_ASK_RULES);
2048
+ const currentAllow = stringArray(mutableSettings.permissions.allow);
2049
+ const templateRules = allTierAllowRules();
2050
+ const customAllow = options.reset ? [] : currentAllow.filter((rule) => !templateRules.has(rule) && !isLegacyPermissionRule(rule));
2051
+ mutableSettings.permissions.allow = mergeStringArray(tier.allow, customAllow);
2052
+ mutableSettings.permissions.deny = [...tier.deny];
2053
+ mutableSettings.permissions.defaultMode = tier.defaultMode;
2054
+ mutableSettings.permissions.trustedOperatorMode = tier.trustedOperatorMode;
2055
+ mutableSettings.allowUnsandboxedCommands = tier.allowUnsandboxedCommands;
1916
2056
  return settings;
1917
2057
  }
2058
+ function applyTrustedOperatorPermissions(settings) {
2059
+ return applyClaudeFamilyPermissionTier(settings, "yolo");
2060
+ }
1918
2061
 
1919
2062
  const MODEL_ENV_KEYS = [
1920
2063
  "ANTHROPIC_MODEL",
@@ -7644,6 +7787,11 @@ async function init(options = {}) {
7644
7787
  if (codeToolType === "grok") {
7645
7788
  const { configureIncrementalManagement } = await import('./claude-code-incremental-manager.mjs');
7646
7789
  await configureIncrementalManagement();
7790
+ updateCcjkConfig({
7791
+ version,
7792
+ preferredLang: i18n.language,
7793
+ codeToolType: "grok"
7794
+ });
7647
7795
  console.log(ansis.dim(`
7648
7796
  ${i18n.t("menu:menuDescriptions.grokInitHint")}
7649
7797
  `));
@@ -8420,6 +8568,14 @@ async function importRecommendedPermissions(codeTool) {
8420
8568
  applyTrustedOperatorPermissions(currentSettings);
8421
8569
  saveSettings(currentSettings, codeTool);
8422
8570
  }
8571
+ async function applyRecommendedPermissionTier(tier, codeTool, options = {}) {
8572
+ const currentSettings = loadCurrentSettings(codeTool);
8573
+ applyClaudeFamilyPermissionTier(currentSettings, tier, options);
8574
+ saveSettings(currentSettings, codeTool);
8575
+ }
8576
+ function getPermissionTierLabel(tier) {
8577
+ return CLAUDE_FAMILY_PERMISSION_TIERS[tier].name;
8578
+ }
8423
8579
  async function openSettingsJson(codeTool) {
8424
8580
  const target = resolveClaudeFamilySettingsTarget(codeTool);
8425
8581
  ensureDir(target.configDir);
@@ -8453,4 +8609,4 @@ async function openSettingsJson(codeTool) {
8453
8609
  }
8454
8610
  }
8455
8611
 
8456
- export { installClaudeCode as $, AI_OUTPUT_LANGUAGES as A, buildMcpServerConfig as B, CCJK_CONFIG_DIR as C, DEFAULT_CODE_TOOL_TYPE as D, cleanupPermissions as E, commandExists as F, configureApi as G, copyConfigFiles as H, createHomebrewSymlink as I, detectInstalledVersion as J, displayVerificationResult as K, LANG_LABELS as L, ensureApiKeyApproved as M, ensureClaudeDir as N, executeInstallMethod as O, fixWindowsMcpConfig as P, getAiOutputLanguageLabel as Q, getExistingApiConfig as R, SETTINGS_FILE as S, getExistingModelConfig as T, getInstallationStatus as U, getMcpConfigPath as V, getPlatform as W, handleInstallFailure as X, importRecommendedEnv as Y, importRecommendedPermissions as Z, init as _, API_DEFAULT_URL as a, COMETIX_COMMAND_NAME as a$, installCodex as a0, isClaudeCodeInstalled as a1, isCodeToolType as a2, isCodexInstalled as a3, isLocalClaudeCodeInstalled as a4, manageApiKeyApproval as a5, mergeAndCleanPermissions as a6, mergeConfigs as a7, mergeMcpServers as a8, mergeSettingsFile as a9, exists as aA, readJsonConfig as aB, writeTomlConfig as aC, clearModelEnv as aD, normalizeClaudeFamilySettings as aE, copyFile as aF, detectConfigManagementMode as aG, readCodexConfig as aH, backupCodexComplete as aI, writeAuthFile as aJ, updateCcjkConfig as aK, changeLanguage as aL, readCcjkConfig as aM, configureOutputStyle as aN, isClaudeFamilyCodeTool as aO, isWindows as aP, selectMcpServices as aQ, getMcpServices as aR, isCcrInstalled as aS, installCcr as aT, setupCcrConfiguration as aU, modifyApiConfigPartially as aV, formatApiKeyDisplay as aW, readCcrConfig as aX, configureCcrFeature as aY, handleExitPromptError as aZ, handleGeneralError as a_, openSettingsJson as aa, promptApiConfigurationAction as ab, readMcpConfig as ac, removeApiKeyFromRejected as ad, removeLocalClaudeCode as ae, resolveCodeToolType as af, selectInstallMethod as ag, setInstallMethod as ah, setPrimaryApiKey as ai, settingsFileForTool as aj, switchToOfficialLogin$1 as ak, uninstallCodeTool as al, updateCustomModel as am, updateDefaultModel as an, verifyInstallation as ao, writeMcpConfig as ap, ensureI18nInitialized as aq, getActiveCodeTool as ar, i18n as as, addNumbersToChoices as at, validateApiKey as au, promptBoolean as av, resolveClaudeFamilySettingsTarget as aw, ensureDir as ax, readDefaultTomlConfig as ay, createDefaultTomlConfig as az, API_ENV_KEY as b, COMETIX_COMMANDS as b0, installCometixLine as b1, checkAndUpdateTools as b2, runCodexUpdate as b3, resolveCodeType as b4, writeJsonConfig as b5, displayBanner as b6, version as b7, resolveAiOutputLanguage as b8, updatePromptOnly as b9, installer as bA, selectAndInstallWorkflows as ba, checkClaudeCodeVersionAndPrompt as bb, STARTUP_CODE_TOOL_CHOICES as bc, displayBannerWithInfo as bd, runCodexUninstall as be, manageCodexMcp as bf, configureCodexApi as bg, runCodexWorkflowImportWithLanguageSelection as bh, runCodexFullInit as bi, switchCodexProvider as bj, listCodexProviders as bk, switchToOfficialLogin as bl, switchToProvider as bm, readCcjkConfigAsync as bn, initI18n as bo, selectScriptLanguage as bp, index as bq, fsOperations as br, jsonConfig as bs, claudeConfig as bt, config$1 as bu, config as bv, prompts as bw, codexProfileV2 as bx, codexTomlUpdater as by, codex as bz, CCJK_CONFIG_FILE as c, CLAUDE_DIR as d, CLAUDE_MD_FILE as e, CLAUDE_VSC_CONFIG_FILE as f, CLAVUE_CONFIG_FILE as g, CLAVUE_DIR as h, CLAVUE_MD_FILE as i, CLAVUE_SETTINGS_FILE as j, CODEX_AGENTS_FILE as k, CODEX_AUTH_FILE as l, CODEX_CONFIG_FILE as m, CODEX_DIR as n, CODEX_PROMPTS_DIR as o, CODE_TOOL_ALIASES as p, CODE_TOOL_BANNERS as q, CODE_TOOL_TYPES as r, ClAUDE_CONFIG_FILE as s, LEGACY_CCJK_CONFIG_FILES as t, SUPPORTED_LANGS as u, activeSettingsFile as v, addCompletedOnboarding as w, applyAiLanguageDirective as x, backupExistingConfig as y, backupMcpConfig as z };
8612
+ export { installClaudeCode as $, AI_OUTPUT_LANGUAGES as A, buildMcpServerConfig as B, CCJK_CONFIG_DIR as C, DEFAULT_CODE_TOOL_TYPE as D, cleanupPermissions as E, commandExists as F, configureApi as G, copyConfigFiles as H, createHomebrewSymlink as I, detectInstalledVersion as J, displayVerificationResult as K, LANG_LABELS as L, ensureApiKeyApproved as M, ensureClaudeDir as N, executeInstallMethod as O, fixWindowsMcpConfig as P, getAiOutputLanguageLabel as Q, getExistingApiConfig as R, SETTINGS_FILE as S, getExistingModelConfig as T, getInstallationStatus as U, getMcpConfigPath as V, getPlatform as W, handleInstallFailure as X, importRecommendedEnv as Y, importRecommendedPermissions as Z, init as _, API_DEFAULT_URL as a, handleExitPromptError as a$, installCodex as a0, isClaudeCodeInstalled as a1, isCodeToolType as a2, isCodexInstalled as a3, isLocalClaudeCodeInstalled as a4, manageApiKeyApproval as a5, mergeAndCleanPermissions as a6, mergeConfigs as a7, mergeMcpServers as a8, mergeSettingsFile as a9, exists as aA, readJsonConfig as aB, writeTomlConfig as aC, clearModelEnv as aD, normalizeClaudeFamilySettings as aE, copyFile as aF, detectConfigManagementMode as aG, readCodexConfig as aH, backupCodexComplete as aI, writeAuthFile as aJ, updateCcjkConfig as aK, changeLanguage as aL, applyRecommendedPermissionTier as aM, getPermissionTierLabel as aN, readCcjkConfig as aO, configureOutputStyle as aP, isClaudeFamilyCodeTool as aQ, isWindows as aR, selectMcpServices as aS, getMcpServices as aT, isCcrInstalled as aU, installCcr as aV, setupCcrConfiguration as aW, modifyApiConfigPartially as aX, formatApiKeyDisplay as aY, readCcrConfig as aZ, configureCcrFeature as a_, openSettingsJson as aa, promptApiConfigurationAction as ab, readMcpConfig as ac, removeApiKeyFromRejected as ad, removeLocalClaudeCode as ae, resolveCodeToolType as af, selectInstallMethod as ag, setInstallMethod as ah, setPrimaryApiKey as ai, settingsFileForTool as aj, switchToOfficialLogin$1 as ak, uninstallCodeTool as al, updateCustomModel as am, updateDefaultModel as an, verifyInstallation as ao, writeMcpConfig as ap, ensureI18nInitialized as aq, getActiveCodeTool as ar, i18n as as, addNumbersToChoices as at, validateApiKey as au, promptBoolean as av, resolveClaudeFamilySettingsTarget as aw, ensureDir as ax, readDefaultTomlConfig as ay, createDefaultTomlConfig as az, API_ENV_KEY as b, handleGeneralError as b0, checkAndUpdateTools as b1, runCodexUpdate as b2, resolveCodeType as b3, writeJsonConfig as b4, displayBanner as b5, version as b6, resolveAiOutputLanguage as b7, updatePromptOnly as b8, selectAndInstallWorkflows as b9, checkClaudeCodeVersionAndPrompt as ba, STARTUP_CODE_TOOL_CHOICES as bb, displayBannerWithInfo as bc, runCodexUninstall as bd, manageCodexMcp as be, configureCodexApi as bf, runCodexWorkflowImportWithLanguageSelection as bg, runCodexFullInit as bh, switchCodexProvider as bi, listCodexProviders as bj, switchToOfficialLogin as bk, switchToProvider as bl, readCcjkConfigAsync as bm, initI18n as bn, selectScriptLanguage as bo, index as bp, fsOperations as bq, jsonConfig as br, claudeConfig as bs, config$1 as bt, config as bu, prompts as bv, codexProfileV2 as bw, codexTomlUpdater as bx, codex as by, installer as bz, CCJK_CONFIG_FILE as c, CLAUDE_DIR as d, CLAUDE_MD_FILE as e, CLAUDE_VSC_CONFIG_FILE as f, CLAVUE_CONFIG_FILE as g, CLAVUE_DIR as h, CLAVUE_MD_FILE as i, CLAVUE_SETTINGS_FILE as j, CODEX_AGENTS_FILE as k, CODEX_AUTH_FILE as l, CODEX_CONFIG_FILE as m, CODEX_DIR as n, CODEX_PROMPTS_DIR as o, CODE_TOOL_ALIASES as p, CODE_TOOL_BANNERS as q, CODE_TOOL_TYPES as r, ClAUDE_CONFIG_FILE as s, LEGACY_CCJK_CONFIG_FILES as t, SUPPORTED_LANGS as u, activeSettingsFile as v, addCompletedOnboarding as w, applyAiLanguageDirective as x, backupExistingConfig as y, backupMcpConfig as z };
package/dist/cli.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import cac from 'cac';
3
3
  import ansis from 'ansis';
4
- import { aq as ensureI18nInitialized, as as i18n, aX as readCcrConfig, aS as isCcrInstalled, aT as installCcr, aY as configureCcrFeature, av as promptBoolean, aZ as handleExitPromptError, a_ as handleGeneralError, a$ as COMETIX_COMMAND_NAME, b0 as COMETIX_COMMANDS, b1 as installCometixLine, at as addNumbersToChoices, b2 as checkAndUpdateTools, b3 as runCodexUpdate, b4 as resolveCodeType$1, aB as readJsonConfig, b5 as writeJsonConfig, c as CCJK_CONFIG_FILE, aM as readCcjkConfig, D as DEFAULT_CODE_TOOL_TYPE, a2 as isCodeToolType, b6 as displayBanner, aK as updateCcjkConfig, b7 as version, b8 as resolveAiOutputLanguage, aO as isClaudeFamilyCodeTool, b9 as updatePromptOnly, ba as selectAndInstallWorkflows, bb as checkClaudeCodeVersionAndPrompt, af as resolveCodeToolType$1, v as activeSettingsFile, C as CCJK_CONFIG_DIR, aL as changeLanguage, u as SUPPORTED_LANGS, L as LANG_LABELS, bc as STARTUP_CODE_TOOL_CHOICES, bd as displayBannerWithInfo, q as CODE_TOOL_BANNERS, _ as init, be as runCodexUninstall, bf as manageCodexMcp, bg as configureCodexApi, bh as runCodexWorkflowImportWithLanguageSelection, bi as runCodexFullInit, bj as switchCodexProvider, bk as listCodexProviders, aH as readCodexConfig, bl as switchToOfficialLogin, bm as switchToProvider, bn as readCcjkConfigAsync, bo as initI18n, bp as selectScriptLanguage } from './chunks/simple-config.mjs';
4
+ import { aq as ensureI18nInitialized, as as i18n, aZ as readCcrConfig, aU as isCcrInstalled, aV as installCcr, a_ as configureCcrFeature, av as promptBoolean, a$ as handleExitPromptError, b0 as handleGeneralError, b1 as checkAndUpdateTools, b2 as runCodexUpdate, b3 as resolveCodeType$1, aB as readJsonConfig, b4 as writeJsonConfig, c as CCJK_CONFIG_FILE, aO as readCcjkConfig, D as DEFAULT_CODE_TOOL_TYPE, a2 as isCodeToolType, at as addNumbersToChoices, b5 as displayBanner, aK as updateCcjkConfig, b6 as version, b7 as resolveAiOutputLanguage, aQ as isClaudeFamilyCodeTool, b8 as updatePromptOnly, b9 as selectAndInstallWorkflows, ba as checkClaudeCodeVersionAndPrompt, af as resolveCodeToolType$1, v as activeSettingsFile, C as CCJK_CONFIG_DIR, aL as changeLanguage, u as SUPPORTED_LANGS, L as LANG_LABELS, bb as STARTUP_CODE_TOOL_CHOICES, bc as displayBannerWithInfo, q as CODE_TOOL_BANNERS, _ as init, bd as runCodexUninstall, be as manageCodexMcp, bf as configureCodexApi, bg as runCodexWorkflowImportWithLanguageSelection, bh as runCodexFullInit, bi as switchCodexProvider, bj as listCodexProviders, aH as readCodexConfig, bk as switchToOfficialLogin, bl as switchToProvider, bm as readCcjkConfigAsync, bn as initI18n, bo as selectScriptLanguage } from './chunks/simple-config.mjs';
5
5
  import { existsSync, readFileSync, writeFileSync, mkdirSync } from 'node:fs';
6
6
  import { homedir } from 'node:os';
7
7
  import inquirer from 'inquirer';
@@ -9,13 +9,13 @@ import { join } from 'pathe';
9
9
  import { runCcrStop, runCcrStart, runCcrRestart, runCcrStatus, runCcrUi } from './chunks/commands.mjs';
10
10
  import { changeScriptLanguageFeature, configureEnvPermissionFeature, configureAiMemoryFeature, configureDefaultModelFeature, configureMcpFeature, configureApiFeature, configureCodexAiMemoryFeature, configureCodexDefaultModelFeature } from './chunks/features.mjs';
11
11
  import process$1 from 'node:process';
12
- import { x, exec as exec$1 } from 'tinyexec';
13
- import { exec, spawn, execSync, spawnSync } from 'node:child_process';
14
- import { promisify } from 'node:util';
15
12
  import { pathExists } from 'fs-extra';
13
+ import { exec, x } from 'tinyexec';
16
14
  import { m as moveToTrash } from './shared/ccjk.DGjQxTq_.mjs';
17
15
  import { g as getClaudeFamilyRuntimeLabel } from './shared/ccjk.BSLlI-JL.mjs';
16
+ import { execSync, spawnSync } from 'node:child_process';
18
17
  import { ClaudeCodeConfigManager } from './chunks/claude-code-config-manager.mjs';
18
+ import 'node:util';
19
19
  import 'dayjs';
20
20
  import 'node:url';
21
21
  import 'inquirer-toggle';
@@ -148,203 +148,6 @@ ${ansis.dim("\u2500".repeat(50))}
148
148
  }
149
149
  }
150
150
 
151
- async function executeCcusage(args = []) {
152
- try {
153
- const command = "npx";
154
- const commandArgs = ["ccusage@latest", ...args || []];
155
- console.log(ansis.cyan(i18n.t("tools:runningCcusage")));
156
- console.log(ansis.gray(`$ npx ccusage@latest ${(args || []).join(" ")}`));
157
- console.log("");
158
- await x(command, commandArgs, {
159
- nodeOptions: {
160
- stdio: "inherit"
161
- }
162
- });
163
- } catch (error) {
164
- console.error(ansis.red(i18n.t("tools:ccusageFailed")));
165
- console.error(ansis.yellow(i18n.t("tools:checkNetworkConnection")));
166
- if (process$1.env.DEBUG) {
167
- console.error(ansis.gray(i18n.t("tools:errorDetails")), error);
168
- }
169
- if (process$1.env.NODE_ENV !== "test") {
170
- process$1.exit(1);
171
- }
172
- throw error;
173
- }
174
- }
175
-
176
- const execAsync = promisify(exec);
177
- async function runCometixPrintConfig() {
178
- ensureI18nInitialized();
179
- try {
180
- console.log(ansis.blue(`${i18n.t("cometix:printingConfig")}`));
181
- const { stdout } = await execAsync(COMETIX_COMMANDS.PRINT_CONFIG);
182
- console.log(stdout);
183
- } catch (error) {
184
- if (error.message.includes(`command not found: ${COMETIX_COMMAND_NAME}`)) {
185
- console.error(ansis.red(`\u2717 ${i18n.t("cometix:commandNotFound")}`));
186
- } else {
187
- console.error(ansis.red(`\u2717 ${i18n.t("cometix:printConfigFailed")}: ${error}`));
188
- }
189
- throw error;
190
- }
191
- }
192
- async function runCometixTuiConfig() {
193
- ensureI18nInitialized();
194
- return new Promise((resolve, reject) => {
195
- console.log(ansis.blue(`${i18n.t("cometix:enteringTuiConfig")}`));
196
- const child = spawn(COMETIX_COMMAND_NAME, ["-c"], {
197
- stdio: "inherit",
198
- // This allows the TUI to interact directly with the terminal
199
- shell: true
200
- });
201
- child.on("close", (code) => {
202
- if (code === 0) {
203
- console.log(ansis.green(`\u2713 ${i18n.t("cometix:tuiConfigSuccess")}`));
204
- resolve();
205
- } else {
206
- const error = new Error(`${COMETIX_COMMAND_NAME} -c exited with code ${code}`);
207
- console.error(ansis.red(`\u2717 ${i18n.t("cometix:tuiConfigFailed")}: ${error.message}`));
208
- reject(error);
209
- }
210
- });
211
- child.on("error", (error) => {
212
- if (error.message.includes(`command not found`) || error.message.includes("ENOENT")) {
213
- console.error(ansis.red(`\u2717 ${i18n.t("cometix:commandNotFound")}`));
214
- } else {
215
- console.error(ansis.red(`\u2717 ${i18n.t("cometix:tuiConfigFailed")}: ${error.message}`));
216
- }
217
- reject(error);
218
- });
219
- });
220
- }
221
-
222
- async function showCometixMenu() {
223
- try {
224
- ensureI18nInitialized();
225
- console.log(`
226
- ${ansis.cyan("\u2550".repeat(50))}`);
227
- console.log(ansis.bold.cyan(` ${i18n.t("cometix:cometixMenuTitle")}`));
228
- console.log(`${ansis.cyan("\u2550".repeat(50))}
229
- `);
230
- console.log(` ${ansis.cyan("1.")} ${i18n.t("cometix:cometixMenuOptions.installOrUpdate")} ${ansis.gray(`- ${i18n.t("cometix:cometixMenuDescriptions.installOrUpdate")}`)}`);
231
- console.log(` ${ansis.cyan("2.")} ${i18n.t("cometix:cometixMenuOptions.printConfig")} ${ansis.gray(`- ${i18n.t("cometix:cometixMenuDescriptions.printConfig")}`)}`);
232
- console.log(` ${ansis.cyan("3.")} ${i18n.t("cometix:cometixMenuOptions.customConfig")} ${ansis.gray(`- ${i18n.t("cometix:cometixMenuDescriptions.customConfig")}`)}`);
233
- console.log(` ${ansis.yellow("0.")} ${i18n.t("cometix:cometixMenuOptions.back")}`);
234
- console.log("");
235
- const { choice } = await inquirer.prompt({
236
- type: "input",
237
- name: "choice",
238
- message: i18n.t("common:enterChoice"),
239
- validate: async (value) => {
240
- const valid = ["1", "2", "3", "0"];
241
- return valid.includes(value) || i18n.t("common:invalidChoice");
242
- }
243
- });
244
- switch (choice) {
245
- case "1":
246
- await installCometixLine();
247
- break;
248
- case "2":
249
- await runCometixPrintConfig();
250
- break;
251
- case "3":
252
- await runCometixTuiConfig();
253
- break;
254
- case "0":
255
- return false;
256
- }
257
- if (choice !== "0") {
258
- console.log(`
259
- ${ansis.dim("\u2500".repeat(50))}
260
- `);
261
- const continueInCometix = await promptBoolean({
262
- message: i18n.t("common:returnToMenu"),
263
- defaultValue: true
264
- });
265
- if (continueInCometix) {
266
- return await showCometixMenu();
267
- }
268
- }
269
- return false;
270
- } catch (error) {
271
- if (!handleExitPromptError(error)) {
272
- handleGeneralError(error);
273
- }
274
- return false;
275
- }
276
- }
277
-
278
- async function runCcusageFeature() {
279
- ensureI18nInitialized();
280
- console.log("");
281
- console.log(ansis.cyan(i18n.t("menu:menuOptions.ccusage")));
282
- console.log(ansis.gray(`${i18n.t("tools:ccusageDescription")}`));
283
- console.log("");
284
- const choices = [
285
- { name: i18n.t("tools:ccusageModes.daily"), value: "daily" },
286
- { name: i18n.t("tools:ccusageModes.monthly"), value: "monthly" },
287
- { name: i18n.t("tools:ccusageModes.session"), value: "session" },
288
- { name: i18n.t("tools:ccusageModes.blocks"), value: "blocks" },
289
- { name: i18n.t("tools:ccusageModes.custom"), value: "custom" },
290
- { name: i18n.t("common:back"), value: "back" }
291
- ];
292
- const { mode } = await inquirer.prompt({
293
- type: "list",
294
- name: "mode",
295
- message: i18n.t("tools:selectAnalysisMode"),
296
- choices: addNumbersToChoices(choices)
297
- });
298
- if (mode === "back") {
299
- return;
300
- }
301
- let args = [];
302
- if (mode === "custom") {
303
- const { customArgs } = await inquirer.prompt({
304
- type: "input",
305
- name: "customArgs",
306
- message: i18n.t("tools:enterCustomArgs"),
307
- default: ""
308
- });
309
- if (customArgs === null || customArgs === void 0 || customArgs === "") {
310
- args = [];
311
- } else {
312
- const argsString = String(customArgs).trim();
313
- if (!argsString) {
314
- args = [];
315
- } else {
316
- const argPattern = /"([^"]*)"|'([^']*)'|(\S+)/g;
317
- const matches = [];
318
- let match = argPattern.exec(argsString);
319
- while (match !== null) {
320
- const value = match[1] || match[2] || match[3];
321
- if (value) {
322
- matches.push(value);
323
- }
324
- match = argPattern.exec(argsString);
325
- }
326
- args = matches;
327
- }
328
- }
329
- } else {
330
- args = [mode];
331
- }
332
- console.log("");
333
- await executeCcusage(args);
334
- console.log("");
335
- await inquirer.prompt({
336
- type: "input",
337
- name: "continue",
338
- message: ansis.gray(i18n.t("tools:pressEnterToContinue"))
339
- });
340
- }
341
- async function runCcrMenuFeature() {
342
- await showCcrMenu();
343
- }
344
- async function runCometixMenuFeature() {
345
- await showCometixMenu();
346
- }
347
-
348
151
  class ToolUpdateScheduler {
349
152
  /**
350
153
  * Update tools based on code type
@@ -626,7 +429,7 @@ class CcjkUninstaller {
626
429
  result.removed.push(".claude-code-router/");
627
430
  }
628
431
  try {
629
- await exec$1("npm", ["uninstall", "-g", "@musistudio/claude-code-router"]);
432
+ await exec("npm", ["uninstall", "-g", "@musistudio/claude-code-router"]);
630
433
  result.removed.push("@musistudio/claude-code-router package");
631
434
  result.success = true;
632
435
  } catch (npmError) {
@@ -654,7 +457,7 @@ class CcjkUninstaller {
654
457
  warnings: []
655
458
  };
656
459
  try {
657
- await exec$1("npm", ["uninstall", "-g", "@cometix/ccline"]);
460
+ await exec("npm", ["uninstall", "-g", "@cometix/ccline"]);
658
461
  result.removed.push("@cometix/ccline package");
659
462
  result.success = true;
660
463
  } catch (error) {
@@ -688,7 +491,7 @@ class CcjkUninstaller {
688
491
  result.removed.push(".claude.json (includes MCP configuration)");
689
492
  }
690
493
  try {
691
- const { uninstallCodeTool } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bA; });
494
+ const { uninstallCodeTool } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bz; });
692
495
  const success = await uninstallCodeTool("claude-code");
693
496
  if (success) {
694
497
  result.removed.push("@anthropic-ai/claude-code");
@@ -805,7 +608,7 @@ class CcjkUninstaller {
805
608
  ];
806
609
  for (const pkg of packagesToUninstall) {
807
610
  try {
808
- await exec$1("npm", ["uninstall", "-g", pkg]);
611
+ await exec("npm", ["uninstall", "-g", pkg]);
809
612
  result.removed.push(`${pkg} package`);
810
613
  } catch (error) {
811
614
  if (error.message.includes("not found") || error.message.includes("not installed")) {
@@ -924,7 +727,7 @@ async function uninstall(options = {}) {
924
727
  }
925
728
  const uninstaller = new CcjkUninstaller(options.lang || "en");
926
729
  if (codeType === "codex") {
927
- const { runCodexUninstall } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bz; });
730
+ const { runCodexUninstall } = await import('./chunks/simple-config.mjs').then(function (n) { return n.by; });
928
731
  await runCodexUninstall();
929
732
  return;
930
733
  }
@@ -1194,7 +997,7 @@ async function update(options = {}) {
1194
997
  }
1195
998
  return;
1196
999
  }
1197
- const { resolveTemplateLanguage } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bw; });
1000
+ const { resolveTemplateLanguage } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bv; });
1198
1001
  const configLang = await resolveTemplateLanguage(
1199
1002
  options.configLang,
1200
1003
  // Command line option
@@ -1226,6 +1029,42 @@ ${i18n.t("configuration:updatingPrompts", { runtime: runtimeLabel })}
1226
1029
  }
1227
1030
  }
1228
1031
 
1032
+ const LEGACY_PROFILES_DIR = join(homedir(), ".ccjk", "profiles");
1033
+ function fromClaudeProfile(profile) {
1034
+ return {
1035
+ name: profile.name,
1036
+ baseUrl: profile.baseUrl,
1037
+ apiKey: profile.apiKey,
1038
+ model: profile.primaryModel
1039
+ };
1040
+ }
1041
+ function readLegacyJsonProfile(name) {
1042
+ const profilePath = join(LEGACY_PROFILES_DIR, `${name}.json`);
1043
+ if (!existsSync(profilePath)) {
1044
+ return null;
1045
+ }
1046
+ try {
1047
+ const data = JSON.parse(readFileSync(profilePath, "utf-8"));
1048
+ return data.name ? data : { ...data, name };
1049
+ } catch {
1050
+ return null;
1051
+ }
1052
+ }
1053
+ function readCcjkProfileByName(name) {
1054
+ const byName = ClaudeCodeConfigManager.getProfileByName(name);
1055
+ if (byName) {
1056
+ return fromClaudeProfile(byName);
1057
+ }
1058
+ const byId = ClaudeCodeConfigManager.getProfileById(name);
1059
+ if (byId) {
1060
+ return fromClaudeProfile(byId);
1061
+ }
1062
+ return readLegacyJsonProfile(name);
1063
+ }
1064
+ function listCcjkProfileNames() {
1065
+ return ClaudeCodeConfigManager.listProfiles().map((profile) => profile.name);
1066
+ }
1067
+
1229
1068
  const GROK_AUTH_FILE = join(homedir(), ".grok", "auth.json");
1230
1069
  function isGrokInstalled() {
1231
1070
  try {
@@ -1274,16 +1113,6 @@ function buildGrokHints() {
1274
1113
  return lines;
1275
1114
  }
1276
1115
 
1277
- const PROFILES_DIR$1 = join(homedir(), ".ccjk", "profiles");
1278
- function readProfile$1(name) {
1279
- const p = join(PROFILES_DIR$1, `${name}.json`);
1280
- if (!existsSync(p)) return null;
1281
- try {
1282
- return JSON.parse(readFileSync(p, "utf-8"));
1283
- } catch {
1284
- return null;
1285
- }
1286
- }
1287
1116
  async function grokCommand(profileName) {
1288
1117
  if (profileName) {
1289
1118
  await launchWithProfile$1(profileName);
@@ -1293,13 +1122,18 @@ async function grokCommand(profileName) {
1293
1122
  console.log(ansis.bold("\nGrok CLI"));
1294
1123
  console.log(` \u5B89\u88C5: ${status.installed ? ansis.green("\u662F") : ansis.gray("\u5426")} \u767B\u5F55: ${status.loggedIn ? ansis.green("\u662F") : ansis.yellow("\u5426")}`);
1295
1124
  for (const line of buildGrokHints()) console.log(line);
1296
- console.log(ansis.dim("\n ccjk grok <profile> \u2014 \u7528 ~/.ccjk/profiles \u914D\u7F6E\u542F\u52A8\n"));
1125
+ const names = listCcjkProfileNames();
1126
+ if (names.length > 0) {
1127
+ console.log(ansis.dim(`
1128
+ \u53EF\u7528 profile: ${names.join(", ")}`));
1129
+ }
1130
+ console.log(ansis.dim(" ccjk grok <profile> \u2014 \u7528 ~/.ccjk/config.toml \u4E2D\u7684 profile \u542F\u52A8\n"));
1297
1131
  }
1298
1132
  async function launchWithProfile$1(name) {
1299
- const profile = readProfile$1(name);
1133
+ const profile = readCcjkProfileByName(name);
1300
1134
  if (!profile) {
1301
1135
  console.log(ansis.red(`Profile "${name}" \u4E0D\u5B58\u5728`));
1302
- console.log(ansis.dim(" \u5148\u8FD0\u884C ccjk init \u914D\u7F6E API\uFF08\u4F1A\u81EA\u52A8\u4FDD\u5B58 profile\uFF09\n"));
1136
+ console.log(ansis.dim(" \u5148\u8FD0\u884C ccjk init -T grok \u6216\u83DC\u5355\u914D\u7F6E API\uFF08profile \u4FDD\u5B58\u5728 ~/.ccjk/config.toml\uFF09\n"));
1303
1137
  return;
1304
1138
  }
1305
1139
  const env = { ...process.env };
@@ -1496,16 +1330,6 @@ function buildReasonixHints(cwd = process.cwd()) {
1496
1330
  return lines;
1497
1331
  }
1498
1332
 
1499
- const PROFILES_DIR = join(homedir(), ".ccjk", "profiles");
1500
- function readProfile(name) {
1501
- const p = join(PROFILES_DIR, `${name}.json`);
1502
- if (!existsSync(p)) return null;
1503
- try {
1504
- return JSON.parse(readFileSync(p, "utf-8"));
1505
- } catch {
1506
- return null;
1507
- }
1508
- }
1509
1333
  async function reasonixCommand(profileName, options = {}) {
1510
1334
  if (profileName) {
1511
1335
  await launchWithProfile(profileName, options);
@@ -1514,14 +1338,19 @@ async function reasonixCommand(profileName, options = {}) {
1514
1338
  for (const line of buildReasonixHints()) {
1515
1339
  console.log(line);
1516
1340
  }
1341
+ const names = listCcjkProfileNames();
1342
+ if (names.length > 0) {
1343
+ console.log(ansis.dim(`
1344
+ \u53EF\u7528 profile: ${names.join(", ")}`));
1345
+ }
1517
1346
  console.log(ansis.dim("\n ccjk reasonix <profile> \u2014 \u6CE8\u5165 key \u5E76\u542F\u52A8\uFF08\u65E0 reasonix.toml \u65F6\u81EA\u52A8\u751F\u6210\uFF09"));
1518
1347
  console.log(ansis.dim(' ccjk reasonix <profile> --run -p "task" \u2014 \u5355\u6B21 reasonix run\n'));
1519
1348
  }
1520
1349
  async function launchWithProfile(name, options) {
1521
- const profile = readProfile(name);
1350
+ const profile = readCcjkProfileByName(name);
1522
1351
  if (!profile) {
1523
1352
  console.log(ansis.red(`Profile "${name}" \u4E0D\u5B58\u5728`));
1524
- console.log(ansis.dim(" \u5148\u8FD0\u884C ccjk init \u914D\u7F6E API\uFF0C\u6216\u786E\u8BA4 ~/.ccjk/profiles/<name>.json \u5B58\u5728\n"));
1353
+ console.log(ansis.dim(" \u5148\u8FD0\u884C ccjk init \u914D\u7F6E API\uFF08profile \u4FDD\u5B58\u5728 ~/.ccjk/config.toml\uFF09\n"));
1525
1354
  return;
1526
1355
  }
1527
1356
  if (!isReasonixInstalled()) {
@@ -1849,15 +1678,6 @@ async function handleCodeToolSwitch(current) {
1849
1678
  }
1850
1679
  function printOtherToolsSection() {
1851
1680
  console.log(` --------- ${i18n.t("menu:menuSections.otherTools")} ----------`);
1852
- console.log(
1853
- ` ${ansis.cyan("R.")} ${i18n.t("menu:menuOptions.ccrManagement")} ${ansis.gray(`- ${i18n.t("menu:menuDescriptions.ccrManagement")}`)}`
1854
- );
1855
- console.log(
1856
- ` ${ansis.cyan("U.")} ${i18n.t("menu:menuOptions.ccusage")} ${ansis.gray(`- ${i18n.t("menu:menuDescriptions.ccusage")}`)}`
1857
- );
1858
- console.log(
1859
- ` ${ansis.cyan("L.")} ${i18n.t("menu:menuOptions.cometixLine")} ${ansis.gray(`- ${i18n.t("menu:menuDescriptions.cometixLine")}`)}`
1860
- );
1861
1681
  console.log(
1862
1682
  ` ${ansis.cyan("P.")} Probe API ${ansis.gray("- HTTP \u63A2\u6D3B\u5F53\u524D\u914D\u7F6E")}`
1863
1683
  );
@@ -1926,7 +1746,7 @@ async function showClavueMenu() {
1926
1746
  name: "choice",
1927
1747
  message: i18n.t("common:enterChoice"),
1928
1748
  validate: (value) => {
1929
- const valid = ["1", "2", "3", "4", "5", "6", "7", "8", "r", "R", "u", "U", "l", "L", "p", "P", "g", "G", "x", "X", "0", "-", "+", "s", "S", "q", "Q"];
1749
+ const valid = ["1", "2", "3", "4", "5", "6", "7", "8", "p", "P", "g", "G", "x", "X", "0", "-", "+", "s", "S", "q", "Q"];
1930
1750
  return valid.includes(value) || i18n.t("common:invalidChoice");
1931
1751
  }
1932
1752
  });
@@ -1962,18 +1782,6 @@ async function showClavueMenu() {
1962
1782
  await probeCommand();
1963
1783
  printSeparator();
1964
1784
  return void 0;
1965
- case "r":
1966
- await runCcrMenuFeature();
1967
- printSeparator();
1968
- return void 0;
1969
- case "u":
1970
- await runCcusageFeature();
1971
- printSeparator();
1972
- return void 0;
1973
- case "l":
1974
- await runCometixMenuFeature();
1975
- printSeparator();
1976
- return void 0;
1977
1785
  case "g":
1978
1786
  await grokCommand();
1979
1787
  printSeparator();
@@ -2058,7 +1866,7 @@ async function showClaudeCodeMenu() {
2058
1866
  name: "choice",
2059
1867
  message: i18n.t("common:enterChoice"),
2060
1868
  validate: (value) => {
2061
- const valid = ["1", "2", "3", "4", "5", "6", "7", "r", "R", "u", "U", "l", "L", "p", "P", "g", "G", "0", "-", "+", "s", "S", "q", "Q"];
1869
+ const valid = ["1", "2", "3", "4", "5", "6", "7", "p", "P", "g", "G", "x", "X", "0", "-", "+", "s", "S", "q", "Q"];
2062
1870
  return valid.includes(value) || i18n.t("common:invalidChoice");
2063
1871
  }
2064
1872
  });
@@ -2089,18 +1897,6 @@ async function showClaudeCodeMenu() {
2089
1897
  case "7":
2090
1898
  await configureEnvPermissionFeature();
2091
1899
  break;
2092
- case "r":
2093
- await runCcrMenuFeature();
2094
- printSeparator();
2095
- return void 0;
2096
- case "u":
2097
- await runCcusageFeature();
2098
- printSeparator();
2099
- return void 0;
2100
- case "l":
2101
- await runCometixMenuFeature();
2102
- printSeparator();
2103
- return void 0;
2104
1900
  case "p":
2105
1901
  await probeCommand();
2106
1902
  printSeparator();
@@ -2174,6 +1970,7 @@ async function showCodexMenu() {
2174
1970
  ` ${ansis.cyan("6.")} ${i18n.t("menu:menuOptions.codexConfigureAiMemory")} ${ansis.gray(`- ${i18n.t("menu:menuDescriptions.codexConfigureAiMemory")}`)}`
2175
1971
  );
2176
1972
  console.log("");
1973
+ printOtherToolsSection();
2177
1974
  printCcjkSection({
2178
1975
  uninstallOption: i18n.t("menu:menuOptions.codexUninstall"),
2179
1976
  uninstallDescription: i18n.t("menu:menuDescriptions.codexUninstall"),
@@ -2185,7 +1982,7 @@ async function showCodexMenu() {
2185
1982
  name: "choice",
2186
1983
  message: i18n.t("common:enterChoice"),
2187
1984
  validate: (value) => {
2188
- const valid = ["1", "2", "3", "4", "5", "6", "0", "-", "+", "s", "S", "q", "Q"];
1985
+ const valid = ["1", "2", "3", "4", "5", "6", "p", "P", "g", "G", "x", "X", "0", "-", "+", "s", "S", "q", "Q"];
2189
1986
  return valid.includes(value) || i18n.t("common:invalidChoice");
2190
1987
  }
2191
1988
  });
@@ -2213,6 +2010,18 @@ async function showCodexMenu() {
2213
2010
  case "6":
2214
2011
  await configureCodexAiMemoryFeature();
2215
2012
  break;
2013
+ case "p":
2014
+ await probeCommand();
2015
+ printSeparator();
2016
+ return void 0;
2017
+ case "g":
2018
+ await grokCommand();
2019
+ printSeparator();
2020
+ return void 0;
2021
+ case "x":
2022
+ await reasonixCommand();
2023
+ printSeparator();
2024
+ return void 0;
2216
2025
  case "0": {
2217
2026
  const currentLang = i18n.language;
2218
2027
  await changeScriptLanguageFeature(currentLang);
@@ -2274,7 +2083,7 @@ async function showGrokMenu() {
2274
2083
  name: "choice",
2275
2084
  message: i18n.t("common:enterChoice"),
2276
2085
  validate: (value) => {
2277
- const valid = ["1", "2", "r", "R", "u", "U", "l", "L", "p", "P", "g", "G", "x", "X", "0", "-", "+", "s", "S", "q", "Q"];
2086
+ const valid = ["1", "2", "p", "P", "g", "G", "x", "X", "0", "-", "+", "s", "S", "q", "Q"];
2278
2087
  return valid.includes(value) || i18n.t("common:invalidChoice");
2279
2088
  }
2280
2089
  });
@@ -2290,18 +2099,6 @@ async function showGrokMenu() {
2290
2099
  case "2":
2291
2100
  await grokCommand();
2292
2101
  break;
2293
- case "r":
2294
- await runCcrMenuFeature();
2295
- printSeparator();
2296
- return void 0;
2297
- case "u":
2298
- await runCcusageFeature();
2299
- printSeparator();
2300
- return void 0;
2301
- case "l":
2302
- await runCometixMenuFeature();
2303
- printSeparator();
2304
- return void 0;
2305
2102
  case "p":
2306
2103
  await probeCommand();
2307
2104
  printSeparator();
@@ -2405,6 +2202,31 @@ async function ccr(options = {}) {
2405
2202
  }
2406
2203
  }
2407
2204
 
2205
+ async function executeCcusage(args = []) {
2206
+ try {
2207
+ const command = "npx";
2208
+ const commandArgs = ["ccusage@latest", ...args || []];
2209
+ console.log(ansis.cyan(i18n.t("tools:runningCcusage")));
2210
+ console.log(ansis.gray(`$ npx ccusage@latest ${(args || []).join(" ")}`));
2211
+ console.log("");
2212
+ await x(command, commandArgs, {
2213
+ nodeOptions: {
2214
+ stdio: "inherit"
2215
+ }
2216
+ });
2217
+ } catch (error) {
2218
+ console.error(ansis.red(i18n.t("tools:ccusageFailed")));
2219
+ console.error(ansis.yellow(i18n.t("tools:checkNetworkConnection")));
2220
+ if (process$1.env.DEBUG) {
2221
+ console.error(ansis.gray(i18n.t("tools:errorDetails")), error);
2222
+ }
2223
+ if (process$1.env.NODE_ENV !== "test") {
2224
+ process$1.exit(1);
2225
+ }
2226
+ throw error;
2227
+ }
2228
+ }
2229
+
2408
2230
  async function configSwitchCommand(options) {
2409
2231
  try {
2410
2232
  ensureI18nInitialized();
@@ -2459,7 +2281,7 @@ async function listCodexProvidersWithDisplay() {
2459
2281
  console.log(ansis.cyan(i18n.t("codex:currentProvider", { provider: currentProvider })));
2460
2282
  console.log();
2461
2283
  }
2462
- const { listCodexProfileFiles, codexProfileLaunchHint } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bx; });
2284
+ const { listCodexProfileFiles, codexProfileLaunchHint } = await import('./chunks/simple-config.mjs').then(function (n) { return n.bw; });
2463
2285
  const profileFiles = listCodexProfileFiles();
2464
2286
  if (profileFiles.length > 0) {
2465
2287
  console.log(ansis.bold("Codex 0.135+ profiles (.config.toml):"));
@@ -2768,7 +2590,7 @@ function customizeHelp(sections) {
2768
2590
  ` ${ansis.green("--workflows, -w")} <list> ${i18n.t("cli:help.optionDescriptions.workflows")} (${i18n.t("cli:help.defaults.prefix")} all workflows)`,
2769
2591
  ` ${ansis.green("--output-styles, -o")} <styles> ${i18n.t("cli:help.optionDescriptions.outputStyles")} (${i18n.t("cli:help.defaults.prefix")} none)`,
2770
2592
  ` ${ansis.green("--default-output-style, -d")} <style> ${i18n.t("cli:help.optionDescriptions.defaultOutputStyle")} (${i18n.t("cli:help.defaults.prefix")} none)`,
2771
- ` ${ansis.green("--code-type, -T")} <type> ${i18n.t("cli:help.optionDescriptions.codeToolType")} (claude-code, codex, cc=claude-code, cx=codex)`,
2593
+ ` ${ansis.green("--code-type, -T")} <type> ${i18n.t("cli:help.optionDescriptions.codeToolType")} (clavue, claude-code, codex, grok, cv, cc, cx, gk)`,
2772
2594
  ` ${ansis.green("--install-cometix-line, -x")} <value> ${i18n.t("cli:help.optionDescriptions.installStatuslineTool")} (${i18n.t("cli:help.defaults.prefix")} true)`
2773
2595
  ].join("\n")
2774
2596
  });
@@ -2826,7 +2648,7 @@ async function setupCommands(cli) {
2826
2648
  cli.command("", "Show interactive menu (default)").option("--lang, -l <lang>", "CCJK display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--force, -f", "Force overwrite existing configuration").option("--code-type, -T <codeType>", "Select code tool type (clavue, claude-code, codex, grok, cv, cc, cx, gk)").action(await withLanguageResolution(async (options) => {
2827
2649
  await showMainMenu({ codeType: options.codeType });
2828
2650
  }, true));
2829
- cli.command("init", "Initialize Claude Code configuration").alias("i").option("--lang, -l <lang>", "CCJK display language (zh-CN, en)").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--ai-output-lang, -a <lang>", "AI output language").option("--force, -f", "Force overwrite existing configuration").option("--skip-prompt, -s", "Skip all interactive prompts (non-interactive mode)").option("--config-action, -r <action>", `Config handling (new/backup/merge/docs-only/skip), ${i18n.t("cli:help.defaults.prefix")} backup`).option("--api-type, -t <type>", "API type (auth_token/api_key/ccr_proxy/skip)").option("--api-key, -k <key>", "API key (used for both API key and auth token types)").option("--api-url, -u <url>", "Custom API URL").option("--api-model, -M <model>", "Primary API model (e.g., claude-sonnet-4-5)").option("--api-haiku-model, -H <model>", "Default Haiku model (e.g., claude-haiku-4-5)").option("--api-sonnet-model, -S <model>", "Default Sonnet model (e.g., claude-sonnet-4-5)").option("--api-opus-model, -O <model>", "Default Opus model (e.g., claude-opus-4-5)").option("--provider, -p <provider>", "API provider preset (302ai, glm, minimax, kimi, custom)").option("--mcp-services, -m <services>", `Comma-separated MCP services to install (context7,mcp-deepwiki,Playwright,exa), "skip" to skip all, "all" for all non-key services, ${i18n.t("cli:help.defaults.prefix")} all`).option("--workflows, -w <workflows>", `Comma-separated workflows to install (sixStepsWorkflow,featPlanUx,gitWorkflow,bmadWorkflow), "skip" to skip all, "all" for all workflows, ${i18n.t("cli:help.defaults.prefix")} all`).option("--output-styles, -o <styles>", `Comma-separated output styles (linus-mode,uncle-bob-mode,dhh-mode,carmack-mode,jobs-mode,evan-you-mode,default,explanatory,learning), "skip" to skip all, "all" for zcf curated styles, ${i18n.t("cli:help.defaults.prefix")} none`).option("--default-output-style, -d <style>", `Default output style (or "none" to keep original behavior), ${i18n.t("cli:help.defaults.prefix")} none`).option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--code-type, -T <codeType>", "Select code tool type (claude-code, codex, cc, cx)").option("--install-cometix-line, -x <value>", `Install CCometixLine statusline tool (true/false), ${i18n.t("cli:help.defaults.prefix")} true`).option("--api-configs <configs>", "API configurations as JSON string for multiple profiles").option("--api-configs-file <file>", "Path to JSON file containing API configurations").action(await withLanguageResolution(async (options) => {
2651
+ cli.command("init", "Initialize Claude Code configuration").alias("i").option("--lang, -l <lang>", "CCJK display language (zh-CN, en)").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").option("--ai-output-lang, -a <lang>", "AI output language").option("--force, -f", "Force overwrite existing configuration").option("--skip-prompt, -s", "Skip all interactive prompts (non-interactive mode)").option("--config-action, -r <action>", `Config handling (new/backup/merge/docs-only/skip), ${i18n.t("cli:help.defaults.prefix")} backup`).option("--api-type, -t <type>", "API type (auth_token/api_key/ccr_proxy/skip)").option("--api-key, -k <key>", "API key (used for both API key and auth token types)").option("--api-url, -u <url>", "Custom API URL").option("--api-model, -M <model>", "Primary API model (e.g., claude-sonnet-4-5)").option("--api-haiku-model, -H <model>", "Default Haiku model (e.g., claude-haiku-4-5)").option("--api-sonnet-model, -S <model>", "Default Sonnet model (e.g., claude-sonnet-4-5)").option("--api-opus-model, -O <model>", "Default Opus model (e.g., claude-opus-4-5)").option("--provider, -p <provider>", "API provider preset (302ai, glm, minimax, kimi, custom)").option("--mcp-services, -m <services>", `Comma-separated MCP services to install (context7,mcp-deepwiki,Playwright,exa), "skip" to skip all, "all" for all non-key services, ${i18n.t("cli:help.defaults.prefix")} all`).option("--workflows, -w <workflows>", `Comma-separated workflows to install (sixStepsWorkflow,featPlanUx,gitWorkflow,bmadWorkflow), "skip" to skip all, "all" for all workflows, ${i18n.t("cli:help.defaults.prefix")} all`).option("--output-styles, -o <styles>", `Comma-separated output styles (linus-mode,uncle-bob-mode,dhh-mode,carmack-mode,jobs-mode,evan-you-mode,default,explanatory,learning), "skip" to skip all, "all" for zcf curated styles, ${i18n.t("cli:help.defaults.prefix")} none`).option("--default-output-style, -d <style>", `Default output style (or "none" to keep original behavior), ${i18n.t("cli:help.defaults.prefix")} none`).option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--code-type, -T <codeType>", "Select code tool type (clavue, claude-code, codex, grok, cv, cc, cx, gk)").option("--install-cometix-line, -x <value>", `Install CCometixLine statusline tool (true/false), ${i18n.t("cli:help.defaults.prefix")} true`).option("--api-configs <configs>", "API configurations as JSON string for multiple profiles").option("--api-configs-file <file>", "Path to JSON file containing API configurations").action(await withLanguageResolution(async (options) => {
2830
2652
  await init(options);
2831
2653
  }));
2832
2654
  cli.command("update", "Update Claude Code prompts only").alias("u").option("--lang, -l <lang>", "CCJK display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--config-lang, -c <lang>", "Configuration language (zh-CN, en)").action(await withLanguageResolution(async (options) => {
@@ -2838,14 +2660,14 @@ async function setupCommands(cli) {
2838
2660
  cli.command("ccu [...args]", "Run Claude Code usage analysis tool").option("--lang, -l <lang>", "CCJK display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").allowUnknownOptions().action(await withLanguageResolution(async (args) => {
2839
2661
  await executeCcusage(args);
2840
2662
  }));
2841
- cli.command("config-switch [target]", "Switch Codex provider or Claude Code configuration, or list available configurations").alias("cs").option("--code-type, -T <type>", "Code tool type (claude-code, codex, cc, cx)").option("--lang <lang>", "CCJK display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--list, -l", "List available configurations").action(await withLanguageResolution(async (target, options) => {
2663
+ cli.command("config-switch [target]", "Switch Codex provider or Claude Code configuration, or list available configurations").alias("cs").option("--code-type, -T <type>", "Code tool type (clavue, claude-code, codex, grok, cv, cc, cx, gk)").option("--lang <lang>", "CCJK display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--list, -l", "List available configurations").action(await withLanguageResolution(async (target, options) => {
2842
2664
  await configSwitchCommand({
2843
2665
  target,
2844
2666
  codeType: options.codeType,
2845
2667
  list: options.list
2846
2668
  });
2847
2669
  }));
2848
- cli.command("uninstall", "Remove CCJK configurations and tools").option("--lang, -l <lang>", "CCJK display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--code-type, -T <codeType>", "Select code tool type (claude-code, codex, cc, cx)").option("--mode, -m <mode>", "Uninstall mode (complete/custom/interactive), default: interactive").option("--items, -i <items>", "Comma-separated items for custom uninstall mode").action(await withLanguageResolution(async (options) => {
2670
+ cli.command("uninstall", "Remove CCJK configurations and tools").option("--lang, -l <lang>", "CCJK display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--code-type, -T <codeType>", "Select code tool type (clavue, claude-code, codex, grok, cv, cc, cx, gk)").option("--mode, -m <mode>", "Uninstall mode (complete/custom/interactive), default: interactive").option("--items, -i <items>", "Comma-separated items for custom uninstall mode").action(await withLanguageResolution(async (options) => {
2849
2671
  await uninstall(options);
2850
2672
  }));
2851
2673
  cli.command("grok [profile]", "Grok CLI status and launch with optional profile").action(await withLanguageResolution(async (profile) => {
@@ -2864,7 +2686,7 @@ async function setupCommands(cli) {
2864
2686
  cli.command("bench", "Lightweight latency benchmark (probe)").option("--json", "JSON output").action(await withLanguageResolution(async (options) => {
2865
2687
  await benchCommand({ json: options.json });
2866
2688
  }));
2867
- cli.command("check-updates", "Check and update Claude Code and CCR to latest versions").alias("check").option("--lang, -l <lang>", "CCJK display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--code-type, -T <codeType>", "Select code tool type (claude-code, codex, cc, cx)").option("--skip-prompt, -s", "Skip all interactive prompts (non-interactive mode)").action(await withLanguageResolution(async (options) => {
2689
+ cli.command("check-updates", "Check and update Claude Code and CCR to latest versions").alias("check").option("--lang, -l <lang>", "CCJK display language (zh-CN, en)").option("--all-lang, -g <lang>", "Set all language parameters to this value").option("--code-type, -T <codeType>", "Select code tool type (clavue, claude-code, codex, grok, cv, cc, cx, gk)").option("--skip-prompt, -s", "Skip all interactive prompts (non-interactive mode)").action(await withLanguageResolution(async (options) => {
2868
2690
  await checkUpdates(options);
2869
2691
  }));
2870
2692
  cli.help((sections) => customizeHelp(sections));
@@ -64,6 +64,13 @@
64
64
  "outputStyles.learning.description": "Learn-by-doing mode where Claude pauses and asks you to write small pieces of code for hands-on practice (Claude Code built-in)",
65
65
  "outputStyles.learning.name": "Learning",
66
66
  "permissionsImportSuccess": "Permissions imported",
67
+ "permissionTierSafe": "Safe mode",
68
+ "permissionTierSafeDesc": "Auto-allow read-only tools; writes and shell still ask",
69
+ "permissionTierStandard": "Standard mode",
70
+ "permissionTierStandardDesc": "Auto-allow file edits and common dev commands; block dangerous commands",
71
+ "permissionTierYolo": "YOLO mode",
72
+ "permissionTierYoloDesc": "Trusted Clavue projects: bypassPermissions plus unsandboxed commands",
73
+ "permissionTierApplied": "Permission tier applied: {{tier}}",
67
74
  "selectAtLeastOne": "Please select at least one output style",
68
75
  "selectDefaultModel": "Select default model",
69
76
  "selectDefaultOutputStyle": "Select global default output style",
@@ -1,10 +1,7 @@
1
1
  {
2
- "menuDescriptions.ccrManagement": "Configure Claude Code Router to use multiple AI models",
3
- "menuDescriptions.ccusage": "Claude Code usage analysis",
4
2
  "menuDescriptions.changeLanguage": "Change CCJK interface language",
5
- "menuDescriptions.checkUpdates": "Check and update Claude Code, CCR and CCometixLine versions",
3
+ "menuDescriptions.checkUpdates": "Check and update Claude Code versions",
6
4
  "menuDescriptions.uninstall": "Remove Claude Code configurations and tools from your system",
7
- "menuDescriptions.cometixLine": "High-performance Claude Code statusline tool with Git integration and real-time usage tracking",
8
5
  "menuDescriptions.configureAiMemory": "Configure AI output language and output styles",
9
6
  "menuDescriptions.configureApiOrCcr": "Configure API URL, authentication or CCR proxy",
10
7
  "menuDescriptions.configureEnvPermission": "Import privacy protection environment variables and system permissions",
@@ -12,12 +9,9 @@
12
9
  "menuDescriptions.configureModel": "Set default model (opus/sonnet/sonnet 1m/custom)",
13
10
  "menuDescriptions.fullInit": "Install Claude Code + Import workflow + Configure API or CCR proxy + Configure MCP services",
14
11
  "menuDescriptions.importWorkflow": "Import/update workflow-related files only",
15
- "menuOptions.ccrManagement": "CCR",
16
- "menuOptions.ccusage": "ccusage",
17
12
  "menuOptions.changeLanguage": "Select display language / 更改显示语言",
18
13
  "menuOptions.checkUpdates": "Check updates",
19
14
  "menuOptions.uninstall": "Uninstall & Remove Configurations",
20
- "menuOptions.cometixLine": "CCometixLine",
21
15
  "menuOptions.configureAiMemory": "Configure Claude global memory",
22
16
  "menuOptions.configureApiOrCcr": "Configure API / CCR proxy",
23
17
  "menuOptions.configureEnvPermission": "Import recommended environment variables and permissions",
@@ -69,7 +63,7 @@
69
63
  "menuDescriptions.clavueConfigureEnvPermission": "Import recommended Clavue env vars and permissions",
70
64
  "menuDescriptions.clavueStatus": "Probe current Clavue API configuration",
71
65
  "menuDescriptions.clavueUninstall": "Remove ~/.clavue configuration and related files",
72
- "menuDescriptions.clavueCheckUpdates": "Check and update Clavue, CCR, and CCometixLine",
66
+ "menuDescriptions.clavueCheckUpdates": "Check and update Clavue",
73
67
  "switchCodeToolPrompt": "Select code tool type",
74
68
  "codeToolSwitched": "Code tool switched to {{tool}}",
75
69
  "selectFunction": "Select function"
@@ -64,6 +64,13 @@
64
64
  "outputStyles.learning.description": "协作式的边做边学模式,暂停并要求您编写小段代码进行实践练习 (Claude Code自带)",
65
65
  "outputStyles.learning.name": "学习风格",
66
66
  "permissionsImportSuccess": "权限配置已导入",
67
+ "permissionTierSafe": "安全模式",
68
+ "permissionTierSafeDesc": "只读工具免确认,写入和命令仍需授权",
69
+ "permissionTierStandard": "日常开发模式",
70
+ "permissionTierStandardDesc": "写文件和常用开发命令免确认,危险命令仍拦截",
71
+ "permissionTierYolo": "YOLO 强力模式",
72
+ "permissionTierYoloDesc": "Clavue 可信项目放开授权,启用 bypassPermissions 和 unsandboxed",
73
+ "permissionTierApplied": "权限档位已应用:{{tier}}",
67
74
  "selectAtLeastOne": "请至少选择一个输出风格",
68
75
  "selectDefaultModel": "选择默认模型",
69
76
  "selectDefaultOutputStyle": "选择全局默认输出风格",
@@ -1,10 +1,7 @@
1
1
  {
2
- "menuDescriptions.ccrManagement": "配置 Claude Code Router 以使用多个 AI 模型",
3
- "menuDescriptions.ccusage": "Claude Code 用量分析",
4
2
  "menuDescriptions.changeLanguage": "更改 CCJK 界面语言",
5
- "menuDescriptions.checkUpdates": "检查并更新 Claude Code、CCR 和 CCometixLine 的版本",
3
+ "menuDescriptions.checkUpdates": "检查并更新 Claude Code 的版本",
6
4
  "menuDescriptions.uninstall": "从系统中删除 Claude Code 配置和工具",
7
- "menuDescriptions.cometixLine": "基于 Rust 的高性能 Claude Code 状态栏工具,集成 Git 信息和实时使用量跟踪",
8
5
  "menuDescriptions.configureAiMemory": "配置 AI 输出语言和输出风格",
9
6
  "menuDescriptions.configureApiOrCcr": "配置 API URL、认证信息或 CCR 代理",
10
7
  "menuDescriptions.configureEnvPermission": "导入隐私保护环境变量和系统权限配置",
@@ -12,12 +9,9 @@
12
9
  "menuDescriptions.configureModel": "设置默认模型(opus/sonnet/sonnet 1m/自定义)",
13
10
  "menuDescriptions.fullInit": "安装 Claude Code + 导入工作流 + 配置 API 或 CCR 代理 + 配置 MCP 服务",
14
11
  "menuDescriptions.importWorkflow": "仅导入/更新工作流相关文件",
15
- "menuOptions.ccrManagement": "CCR",
16
- "menuOptions.ccusage": "ccusage",
17
12
  "menuOptions.changeLanguage": "更改显示语言 / Select display language",
18
13
  "menuOptions.checkUpdates": "检查更新",
19
14
  "menuOptions.uninstall": "卸载和删除配置",
20
- "menuOptions.cometixLine": "CCometixLine",
21
15
  "menuOptions.configureAiMemory": "配置 Claude 全局记忆",
22
16
  "menuOptions.configureApiOrCcr": "配置 API 或 CCR 代理",
23
17
  "menuOptions.configureEnvPermission": "导入推荐环境变量和权限配置",
@@ -69,7 +63,7 @@
69
63
  "menuDescriptions.clavueConfigureEnvPermission": "导入 Clavue 推荐环境变量与权限",
70
64
  "menuDescriptions.clavueStatus": "探活当前 Clavue API 配置",
71
65
  "menuDescriptions.clavueUninstall": "删除 ~/.clavue 配置与相关文件",
72
- "menuDescriptions.clavueCheckUpdates": "检查并更新 Clavue、CCR 和 CCometixLine",
66
+ "menuDescriptions.clavueCheckUpdates": "检查并更新 Clavue",
73
67
  "switchCodeToolPrompt": "请选择代码工具类型",
74
68
  "codeToolSwitched": "已切换为 {{tool}}",
75
69
  "selectFunction": "请选择功能"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ccjk",
3
- "version": "16.0.6",
3
+ "version": "16.0.7",
4
4
  "description": "Clavue / Claude Code / Codex / Grok CLI 统一配置工具(ccjk 交互与配置方法)",
5
5
  "type": "module",
6
6
  "bin": {