claudegate 1.0.0

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.
Files changed (89) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +166 -0
  3. package/bin/cc.js +3 -0
  4. package/bin/claudegate.js +3 -0
  5. package/dist/index.d.ts +3 -0
  6. package/dist/index.d.ts.map +1 -0
  7. package/dist/index.js +76 -0
  8. package/dist/index.js.map +1 -0
  9. package/dist/providers/index.d.ts +2 -0
  10. package/dist/providers/index.d.ts.map +1 -0
  11. package/dist/providers/index.js +2 -0
  12. package/dist/providers/index.js.map +1 -0
  13. package/dist/providers/registry.d.ts +10 -0
  14. package/dist/providers/registry.d.ts.map +1 -0
  15. package/dist/providers/registry.js +306 -0
  16. package/dist/providers/registry.js.map +1 -0
  17. package/dist/services/config.service.d.ts +11 -0
  18. package/dist/services/config.service.d.ts.map +1 -0
  19. package/dist/services/config.service.js +33 -0
  20. package/dist/services/config.service.js.map +1 -0
  21. package/dist/services/env-builder.service.d.ts +31 -0
  22. package/dist/services/env-builder.service.d.ts.map +1 -0
  23. package/dist/services/env-builder.service.js +73 -0
  24. package/dist/services/env-builder.service.js.map +1 -0
  25. package/dist/services/launcher.service.d.ts +7 -0
  26. package/dist/services/launcher.service.d.ts.map +1 -0
  27. package/dist/services/launcher.service.js +37 -0
  28. package/dist/services/launcher.service.js.map +1 -0
  29. package/dist/services/model.service.d.ts +46 -0
  30. package/dist/services/model.service.d.ts.map +1 -0
  31. package/dist/services/model.service.js +164 -0
  32. package/dist/services/model.service.js.map +1 -0
  33. package/dist/services/profile.service.d.ts +38 -0
  34. package/dist/services/profile.service.d.ts.map +1 -0
  35. package/dist/services/profile.service.js +107 -0
  36. package/dist/services/profile.service.js.map +1 -0
  37. package/dist/types/config.d.ts +42 -0
  38. package/dist/types/config.d.ts.map +1 -0
  39. package/dist/types/config.js +32 -0
  40. package/dist/types/config.js.map +1 -0
  41. package/dist/types/index.d.ts +4 -0
  42. package/dist/types/index.d.ts.map +1 -0
  43. package/dist/types/index.js +4 -0
  44. package/dist/types/index.js.map +1 -0
  45. package/dist/types/profile.d.ts +29 -0
  46. package/dist/types/profile.d.ts.map +1 -0
  47. package/dist/types/profile.js +2 -0
  48. package/dist/types/profile.js.map +1 -0
  49. package/dist/types/provider.d.ts +64 -0
  50. package/dist/types/provider.d.ts.map +1 -0
  51. package/dist/types/provider.js +24 -0
  52. package/dist/types/provider.js.map +1 -0
  53. package/dist/ui/add-profile.d.ts +7 -0
  54. package/dist/ui/add-profile.d.ts.map +1 -0
  55. package/dist/ui/add-profile.js +67 -0
  56. package/dist/ui/add-profile.js.map +1 -0
  57. package/dist/ui/components/banner.d.ts +5 -0
  58. package/dist/ui/components/banner.d.ts.map +1 -0
  59. package/dist/ui/components/banner.js +14 -0
  60. package/dist/ui/components/banner.js.map +1 -0
  61. package/dist/ui/components/status.d.ts +6 -0
  62. package/dist/ui/components/status.d.ts.map +1 -0
  63. package/dist/ui/components/status.js +17 -0
  64. package/dist/ui/components/status.js.map +1 -0
  65. package/dist/ui/manage-profiles.d.ts +6 -0
  66. package/dist/ui/manage-profiles.d.ts.map +1 -0
  67. package/dist/ui/manage-profiles.js +197 -0
  68. package/dist/ui/manage-profiles.js.map +1 -0
  69. package/dist/ui/model-selector.d.ts +19 -0
  70. package/dist/ui/model-selector.d.ts.map +1 -0
  71. package/dist/ui/model-selector.js +127 -0
  72. package/dist/ui/model-selector.js.map +1 -0
  73. package/dist/ui/profile-form.d.ts +10 -0
  74. package/dist/ui/profile-form.d.ts.map +1 -0
  75. package/dist/ui/profile-form.js +61 -0
  76. package/dist/ui/profile-form.js.map +1 -0
  77. package/dist/ui/profile-selector.d.ts +27 -0
  78. package/dist/ui/profile-selector.d.ts.map +1 -0
  79. package/dist/ui/profile-selector.js +129 -0
  80. package/dist/ui/profile-selector.js.map +1 -0
  81. package/dist/utils/logger.d.ts +7 -0
  82. package/dist/utils/logger.d.ts.map +1 -0
  83. package/dist/utils/logger.js +8 -0
  84. package/dist/utils/logger.js.map +1 -0
  85. package/dist/utils/paths.d.ts +10 -0
  86. package/dist/utils/paths.d.ts.map +1 -0
  87. package/dist/utils/paths.js +21 -0
  88. package/dist/utils/paths.js.map +1 -0
  89. package/package.json +109 -0
@@ -0,0 +1,127 @@
1
+ import { select, input } from '@inquirer/prompts';
2
+ import chalk from 'chalk';
3
+ import ora from 'ora';
4
+ import { getModelsForProvider, getFallbackModelsForTier, } from '../services/model.service.js';
5
+ import { showWarning } from './components/status.js';
6
+ const SKIP_VALUE = '__skip__';
7
+ const CUSTOM_VALUE = '__custom__';
8
+ /**
9
+ * Show model selection UI for all three tiers
10
+ * Each tier is optional - user can skip to use defaults
11
+ */
12
+ export async function selectModels(provider, apiKey, currentModels) {
13
+ // Fetch available models
14
+ const spinner = ora('Fetching available models...').start();
15
+ const result = await getModelsForProvider(provider, apiKey);
16
+ spinner.stop();
17
+ if (result.error) {
18
+ showWarning(result.error);
19
+ }
20
+ const models = result.models;
21
+ if (models.length === 0) {
22
+ showWarning('No models available. You can enter custom model IDs.');
23
+ }
24
+ console.log();
25
+ console.log(chalk.dim(' Select models for each tier (or skip to use defaults):'));
26
+ console.log();
27
+ // Select Haiku model
28
+ const haiku = await selectModelForTier('haiku', 'HAIKU (fast/cheap tasks)', models, getFallbackModelsForTier(provider.id, 'haiku'), currentModels?.haiku);
29
+ // Select Sonnet model
30
+ const sonnet = await selectModelForTier('sonnet', 'SONNET (balanced tasks)', models, getFallbackModelsForTier(provider.id, 'sonnet'), currentModels?.sonnet);
31
+ // Select Opus model
32
+ const opus = await selectModelForTier('opus', 'OPUS (complex reasoning)', models, getFallbackModelsForTier(provider.id, 'opus'), currentModels?.opus);
33
+ return { haiku, sonnet, opus };
34
+ }
35
+ /**
36
+ * Select a model for a specific tier
37
+ */
38
+ async function selectModelForTier(tier, tierLabel, allModels, tierFallbacks, currentModel) {
39
+ // Build choices list
40
+ const choices = [];
41
+ // Add skip option
42
+ choices.push({
43
+ name: chalk.dim('Skip (use provider default)'),
44
+ value: SKIP_VALUE,
45
+ description: currentModel
46
+ ? `Current: ${currentModel.name}`
47
+ : 'Will use provider default model',
48
+ });
49
+ // Add current model if set and not in list
50
+ if (currentModel && !allModels.find((m) => m.id === currentModel.id)) {
51
+ choices.push({
52
+ name: `${currentModel.name} (current)`,
53
+ value: currentModel.id,
54
+ });
55
+ }
56
+ // Add tier-specific fallbacks first (recommended)
57
+ const fallbackIds = new Set(tierFallbacks.map((m) => m.id));
58
+ for (const model of tierFallbacks) {
59
+ if (!choices.find((c) => c.value === model.id)) {
60
+ choices.push({
61
+ name: `${model.name} (Recommended)`,
62
+ value: model.id,
63
+ });
64
+ }
65
+ }
66
+ // Add other models from API
67
+ for (const model of allModels) {
68
+ if (!fallbackIds.has(model.id) && !choices.find((c) => c.value === model.id)) {
69
+ choices.push({
70
+ name: model.name,
71
+ value: model.id,
72
+ description: model.description,
73
+ });
74
+ }
75
+ }
76
+ // Add custom entry option
77
+ choices.push({
78
+ name: chalk.cyan('Enter custom model ID...'),
79
+ value: CUSTOM_VALUE,
80
+ });
81
+ // Limit choices to reasonable number
82
+ const maxChoices = 20;
83
+ const displayChoices = choices.length > maxChoices
84
+ ? [...choices.slice(0, maxChoices - 1), choices[choices.length - 1]]
85
+ : choices;
86
+ const selection = await select({
87
+ message: `Select model for ${tierLabel}:`,
88
+ choices: displayChoices,
89
+ });
90
+ if (selection === SKIP_VALUE) {
91
+ return undefined;
92
+ }
93
+ if (selection === CUSTOM_VALUE) {
94
+ const customId = await input({
95
+ message: 'Enter model ID:',
96
+ validate: (value) => {
97
+ if (!value.trim())
98
+ return 'Model ID is required';
99
+ return true;
100
+ },
101
+ });
102
+ return { id: customId.trim(), name: customId.trim() };
103
+ }
104
+ // Find the model name
105
+ const selectedModel = allModels.find((m) => m.id === selection);
106
+ const fallbackModel = tierFallbacks.find((m) => m.id === selection);
107
+ const name = selectedModel?.name || fallbackModel?.name || selection;
108
+ return { id: selection, name };
109
+ }
110
+ /**
111
+ * Quick model selection for a single tier (used in manage profiles)
112
+ */
113
+ export async function selectSingleModel(provider, apiKey, tier, currentModel) {
114
+ const tierLabels = {
115
+ haiku: 'HAIKU (fast/cheap tasks)',
116
+ sonnet: 'SONNET (balanced tasks)',
117
+ opus: 'OPUS (complex reasoning)',
118
+ };
119
+ const spinner = ora('Fetching available models...').start();
120
+ const result = await getModelsForProvider(provider, apiKey);
121
+ spinner.stop();
122
+ if (result.error) {
123
+ showWarning(result.error);
124
+ }
125
+ return selectModelForTier(tier, tierLabels[tier], result.models, getFallbackModelsForTier(provider.id, tier), currentModel);
126
+ }
127
+ //# sourceMappingURL=model-selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model-selector.js","sourceRoot":"","sources":["../../src/ui/model-selector.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,GAAG,MAAM,KAAK,CAAC;AACtB,OAAO,EACL,oBAAoB,EACpB,wBAAwB,GAEzB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AAWrD,MAAM,UAAU,GAAG,UAAU,CAAC;AAC9B,MAAM,YAAY,GAAG,YAAY,CAAC;AAElC;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,YAAY,CAChC,QAA4B,EAC5B,MAAc,EACd,aAA8B;IAE9B,yBAAyB;IACzB,MAAM,OAAO,GAAG,GAAG,CAAC,8BAA8B,CAAC,CAAC,KAAK,EAAE,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,CAAC,IAAI,EAAE,CAAC;IAEf,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,CAA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AAC,EAAE,KAAK,SAAS,CAAC,CAAC;IAChE,MAAM,aAAa,GAAG,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC;IACpE,MAAM,IAAI,GAAG,aAAa,EAAE,IAAI,IAAI,aAAa,EAAE,IAAI,IAAI,SAAS,CAAC;IAErE,OAAO,EAAE,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;AACjC,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CACrC,QAA4B,EAC5B,MAAc,EACd,IAAiC,EACjC,YAA4B;IAE5B,MAAM,UAAU,GAAG;QACjB,KAAK,EAAE,0BAA0B;QACjC,MAAM,EAAE,yBAAyB;QACjC,IAAI,EAAE,0BAA0B;KACjC,CAAC;IAEF,MAAM,OAAO,GAAG,GAAG,CAAC,8BAA8B,CAAC,CAAC,KAAK,EAAE,CAAC;IAC5D,MAAM,MAAM,GAAG,MAAM,oBAAoB,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;IAC5D,OAAO,CAAC,IAAI,EAAE,CAAC;IAEf,IAAI,MAAM,CAAC,KAAK,EAAE,CAAC;QACjB,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IAED,OAAO,kBAAkB,CACvB,IAAI,EACJ,UAAU,CAAC,IAAI,CAAC,EAChB,MAAM,CAAC,MAAM,EACb,wBAAwB,CAAC,QAAQ,CAAC,EAAE,EAAE,IAAI,CAAC,EAC3C,YAAY,CACb,CAAC;AACJ,CAAC"}
@@ -0,0 +1,10 @@
1
+ import type { ProviderDefinition } from '../types/index.js';
2
+ /**
3
+ * Prompt for a profile name
4
+ */
5
+ export declare function promptProfileName(defaultName?: string): Promise<string>;
6
+ /**
7
+ * Prompt for all env vars defined by a provider
8
+ */
9
+ export declare function promptEnvVars(provider: ProviderDefinition, existingVars?: Record<string, string>): Promise<Record<string, string>>;
10
+ //# sourceMappingURL=profile-form.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-form.d.ts","sourceRoot":"","sources":["../../src/ui/profile-form.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAc,MAAM,mBAAmB,CAAC;AAExE;;GAEG;AACH,wBAAsB,iBAAiB,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAU7E;AAED;;GAEG;AACH,wBAAsB,aAAa,CACjC,QAAQ,EAAE,kBAAkB,EAC5B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GACpC,OAAO,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAWjC"}
@@ -0,0 +1,61 @@
1
+ import { input, password } from '@inquirer/prompts';
2
+ /**
3
+ * Prompt for a profile name
4
+ */
5
+ export async function promptProfileName(defaultName) {
6
+ return input({
7
+ message: 'Profile name:',
8
+ default: defaultName,
9
+ validate: (value) => {
10
+ if (!value.trim())
11
+ return 'Profile name is required';
12
+ if (value.length > 50)
13
+ return 'Profile name must be 50 characters or less';
14
+ return true;
15
+ },
16
+ });
17
+ }
18
+ /**
19
+ * Prompt for all env vars defined by a provider
20
+ */
21
+ export async function promptEnvVars(provider, existingVars) {
22
+ const envVars = {};
23
+ for (const spec of provider.envVars) {
24
+ const value = await promptEnvVar(spec, existingVars?.[spec.name]);
25
+ if (value !== undefined && value !== '') {
26
+ envVars[spec.name] = value;
27
+ }
28
+ }
29
+ return envVars;
30
+ }
31
+ /**
32
+ * Prompt for a single env var
33
+ */
34
+ async function promptEnvVar(spec, existingValue) {
35
+ const defaultValue = existingValue ?? spec.default?.toString();
36
+ const requiredSuffix = spec.required ? '' : ' (optional)';
37
+ const message = `${spec.label}${requiredSuffix}:`;
38
+ if (spec.sensitive) {
39
+ return password({
40
+ message,
41
+ mask: '*',
42
+ validate: (value) => {
43
+ if (spec.required && !value.trim()) {
44
+ return `${spec.label} is required`;
45
+ }
46
+ return true;
47
+ },
48
+ });
49
+ }
50
+ return input({
51
+ message,
52
+ default: defaultValue,
53
+ validate: (value) => {
54
+ if (spec.required && !value.trim()) {
55
+ return `${spec.label} is required`;
56
+ }
57
+ return true;
58
+ },
59
+ });
60
+ }
61
+ //# sourceMappingURL=profile-form.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-form.js","sourceRoot":"","sources":["../../src/ui/profile-form.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAGpD;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,iBAAiB,CAAC,WAAoB;IAC1D,OAAO,KAAK,CAAC;QACX,OAAO,EAAE,eAAe;QACxB,OAAO,EAAE,WAAW;QACpB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;gBAAE,OAAO,0BAA0B,CAAC;YACrD,IAAI,KAAK,CAAC,MAAM,GAAG,EAAE;gBAAE,OAAO,4CAA4C,CAAC;YAC3E,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC;AAED;;GAEG;AACH,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAA4B,EAC5B,YAAqC;IAErC,MAAM,OAAO,GAA2B,EAAE,CAAC;IAE3C,KAAK,MAAM,IAAI,IAAI,QAAQ,CAAC,OAAO,EAAE,CAAC;QACpC,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,IAAI,EAAE,YAAY,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC;QAClE,IAAI,KAAK,KAAK,SAAS,IAAI,KAAK,KAAK,EAAE,EAAE,CAAC;YACxC,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC;QAC7B,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC;AAED;;GAEG;AACH,KAAK,UAAU,YAAY,CACzB,IAAgB,EAChB,aAAsB;IAEtB,MAAM,YAAY,GAAG,aAAa,IAAI,IAAI,CAAC,OAAO,EAAE,QAAQ,EAAE,CAAC;IAC/D,MAAM,cAAc,GAAG,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,aAAa,CAAC;IAC1D,MAAM,OAAO,GAAG,GAAG,IAAI,CAAC,KAAK,GAAG,cAAc,GAAG,CAAC;IAElD,IAAI,IAAI,CAAC,SAAS,EAAE,CAAC;QACnB,OAAO,QAAQ,CAAC;YACd,OAAO;YACP,IAAI,EAAE,GAAG;YACT,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;gBAClB,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;oBACnC,OAAO,GAAG,IAAI,CAAC,KAAK,cAAc,CAAC;gBACrC,CAAC;gBACD,OAAO,IAAI,CAAC;YACd,CAAC;SACF,CAAC,CAAC;IACL,CAAC;IAED,OAAO,KAAK,CAAC;QACX,OAAO;QACP,OAAO,EAAE,YAAY;QACrB,QAAQ,EAAE,CAAC,KAAK,EAAE,EAAE;YAClB,IAAI,IAAI,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,EAAE,CAAC;gBACnC,OAAO,GAAG,IAAI,CAAC,KAAK,cAAc,CAAC;YACrC,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;KACF,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,27 @@
1
+ /**
2
+ * @module Profile Selector
3
+ * @description Interactive profile selection UI component.
4
+ *
5
+ * This module provides the main user interface for selecting AI provider profiles.
6
+ * The selector is displayed every time ClaudeGate is launched and allows users to:
7
+ * - Select from existing profiles
8
+ * - Add new profiles
9
+ * - Manage (edit/delete) existing profiles
10
+ *
11
+ * The Anthropic (Default) profile is always available and uses the existing
12
+ * Claude CLI configuration without any modifications.
13
+ *
14
+ * @example
15
+ * // Show the profile selector and get user's choice
16
+ * const profile = await showProfileSelector();
17
+ * if (profile) {
18
+ * // Launch Claude with the selected profile
19
+ * }
20
+ */
21
+ import type { Profile } from '../types/index.js';
22
+ /**
23
+ * Show the profile selector
24
+ * Returns the selected profile, or null if user wants to exit
25
+ */
26
+ export declare function showProfileSelector(): Promise<Profile | null>;
27
+ //# sourceMappingURL=profile-selector.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-selector.d.ts","sourceRoot":"","sources":["../../src/ui/profile-selector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAcH,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAcjD;;;GAGG;AACH,wBAAsB,mBAAmB,IAAI,OAAO,CAAC,OAAO,GAAG,IAAI,CAAC,CAwGnE"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * @module Profile Selector
3
+ * @description Interactive profile selection UI component.
4
+ *
5
+ * This module provides the main user interface for selecting AI provider profiles.
6
+ * The selector is displayed every time ClaudeGate is launched and allows users to:
7
+ * - Select from existing profiles
8
+ * - Add new profiles
9
+ * - Manage (edit/delete) existing profiles
10
+ *
11
+ * The Anthropic (Default) profile is always available and uses the existing
12
+ * Claude CLI configuration without any modifications.
13
+ *
14
+ * @example
15
+ * // Show the profile selector and get user's choice
16
+ * const profile = await showProfileSelector();
17
+ * if (profile) {
18
+ * // Launch Claude with the selected profile
19
+ * }
20
+ */
21
+ import { select } from '@inquirer/prompts';
22
+ import chalk from 'chalk';
23
+ import { getAllProfiles, setActiveProfile, getActiveProfileId, } from '../services/profile.service.js';
24
+ import { getProviderById } from '../providers/index.js';
25
+ import { showBanner } from './components/banner.js';
26
+ import { showSuccess } from './components/status.js';
27
+ import { addProfileFlow } from './add-profile.js';
28
+ import { manageProfilesFlow } from './manage-profiles.js';
29
+ // Built-in Anthropic default profile (always available)
30
+ const ANTHROPIC_DEFAULT = {
31
+ id: '__anthropic_default__',
32
+ name: 'Anthropic (Default)',
33
+ providerId: 'anthropic',
34
+ createdAt: '',
35
+ updatedAt: '',
36
+ envVars: {},
37
+ };
38
+ /**
39
+ * Show the profile selector
40
+ * Returns the selected profile, or null if user wants to exit
41
+ */
42
+ export async function showProfileSelector() {
43
+ while (true) {
44
+ showBanner();
45
+ const profiles = getAllProfiles();
46
+ const activeProfileId = getActiveProfileId();
47
+ // Build choices
48
+ const choices = [];
49
+ // ALWAYS show Anthropic Default first
50
+ const isAnthropicActive = activeProfileId === ANTHROPIC_DEFAULT.id || !activeProfileId;
51
+ const anthropicMarker = isAnthropicActive ? chalk.green('●') : ' ';
52
+ const anthropicCurrent = isAnthropicActive ? chalk.dim(' [current]') : '';
53
+ choices.push({
54
+ name: `${anthropicMarker} ${ANTHROPIC_DEFAULT.name}${anthropicCurrent}`,
55
+ value: ANTHROPIC_DEFAULT.id,
56
+ description: 'Use your existing Claude CLI configuration',
57
+ });
58
+ // Add user-created profiles
59
+ for (const profile of profiles) {
60
+ const provider = getProviderById(profile.providerId);
61
+ const isActive = activeProfileId === profile.id;
62
+ const marker = isActive ? chalk.green('●') : ' ';
63
+ const current = isActive ? chalk.dim(' [current]') : '';
64
+ choices.push({
65
+ name: `${marker} ${profile.name} (${provider?.name ?? profile.providerId})${current}`,
66
+ value: profile.id,
67
+ description: provider?.description,
68
+ });
69
+ }
70
+ // Add separator
71
+ choices.push({
72
+ name: chalk.dim('─'.repeat(40)),
73
+ value: '__separator__',
74
+ });
75
+ // Add "Add new" and "Manage" options
76
+ choices.push({
77
+ name: chalk.cyan('+ Add new profile'),
78
+ value: '__add__',
79
+ });
80
+ if (profiles.length > 0) {
81
+ choices.push({
82
+ name: chalk.yellow('⚙ Manage profiles'),
83
+ value: '__manage__',
84
+ });
85
+ }
86
+ // Default to active profile if exists
87
+ const defaultValue = activeProfileId ?? ANTHROPIC_DEFAULT.id;
88
+ const selection = await select({
89
+ message: 'Select active profile:',
90
+ choices: choices.filter((c) => c.value !== '__separator__'),
91
+ default: defaultValue,
92
+ });
93
+ // Handle selection
94
+ if (selection === '__add__') {
95
+ const newProfile = await addProfileFlow();
96
+ if (newProfile) {
97
+ return newProfile;
98
+ }
99
+ // If add was cancelled, loop back to selector
100
+ continue;
101
+ }
102
+ if (selection === '__manage__') {
103
+ await manageProfilesFlow();
104
+ // After managing, loop back to selector
105
+ continue;
106
+ }
107
+ // User selected Anthropic Default
108
+ if (selection === ANTHROPIC_DEFAULT.id) {
109
+ if (activeProfileId !== ANTHROPIC_DEFAULT.id) {
110
+ setActiveProfile(ANTHROPIC_DEFAULT.id);
111
+ console.log();
112
+ showSuccess('Switched to: Anthropic (Default)');
113
+ }
114
+ return ANTHROPIC_DEFAULT;
115
+ }
116
+ // User selected a custom profile
117
+ const selectedProfile = profiles.find((p) => p.id === selection);
118
+ if (selectedProfile) {
119
+ // Set as active if different
120
+ if (activeProfileId !== selectedProfile.id) {
121
+ setActiveProfile(selectedProfile.id);
122
+ console.log();
123
+ showSuccess(`Switched to: ${selectedProfile.name}`);
124
+ }
125
+ return selectedProfile;
126
+ }
127
+ }
128
+ }
129
+ //# sourceMappingURL=profile-selector.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"profile-selector.js","sourceRoot":"","sources":["../../src/ui/profile-selector.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;GAmBG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,cAAc,EACd,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,WAAW,EAAE,MAAM,wBAAwB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,O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C;YAC3D,OAAO,EAAE,YAAY;SACtB,CAAC,CAAC;QAEH,mBAAmB;QACnB,IAAI,SAAS,KAAK,SAAS,EAAE,CAAC;YAC5B,MAAM,UAAU,GAAG,MAAM,cAAc,EAAE,CAAC;YAC1C,IAAI,UAAU,EAAE,CAAC;gBACf,OAAO,UAAU,CAAC;YACpB,CAAC;YACD,8CAA8C;YAC9C,SAAS;QACX,CAAC;QAED,IAAI,SAAS,KAAK,YAAY,EAAE,CAAC;YAC/B,MAAM,kBAAkB,EAAE,CAAC;YAC3B,wCAAwC;YACxC,SAAS;QACX,CAAC;QAED,kCAAkC;QAClC,IAAI,SAAS,KAAK,iBAAiB,CAAC,EAAE,EAAE,CAAC;YACvC,IAAI,eAAe,KAAK,iBAAiB,CAAC,EAAE,EAAE,CAAC;gBAC7C,gBAAgB,CAAC,iBAAiB,CAAC,EAAE,CAAC,CAAC;gBACvC,OAAO,CAAC,GAAG,EAAE,CAAC;gBACd,WAAW,CAAC,kCAAkC,CAAC,CAAC;YAClD,CAAC;YACD,OAAO,iBAAiB,CAAC;QAC3B,CAAC;QAED,iCAAiC;QACjC,MAAM,eAAe,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,KAAK,SAAS,CAAC,CAAC;QACjE,IAAI,eAAe,EAAE,CAAC;YACpB,6BAA6B;YAC7B,IAAI,eAAe,KAAK,eAAe,CAAC,EAAE,EAAE,CAAC;gBAC3C,gBAAgB,CAAC,eAAe,CAAC,EAAE,CAAC,CAAC;gBACrC,OAAO,CAAC,GAAG,EAAE,CAAC;gBACd,WAAW,CAAC,gBAAgB,eAAe,CAAC,IAAI,EAAE,CAAC,CAAC;YACtD,CAAC;YACD,OAAO,eAAe,CAAC;QACzB,CAAC;IACH,CAAC;AACH,CAAC"}
@@ -0,0 +1,7 @@
1
+ export declare const logger: {
2
+ info: (message: string) => void;
3
+ success: (message: string) => void;
4
+ warning: (message: string) => void;
5
+ error: (message: string) => void;
6
+ };
7
+ //# sourceMappingURL=logger.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,MAAM;oBACD,MAAM;uBACH,MAAM;uBACN,MAAM;qBACR,MAAM;CACxB,CAAC"}
@@ -0,0 +1,8 @@
1
+ import chalk from 'chalk';
2
+ export const logger = {
3
+ info: (message) => console.log(chalk.blue('i'), message),
4
+ success: (message) => console.log(chalk.green('✓'), message),
5
+ warning: (message) => console.log(chalk.yellow('⚠'), message),
6
+ error: (message) => console.log(chalk.red('✗'), message),
7
+ };
8
+ //# sourceMappingURL=logger.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"logger.js","sourceRoot":"","sources":["../../src/utils/logger.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,IAAI,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IAChE,OAAO,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACpE,OAAO,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;IACrE,KAAK,EAAE,CAAC,OAAe,EAAE,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,OAAO,CAAC;CACjE,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Get the ClaudeGate configuration directory
3
+ * Creates it if it doesn't exist
4
+ */
5
+ export declare function getConfigDir(): string;
6
+ /**
7
+ * Get the path to the main config file
8
+ */
9
+ export declare function getConfigPath(): string;
10
+ //# sourceMappingURL=paths.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.d.ts","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAgB,YAAY,IAAI,MAAM,CAQrC;AAED;;GAEG;AACH,wBAAgB,aAAa,IAAI,MAAM,CAEtC"}
@@ -0,0 +1,21 @@
1
+ import { homedir } from 'os';
2
+ import { join } from 'path';
3
+ import { existsSync, mkdirSync } from 'fs';
4
+ /**
5
+ * Get the ClaudeGate configuration directory
6
+ * Creates it if it doesn't exist
7
+ */
8
+ export function getConfigDir() {
9
+ const configDir = join(homedir(), '.claudegate');
10
+ if (!existsSync(configDir)) {
11
+ mkdirSync(configDir, { mode: 0o700, recursive: true });
12
+ }
13
+ return configDir;
14
+ }
15
+ /**
16
+ * Get the path to the main config file
17
+ */
18
+ export function getConfigPath() {
19
+ return join(getConfigDir(), 'config.json');
20
+ }
21
+ //# sourceMappingURL=paths.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"paths.js","sourceRoot":"","sources":["../../src/utils/paths.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,IAAI,CAAC;AAC7B,OAAO,EAAE,IAAI,EAAE,MAAM,MAAM,CAAC;AAC5B,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,IAAI,CAAC;AAE3C;;;GAGG;AACH,MAAM,UAAU,YAAY;IAC1B,MAAM,SAAS,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,aAAa,CAAC,CAAC;IAEjD,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAC3B,SAAS,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,KAAK,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IACzD,CAAC;IAED,OAAO,SAAS,CAAC;AACnB,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,aAAa;IAC3B,OAAO,IAAI,CAAC,YAAY,EAAE,EAAE,aAAa,CAAC,CAAC;AAC7C,CAAC"}
package/package.json ADDED
@@ -0,0 +1,109 @@
1
+ {
2
+ "name": "claudegate",
3
+ "version": "1.0.0",
4
+ "description": "Terminal utility to switch between AI provider configurations for Claude CLI",
5
+ "main": "dist/index.js",
6
+ "types": "dist/index.d.ts",
7
+ "type": "module",
8
+ "bin": {
9
+ "claudegate": "./bin/claudegate.js",
10
+ "cc": "./bin/cc.js"
11
+ },
12
+ "scripts": {
13
+ "build": "tsc",
14
+ "dev": "tsc --watch",
15
+ "start": "node dist/index.js",
16
+ "test": "vitest run",
17
+ "test:watch": "vitest",
18
+ "test:coverage": "vitest run --coverage",
19
+ "lint": "eslint src --ext .ts",
20
+ "lint:fix": "eslint src --ext .ts --fix",
21
+ "format": "prettier --write .",
22
+ "format:check": "prettier --check .",
23
+ "prepublishOnly": "npm run lint && npm run test && npm run build",
24
+ "prepare": "npm run build",
25
+ "semantic-release": "semantic-release"
26
+ },
27
+ "keywords": [
28
+ "claude",
29
+ "anthropic",
30
+ "ai",
31
+ "cli",
32
+ "terminal",
33
+ "provider",
34
+ "switch",
35
+ "openrouter",
36
+ "moonshot",
37
+ "zai",
38
+ "gateway",
39
+ "wrapper",
40
+ "profile",
41
+ "configuration",
42
+ "multi-provider"
43
+ ],
44
+ "author": "Your Name <your.email@example.com>",
45
+ "repository": {
46
+ "type": "git",
47
+ "url": "git+https://github.com/Naresh084/claudegate.git"
48
+ },
49
+ "bugs": {
50
+ "url": "https://github.com/Naresh084/claudegate/issues"
51
+ },
52
+ "homepage": "https://github.com/Naresh084/claudegate#readme",
53
+ "files": [
54
+ "dist",
55
+ "bin",
56
+ "LICENSE",
57
+ "README.md"
58
+ ],
59
+ "license": "MIT",
60
+ "engines": {
61
+ "node": ">=18.0.0"
62
+ },
63
+ "dependencies": {
64
+ "@inquirer/prompts": "^7.0.0",
65
+ "chalk": "^5.3.0",
66
+ "cli-table3": "^0.6.3",
67
+ "ora": "^8.0.0",
68
+ "uuid": "^10.0.0"
69
+ },
70
+ "devDependencies": {
71
+ "@commitlint/cli": "^19.0.0",
72
+ "@commitlint/config-conventional": "^19.0.0",
73
+ "@semantic-release/changelog": "^6.0.0",
74
+ "@semantic-release/git": "^10.0.0",
75
+ "@types/node": "^20.0.0",
76
+ "@types/uuid": "^10.0.0",
77
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
78
+ "@typescript-eslint/parser": "^8.0.0",
79
+ "@vitest/coverage-v8": "^2.0.0",
80
+ "eslint": "^9.0.0",
81
+ "prettier": "^3.0.0",
82
+ "semantic-release": "^24.0.0",
83
+ "typescript": "^5.4.0",
84
+ "vitest": "^2.0.0"
85
+ },
86
+ "publishConfig": {
87
+ "access": "public",
88
+ "provenance": true
89
+ },
90
+ "release": {
91
+ "branches": ["main", "master"],
92
+ "plugins": [
93
+ "@semantic-release/commit-analyzer",
94
+ "@semantic-release/release-notes-generator",
95
+ "@semantic-release/changelog",
96
+ ["@semantic-release/npm", {
97
+ "provenance": true
98
+ }],
99
+ ["@semantic-release/git", {
100
+ "assets": ["package.json", "CHANGELOG.md"],
101
+ "message": "chore(release): ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
102
+ }],
103
+ "@semantic-release/github"
104
+ ]
105
+ },
106
+ "commitlint": {
107
+ "extends": ["@commitlint/config-conventional"]
108
+ }
109
+ }