@codefe/cc-manager 0.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 cc-manager contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,154 @@
1
+ # cc-manager (ccm)
2
+
3
+ A lightweight CLI tool to configure [claude-code](https://docs.anthropic.com/en/docs/claude-code) for Bedrock/LiteLLM proxy services.
4
+
5
+ Manage API keys, switch models interactively, and check usage quota — all from a single command.
6
+
7
+ ## Install
8
+
9
+ ```bash
10
+ npm install -g @codefe/cc-manager
11
+ # or
12
+ pnpm add -g @codefe/cc-manager
13
+ ```
14
+
15
+ Requires **Node.js >= 18**.
16
+
17
+ ## Quick Start
18
+
19
+ ```bash
20
+ # 1. Configure your API key
21
+ ccm login
22
+
23
+ # 2. Pick a model
24
+ ccm model
25
+
26
+ # 3. Check your balance
27
+ ccm usage
28
+ ```
29
+
30
+ ## Commands
31
+
32
+ ### `ccm login`
33
+
34
+ Set up your API key and initialize the environment variables needed by `claude-code`.
35
+
36
+ ```
37
+ $ ccm login
38
+ ? Please enter your API Key (sk-...): ****
39
+ ✅ Configuration saved to ~/.claude/settings.json
40
+ ```
41
+
42
+ This writes the following defaults into `~/.claude/settings.json` under the `env` key (existing fields are preserved):
43
+
44
+ | Variable | Default |
45
+ | --- | --- |
46
+ | `CLAUDE_CODE_USE_BEDROCK` | `1` |
47
+ | `CLAUDE_CODE_SKIP_BEDROCK_AUTH` | `1` |
48
+ | `ANTHROPIC_MODEL` | `us.anthropic.claude-opus-4-6-v1` |
49
+ | `ANTHROPIC_AUTH_TOKEN` | *(your key)* |
50
+ | `ANTHROPIC_BEDROCK_BASE_URL` | `https://www.litellm.org/bedrock` |
51
+ | `AWS_REGION` | `us-west-2` |
52
+
53
+ ### `ccm model`
54
+
55
+ Interactively browse and select a model, grouped by vendor.
56
+
57
+ ```
58
+ $ ccm model
59
+ Current model: us.anthropic.claude-opus-4-6-v1
60
+ ? Select a model:
61
+ ── Anthropic (Claude) ──
62
+ ❯ Claude Opus 4.6 (Preview) us.anthropic.claude-opus-4-6-v1
63
+ Claude Opus 4.5 (Preview) us.anthropic.claude-opus-4-5-20251101-v1:0
64
+ Claude Sonnet 4.5 (Preview) us.anthropic.claude-sonnet-4-5-20250929-v1:0
65
+ ...
66
+ ── OpenAI (GPT) ──
67
+ GPT-5.2 (Flagship) gpt-5.2
68
+ ...
69
+ ── Google (Gemini) ──
70
+ Gemini 2.5 Pro gemini/gemini-2.5-pro
71
+ ...
72
+ ── Amazon & Others ──
73
+ Amazon Nova Pro us.amazon.nova-pro-v1:0
74
+ ...
75
+ ```
76
+
77
+ Only the `ANTHROPIC_MODEL` value in `settings.json` is updated — all other fields remain untouched.
78
+
79
+ ### `ccm usage`
80
+
81
+ Query your current API key's spending, budget, and expiration date via the LiteLLM API.
82
+
83
+ ```
84
+ $ ccm usage
85
+
86
+ Usage Summary
87
+ ─────────────────────────────
88
+ Alias: my-key
89
+ Spent: $5.02
90
+ Budget: $1000.00
91
+ Remaining: $994.98
92
+ Expires: 2025-12-31 23:59:59
93
+ ```
94
+
95
+ ## Supported Models
96
+
97
+ <details>
98
+ <summary>Full model list (24 models)</summary>
99
+
100
+ **Anthropic (Claude)**
101
+
102
+ | Display Name | Model ID |
103
+ | --- | --- |
104
+ | Claude Opus 4.6 (Preview) | `us.anthropic.claude-opus-4-6-v1` |
105
+ | Claude Opus 4.5 (Preview) | `us.anthropic.claude-opus-4-5-20251101-v1:0` |
106
+ | Claude Sonnet 4.5 (Preview) | `us.anthropic.claude-sonnet-4-5-20250929-v1:0` |
107
+ | Claude Haiku 4.5 (Preview) | `us.anthropic.claude-haiku-4-5-20251001-v1:0` |
108
+ | Claude 3.7 Sonnet | `us.anthropic.claude-3-7-sonnet-20250219-v1:0` |
109
+ | Claude 3.5 Sonnet (v2) | `us.anthropic.claude-3-5-sonnet-20241022-v2:0` |
110
+ | Claude 3.5 Sonnet (v1) | `us.anthropic.claude-3-5-sonnet-20240620-v1:0` |
111
+ | Claude 3.5 Haiku | `us.anthropic.claude-3-5-haiku-20241022-v1:0` |
112
+ | Claude 3 Opus | `us.anthropic.claude-3-opus-20240229-v1:0` |
113
+ | Claude 3 Sonnet | `us.anthropic.claude-3-sonnet-20240229-v1:0` |
114
+ | Claude 3 Haiku | `us.anthropic.claude-3-haiku-20240307-v1:0` |
115
+
116
+ **OpenAI (GPT)**
117
+
118
+ | Display Name | Model ID |
119
+ | --- | --- |
120
+ | GPT-5.2 (Flagship) | `gpt-5.2` |
121
+ | GPT-5.1 Codex Max | `gpt-5.1-codex-max` |
122
+ | GPT-5.1 Codex Mini | `gpt-5.1-codex-mini` |
123
+ | GPT-5 Pro | `gpt-5-pro` |
124
+ | GPT-5 Chat | `gpt-5-chat` |
125
+ | GPT-4o | `gpt-4o` |
126
+ | o4 Mini | `o4-mini` |
127
+
128
+ **Google (Gemini)**
129
+
130
+ | Display Name | Model ID |
131
+ | --- | --- |
132
+ | Gemini 3 Pro (Preview) | `gemini/gemini-3-pro-preview` |
133
+ | Gemini 2.5 Pro | `gemini/gemini-2.5-pro` |
134
+ | Gemini 2.0 Flash | `gemini/gemini-2.0-flash` |
135
+ | Gemini 2.0 Flash Lite | `gemini/gemini-2.0-flash-lite` |
136
+
137
+ **Amazon & Others**
138
+
139
+ | Display Name | Model ID |
140
+ | --- | --- |
141
+ | Amazon Nova Pro | `us.amazon.nova-pro-v1:0` |
142
+ | Writer Palmyra X4 | `us.writer.palmyra-x4-v1:0` |
143
+
144
+ </details>
145
+
146
+ ## How It Works
147
+
148
+ `ccm` reads and writes `~/.claude/settings.json`, the configuration file used by `claude-code`. It only modifies the `env` object within that file and preserves all other fields.
149
+
150
+ The `usage` command calls the LiteLLM `/key/info` API endpoint using the stored `ANTHROPIC_AUTH_TOKEN`.
151
+
152
+ ## License
153
+
154
+ [MIT](LICENSE)
@@ -0,0 +1 @@
1
+ export declare function loginCommand(): Promise<void>;
@@ -0,0 +1,26 @@
1
+ import { password } from "@inquirer/prompts";
2
+ import chalk from "chalk";
3
+ import { readSettings, writeSettings, SETTINGS_PATH } from "../lib/settings.js";
4
+ export async function loginCommand() {
5
+ const apiKey = await password({
6
+ message: "Please enter your API Key (sk-...):",
7
+ mask: "*",
8
+ });
9
+ if (!apiKey || apiKey.trim().length === 0) {
10
+ console.log(chalk.red("Error: API Key cannot be empty."));
11
+ process.exit(1);
12
+ }
13
+ const settings = await readSettings();
14
+ const envDefaults = {
15
+ CLAUDE_CODE_USE_BEDROCK: "1",
16
+ CLAUDE_CODE_SKIP_BEDROCK_AUTH: "1",
17
+ ANTHROPIC_MODEL: "us.anthropic.claude-opus-4-6-v1",
18
+ ANTHROPIC_AUTH_TOKEN: apiKey.trim(),
19
+ ANTHROPIC_BEDROCK_BASE_URL: "https://www.litellm.org/bedrock",
20
+ AWS_REGION: "us-west-2",
21
+ };
22
+ settings.env = { ...settings.env, ...envDefaults };
23
+ await writeSettings(settings);
24
+ console.log(chalk.green(`✅ Configuration saved to ${SETTINGS_PATH}`));
25
+ }
26
+ //# sourceMappingURL=login.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"login.js","sourceRoot":"","sources":["../../src/commands/login.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,mBAAmB,CAAC;AAC7C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAEhF,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,MAAM,GAAG,MAAM,QAAQ,CAAC;QAC5B,OAAO,EAAE,qCAAqC;QAC9C,IAAI,EAAE,GAAG;KACV,CAAC,CAAC;IAEH,IAAI,CAAC,MAAM,IAAI,MAAM,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC1C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,CAAC;QAC1D,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;IAEtC,MAAM,WAAW,GAA2B;QAC1C,uBAAuB,EAAE,GAAG;QAC5B,6BAA6B,EAAE,GAAG;QAClC,eAAe,EAAE,iCAAiC;QAClD,oBAAoB,EAAE,MAAM,CAAC,IAAI,EAAE;QACnC,0BAA0B,EAAE,iCAAiC;QAC7D,UAAU,EAAE,WAAW;KACxB,CAAC;IAEF,QAAQ,CAAC,GAAG,GAAG,EAAE,GAAG,QAAQ,CAAC,GAAG,EAAE,GAAG,WAAW,EAAE,CAAC;IAEnD,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAE9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,4BAA4B,aAAa,EAAE,CAAC,CAAC,CAAC;AACxE,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function modelCommand(): Promise<void>;
@@ -0,0 +1,24 @@
1
+ import { select } from "@inquirer/prompts";
2
+ import chalk from "chalk";
3
+ import { readSettings, writeSettings } from "../lib/settings.js";
4
+ import { MODEL_CHOICES } from "../lib/models.js";
5
+ export async function modelCommand() {
6
+ const settings = await readSettings();
7
+ if (!settings.env?.ANTHROPIC_AUTH_TOKEN) {
8
+ console.log(chalk.yellow("No API Key found. Please run `ccm login` first to configure your credentials."));
9
+ process.exit(1);
10
+ }
11
+ const currentModel = settings.env?.ANTHROPIC_MODEL;
12
+ if (currentModel) {
13
+ console.log(chalk.dim(`Current model: ${currentModel}`));
14
+ }
15
+ const chosen = await select({
16
+ message: "Select a model:",
17
+ choices: MODEL_CHOICES,
18
+ pageSize: 15,
19
+ });
20
+ settings.env.ANTHROPIC_MODEL = chosen;
21
+ await writeSettings(settings);
22
+ console.log(chalk.green(`✅ Model switched to ${chalk.bold(chosen)}`));
23
+ }
24
+ //# sourceMappingURL=model.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/commands/model.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACjE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AAEjD,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;IAEtC,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,oBAAoB,EAAE,CAAC;QACxC,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CACV,+EAA+E,CAChF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,MAAM,YAAY,GAAG,QAAQ,CAAC,GAAG,EAAE,eAAe,CAAC;IACnD,IAAI,YAAY,EAAE,CAAC;QACjB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,kBAAkB,YAAY,EAAE,CAAC,CAAC,CAAC;IAC3D,CAAC;IAED,MAAM,MAAM,GAAG,MAAM,MAAM,CAAC;QAC1B,OAAO,EAAE,iBAAiB;QAC1B,OAAO,EAAE,aAAa;QACtB,QAAQ,EAAE,EAAE;KACb,CAAC,CAAC;IAEH,QAAQ,CAAC,GAAG,CAAC,eAAe,GAAG,MAAM,CAAC;IACtC,MAAM,aAAa,CAAC,QAAQ,CAAC,CAAC;IAE9B,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,KAAK,CAAC,uBAAuB,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,CAAC;AACxE,CAAC"}
@@ -0,0 +1 @@
1
+ export declare function usageCommand(): Promise<void>;
@@ -0,0 +1,45 @@
1
+ import chalk from "chalk";
2
+ import { readSettings } from "../lib/settings.js";
3
+ export async function usageCommand() {
4
+ const settings = await readSettings();
5
+ const token = settings.env?.ANTHROPIC_AUTH_TOKEN;
6
+ if (!token) {
7
+ console.log(chalk.yellow("No API Key found. Please run `ccm login` first to configure your credentials."));
8
+ process.exit(1);
9
+ }
10
+ let data;
11
+ try {
12
+ const res = await fetch("http://www.litellm.org/key/info", {
13
+ headers: { Authorization: `Bearer ${token}` },
14
+ });
15
+ if (!res.ok) {
16
+ console.log(chalk.red(`API request failed: ${res.status} ${res.statusText}`));
17
+ process.exit(1);
18
+ }
19
+ data = await res.json();
20
+ }
21
+ catch (err) {
22
+ console.log(chalk.red(`Network error: ${err.message}`));
23
+ process.exit(1);
24
+ }
25
+ const info = data.info ?? data;
26
+ const alias = info.key_alias ?? "N/A";
27
+ const spent = Number(info.spend ?? 0);
28
+ const maxBudget = info.max_budget;
29
+ const expires = info.expires;
30
+ const budgetStr = maxBudget != null ? `$${Number(maxBudget).toFixed(2)}` : "Unlimited";
31
+ const remainingStr = maxBudget != null ? `$${(Number(maxBudget) - spent).toFixed(2)}` : "N/A";
32
+ const expiresStr = expires
33
+ ? new Date(expires).toLocaleString("sv-SE")
34
+ : "Never";
35
+ console.log("");
36
+ console.log(chalk.bold(" Usage Summary"));
37
+ console.log(chalk.dim(" ─────────────────────────────"));
38
+ console.log(` Alias: ${chalk.cyan(alias)}`);
39
+ console.log(` Spent: ${chalk.yellow(`$${spent.toFixed(2)}`)}`);
40
+ console.log(` Budget: ${chalk.green(budgetStr)}`);
41
+ console.log(` Remaining: ${chalk.green(remainingStr)}`);
42
+ console.log(` Expires: ${chalk.magenta(expiresStr)}`);
43
+ console.log("");
44
+ }
45
+ //# sourceMappingURL=usage.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"usage.js","sourceRoot":"","sources":["../../src/commands/usage.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAElD,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,MAAM,QAAQ,GAAG,MAAM,YAAY,EAAE,CAAC;IACtC,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,EAAE,oBAAoB,CAAC;IAEjD,IAAI,CAAC,KAAK,EAAE,CAAC;QACX,OAAO,CAAC,GAAG,CACT,KAAK,CAAC,MAAM,CACV,+EAA+E,CAChF,CACF,CAAC;QACF,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;IAED,IAAI,IAAS,CAAC;IACd,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,KAAK,CAAC,iCAAiC,EAAE;YACzD,OAAO,EAAE,EAAE,aAAa,EAAE,UAAU,KAAK,EAAE,EAAE;SAC9C,CAAC,CAAC;QAEH,IAAI,CAAC,GAAG,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,OAAO,CAAC;IAEZ,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;IAChB,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,iBAAiB,CAAC,CAAC,CAAC;IAC3C,OAAO,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,iCAAiC,CAAC,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC;IAClD,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,MAAM,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC;IACrE,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,KAAK,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC;IACvD,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,iBAAiB,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,EAAE,CAAC,CAAC;IAC1D,OAAO,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC;AAClB,CAAC"}
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ export {};
package/dist/index.js ADDED
@@ -0,0 +1,24 @@
1
+ #!/usr/bin/env node
2
+ import { Command } from "commander";
3
+ import { loginCommand } from "./commands/login.js";
4
+ import { modelCommand } from "./commands/model.js";
5
+ import { usageCommand } from "./commands/usage.js";
6
+ const program = new Command();
7
+ program
8
+ .name("ccm")
9
+ .description("CLI tool to configure claude-code for Bedrock/LiteLLM services")
10
+ .version("1.0.0");
11
+ program
12
+ .command("login")
13
+ .description("Configure API Key and environment variables")
14
+ .action(loginCommand);
15
+ program
16
+ .command("model")
17
+ .description("Interactively select a model")
18
+ .action(modelCommand);
19
+ program
20
+ .command("usage")
21
+ .description("Query current API key balance and quota")
22
+ .action(usageCommand);
23
+ program.parse();
24
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AACnD,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,KAAK,CAAC;KACX,WAAW,CAAC,gEAAgE,CAAC;KAC7E,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,6CAA6C,CAAC;KAC1D,MAAM,CAAC,YAAY,CAAC,CAAC;AAExB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,8BAA8B,CAAC;KAC3C,MAAM,CAAC,YAAY,CAAC,CAAC;AAExB,OAAO;KACJ,OAAO,CAAC,OAAO,CAAC;KAChB,WAAW,CAAC,yCAAyC,CAAC;KACtD,MAAM,CAAC,YAAY,CAAC,CAAC;AAExB,OAAO,CAAC,KAAK,EAAE,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { Separator } from "@inquirer/prompts";
2
+ interface ModelChoice {
3
+ name: string;
4
+ value: string;
5
+ }
6
+ export declare const MODEL_CHOICES: (ModelChoice | Separator)[];
7
+ export {};
@@ -0,0 +1,104 @@
1
+ import { Separator } from "@inquirer/prompts";
2
+ export const MODEL_CHOICES = [
3
+ new Separator("── Anthropic (Claude) ──"),
4
+ {
5
+ name: "Claude Opus 4.6 (Preview) us.anthropic.claude-opus-4-6-v1",
6
+ value: "us.anthropic.claude-opus-4-6-v1",
7
+ },
8
+ {
9
+ name: "Claude Opus 4.5 (Preview) us.anthropic.claude-opus-4-5-20251101-v1:0",
10
+ value: "us.anthropic.claude-opus-4-5-20251101-v1:0",
11
+ },
12
+ {
13
+ name: "Claude Sonnet 4.5 (Preview) us.anthropic.claude-sonnet-4-5-20250929-v1:0",
14
+ value: "us.anthropic.claude-sonnet-4-5-20250929-v1:0",
15
+ },
16
+ {
17
+ name: "Claude Haiku 4.5 (Preview) us.anthropic.claude-haiku-4-5-20251001-v1:0",
18
+ value: "us.anthropic.claude-haiku-4-5-20251001-v1:0",
19
+ },
20
+ {
21
+ name: "Claude 3.7 Sonnet us.anthropic.claude-3-7-sonnet-20250219-v1:0",
22
+ value: "us.anthropic.claude-3-7-sonnet-20250219-v1:0",
23
+ },
24
+ {
25
+ name: "Claude 3.5 Sonnet (v2) us.anthropic.claude-3-5-sonnet-20241022-v2:0",
26
+ value: "us.anthropic.claude-3-5-sonnet-20241022-v2:0",
27
+ },
28
+ {
29
+ name: "Claude 3.5 Sonnet (v1) us.anthropic.claude-3-5-sonnet-20240620-v1:0",
30
+ value: "us.anthropic.claude-3-5-sonnet-20240620-v1:0",
31
+ },
32
+ {
33
+ name: "Claude 3.5 Haiku us.anthropic.claude-3-5-haiku-20241022-v1:0",
34
+ value: "us.anthropic.claude-3-5-haiku-20241022-v1:0",
35
+ },
36
+ {
37
+ name: "Claude 3 Opus us.anthropic.claude-3-opus-20240229-v1:0",
38
+ value: "us.anthropic.claude-3-opus-20240229-v1:0",
39
+ },
40
+ {
41
+ name: "Claude 3 Sonnet us.anthropic.claude-3-sonnet-20240229-v1:0",
42
+ value: "us.anthropic.claude-3-sonnet-20240229-v1:0",
43
+ },
44
+ {
45
+ name: "Claude 3 Haiku us.anthropic.claude-3-haiku-20240307-v1:0",
46
+ value: "us.anthropic.claude-3-haiku-20240307-v1:0",
47
+ },
48
+ new Separator("── OpenAI (GPT) ──"),
49
+ {
50
+ name: "GPT-5.2 (Flagship) gpt-5.2",
51
+ value: "gpt-5.2",
52
+ },
53
+ {
54
+ name: "GPT-5.1 Codex Max gpt-5.1-codex-max",
55
+ value: "gpt-5.1-codex-max",
56
+ },
57
+ {
58
+ name: "GPT-5.1 Codex Mini gpt-5.1-codex-mini",
59
+ value: "gpt-5.1-codex-mini",
60
+ },
61
+ {
62
+ name: "GPT-5 Pro gpt-5-pro",
63
+ value: "gpt-5-pro",
64
+ },
65
+ {
66
+ name: "GPT-5 Chat gpt-5-chat",
67
+ value: "gpt-5-chat",
68
+ },
69
+ {
70
+ name: "GPT-4o gpt-4o",
71
+ value: "gpt-4o",
72
+ },
73
+ {
74
+ name: "o4 Mini o4-mini",
75
+ value: "o4-mini",
76
+ },
77
+ new Separator("── Google (Gemini) ──"),
78
+ {
79
+ name: "Gemini 3 Pro (Preview) gemini/gemini-3-pro-preview",
80
+ value: "gemini/gemini-3-pro-preview",
81
+ },
82
+ {
83
+ name: "Gemini 2.5 Pro gemini/gemini-2.5-pro",
84
+ value: "gemini/gemini-2.5-pro",
85
+ },
86
+ {
87
+ name: "Gemini 2.0 Flash gemini/gemini-2.0-flash",
88
+ value: "gemini/gemini-2.0-flash",
89
+ },
90
+ {
91
+ name: "Gemini 2.0 Flash Lite gemini/gemini-2.0-flash-lite",
92
+ value: "gemini/gemini-2.0-flash-lite",
93
+ },
94
+ new Separator("── Amazon & Others ──"),
95
+ {
96
+ name: "Amazon Nova Pro us.amazon.nova-pro-v1:0",
97
+ value: "us.amazon.nova-pro-v1:0",
98
+ },
99
+ {
100
+ name: "Writer Palmyra X4 us.writer.palmyra-x4-v1:0",
101
+ value: "us.writer.palmyra-x4-v1:0",
102
+ },
103
+ ];
104
+ //# sourceMappingURL=models.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/lib/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAO9C,MAAM,CAAC,MAAM,aAAa,GAAgC;IACxD,IAAI,S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IACtC;QACE,IAAI,EAAE,0DAA0D;QAChE,KAAK,EAAE,6BAA6B;KACrC;IACD;QACE,IAAI,EAAE,oDAAoD;QAC1D,KAAK,EAAE,uBAAuB;KAC/B;IACD;QACE,IAAI,EAAE,sDAAsD;QAC5D,KAAK,EAAE,yBAAyB;KACjC;IACD;QACE,IAAI,EAAE,2DAA2D;QACjE,KAAK,EAAE,8BAA8B;KACtC;IAED,IAAI,SAAS,CAAC,uBAAuB,CAAC;IACtC;QACE,IAAI,EAAE,sDAAsD;QAC5D,KAAK,EAAE,yBAAyB;KACjC;IACD;QACE,IAAI,EAAE,wDAAwD;QAC9D,KAAK,EAAE,2BAA2B;KACnC;CACF,CAAC"}
@@ -0,0 +1,4 @@
1
+ declare const SETTINGS_PATH: string;
2
+ export declare function readSettings(): Promise<Record<string, any>>;
3
+ export declare function writeSettings(settings: Record<string, any>): Promise<void>;
4
+ export { SETTINGS_PATH };
@@ -0,0 +1,22 @@
1
+ import { readFile, writeFile, mkdir } from "node:fs/promises";
2
+ import { homedir } from "node:os";
3
+ import { join } from "node:path";
4
+ const SETTINGS_DIR = join(homedir(), ".claude");
5
+ const SETTINGS_PATH = join(SETTINGS_DIR, "settings.json");
6
+ export async function readSettings() {
7
+ try {
8
+ const raw = await readFile(SETTINGS_PATH, "utf-8");
9
+ return JSON.parse(raw);
10
+ }
11
+ catch (err) {
12
+ if (err.code === "ENOENT")
13
+ return {};
14
+ throw err;
15
+ }
16
+ }
17
+ export async function writeSettings(settings) {
18
+ await mkdir(SETTINGS_DIR, { recursive: true });
19
+ await writeFile(SETTINGS_PATH, JSON.stringify(settings, null, 2) + "\n");
20
+ }
21
+ export { SETTINGS_PATH };
22
+ //# sourceMappingURL=settings.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"settings.js","sourceRoot":"","sources":["../../src/lib/settings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAClC,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,EAAE,EAAE,SAAS,CAAC,CAAC;AAChD,MAAM,aAAa,GAAG,IAAI,CAAC,YAAY,EAAE,eAAe,CAAC,CAAC;AAE1D,MAAM,CAAC,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC;QACH,MAAM,GAAG,GAAG,MAAM,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC,CAAC;QACnD,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACzB,CAAC;IAAC,OAAO,GAAQ,EAAE,CAAC;QAClB,IAAI,GAAG,CAAC,IAAI,KAAK,QAAQ;YAAE,OAAO,EAAE,CAAC;QACrC,MAAM,GAAG,CAAC;IACZ,CAAC;AACH,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,aAAa,CACjC,QAA6B;IAE7B,MAAM,KAAK,CAAC,YAAY,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,MAAM,SAAS,CAAC,aAAa,EAAE,IAAI,CAAC,SAAS,CAAC,QAAQ,EAAE,IAAI,EAAE,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;AAC3E,CAAC;AAED,OAAO,EAAE,aAAa,EAAE,CAAC"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@codefe/cc-manager",
3
+ "version": "0.0.1",
4
+ "description": "CLI tool to configure claude-code for Bedrock/LiteLLM services",
5
+ "type": "module",
6
+ "license": "MIT",
7
+ "author": "Jason King",
8
+ "repository": {
9
+ "type": "git",
10
+ "url": "https://github.com/JasonKing5/cc-manager.git"
11
+ },
12
+ "homepage": "https://github.com/JasonKing5/cc-manager#readme",
13
+ "bugs": {
14
+ "url": "https://github.com/JasonKing5/cc-manager/issues"
15
+ },
16
+ "keywords": [
17
+ "claude-code",
18
+ "bedrock",
19
+ "litellm",
20
+ "cli",
21
+ "anthropic",
22
+ "llm",
23
+ "proxy"
24
+ ],
25
+ "engines": {
26
+ "node": ">=18"
27
+ },
28
+ "files": [
29
+ "dist",
30
+ "LICENSE",
31
+ "README.md"
32
+ ],
33
+ "bin": {
34
+ "ccm": "./dist/index.js"
35
+ },
36
+ "scripts": {
37
+ "build": "tsc",
38
+ "dev": "tsc --watch",
39
+ "start": "node dist/index.js",
40
+ "prepublishOnly": "pnpm build"
41
+ },
42
+ "publishConfig": {
43
+ "access": "public",
44
+ "registry": "https://registry.npmjs.org/"
45
+ },
46
+ "dependencies": {
47
+ "commander": "^13.1.0",
48
+ "@inquirer/prompts": "^7.5.0",
49
+ "chalk": "^5.4.1"
50
+ },
51
+ "devDependencies": {
52
+ "typescript": "^5.7.3",
53
+ "@types/node": "^22.12.0"
54
+ }
55
+ }